The previous post deals with a second-order RLC natural response. Whereas this one deals with a third-order RLC natural response.

% Numerically solving third-order RLC natural response using
% Ordinary Differential Equation (ode) solver
%% -----L---------
% | | |
% Cs Cp Rl
% | | |
% ----------------
clear all;
Cs = 0.5 * 10^(-3);
Cp = 30 *10^-6;
L = 0.1*10^-6;
Rl = 0.1;
a = L;
b = L/(Cp*Rl);
c = (1/Cs) + (1/Cp);
d = 1/(Cp*Rl*Cs);
tspan = [0 0.00005];
init = 0; % i(0+)
init2 = -100/L; % di/dt(0+)
init3 = 0; % d^2i/dt^2(0+)
y0 = [init; init2; init3];
[t, y] = ode45(@(t,y) [y(2); y(3); (-b*y(3)-c*y(2)-d*y(1))/a], tspan, y0);
i1 = y(:,1);
i1_pp = y(:,3); % i1''
% differentiating equation (3) once, we get i2
i2 = -Cp*( ((1/Cs)+(1/Cp))*i1 + L*i1_pp);
figure (2)
plot(t,i2*Rl,'r-')
grid on
X=[0 0.5];
Y=[0 0.5];
xlabel('time (s)')
ylabel('V_{RL} (volts)')

Here is the result:

I have verified the result using LTSPICE IV simulation. Here is the circuit file.

Frankly, it took me quite some time to choose which set of equations, combination of equations that will give solutions. I cannot see them immediately. It is important to choose which current (i1, i2 or i3) to be solved first because either current must be provided with its initial conditions. But not all initial conditions are available for all choice of currents. So, I did *trial and error*. Usually, if your differential equation is in terms of current, then you should choose the current that flows through an inductor. On the other hand, if your differential equation is in terms of voltage, then choose for voltage drop across a capacitor. By doing so, we will have the initial conditions.

If I am not mistaken, another approach using *state equations *provides an easier way to solve even more complex circuits.

### Like this:

Like Loading...

*Related*