I'm trying to plot the response of a series RLC circuit to a step function using Matlab.
I've read a bit around it, but I can't get it to work. Help would be much appreciated.
Here is my Matlab code:
solution = dsolve('square(5, 50) / ((47*10^(-3) * 1*10^(-6))) = D2y + 220/(47*10^(-3)) * Dy + 1/(47*10^(-3) * 1*10^(-6)) * y', 'y(0) = 0', 'Dy(0) = 0', 'x');
ezplot('solution');
The values of the RLC circuit are: \$R = 220\Omega\$, \$L = 47\$mH and \$C = 1\mu\$F. The equation for the capacitor voltage (which is what I'm tring to plot) is: $$v''(t) + \frac{R}{L}v'(t) + \frac{1}{LC}v(t) = \frac{v_s}{LC}$$
\$v(t)\$ is the capacitor voltage and \$v_s\$ is the source voltage (which is a \$5\$Vpp square wave).