Electronic – Matlab and RLC analysis

MATLAB

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).

Best Answer

Description of equations

Figure swhoing overshoot

You see there's a slight overshoot, if you are familiar with "damping coefficient" (or you can look it up) you'll see that tinkering with the values of L & C will vary the overshoot (or eliminate it).

You can download the PDF instead of the images if you wish to have it on your computer:

http://bit.ly/StepResponseRLC

Any further questions, feel free.