Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Define the voltage source
- Vs = 1;
- % Define the capacitor in the circuit
- L=0.2;
- % Define the time lapse that we're going to explore
- t = 0:0.00001: 0.002;
- % Define the resistors in each time constant and
- % calculate the voltage across the capacitor
- %L1=100e-3;
- R1=500;
- V1 = Vs * exp(-R1*t/L);
- %L2=200e-3;
- R2=1000;
- V2 = Vs * exp(-R2*t/L);
- %L3=300e-3;
- R3=1500;
- V3 = Vs * exp(-R3*t/L);
- % Plot the responses, all at once
- plot(t, V1, 'k-', t, V2, 'b', t, V3, 'r')
- grid on
- title('Oscylogram dla układu RL')
- xlabel('Czas (s)')
- ylabel('Napięcie (V)')
- legend(['RL_1 = ' num2str(R1),' Om, ' num2str(L), 'H'],...
- ['RL_2 = ' num2str(R2),' Om, ' num2str(L), 'H'],...
- ['RL_3 = ' num2str(R3),' Om, ' num2str(L), 'H'], 'location', 'best')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement