Analysing the circuit

MrAl

Joined Jun 17, 2014
13,707
I think there is some mistake in V(s), i will correct that, calculate I(s) and the time domain output.
Ok good, I'd like to see what you can come up with.

There is also another way. Using a numerical ODE solver method like Eulers or Taylors or a host of others.
I tried it just to see how it would do, and it was able to calculate the response every 1us and 25us per half cycle.
I calculated 8000 half cycles and it came out with a di/dt of 1.5 amps and very small dv/dt for the cap. That was using 200uH for the inductor and 400uF for the capacitor. The wave changes a lot before it gets close to 0.1 seconds and then the on and off cycles start to repeat. Once that happens, you can see the jump in current from the last on cycle to the next off cycle pretty clearly.

Code:
Cy#=half cycle number, M=switch mode: on=1 off=0, t=time (secs),
iL=inductor current, vC cap voltage, E-vC input minus output voltages
--Ending results after 8000 half cycles (L=200uH, C=400uF):
    Cy#  M    t         iL        vC          E-vC
--  7990 0  0.199750  1.220803  24.024075  -12.024075
--  7991 1  0.199775  2.720803  23.961590  -11.961590
--  7992 0  0.199800  1.220871  24.024186  -12.024186
--  7993 1  0.199825  2.720871  23.961701  -11.961701
--  7994 0  0.199850  1.220926  24.024300  -12.024300
--  7995 1  0.199875  2.720926  23.961815  -11.961815
--  7996 0  0.199900  1.220966  24.024417  -12.024417
--  7997 1  0.199925  2.720966  23.961931  -11.961931
--  7998 0  0.199950  1.220992  24.024535  -12.024535
--  7999 1  0.199975  2.720992  23.962049  -11.962049
--  8000 0  0.200000  1.221003  24.024654  -12.024654
 

Thread Starter

Vihaan@123

Joined Oct 7, 2025
247
It took quite long to find the time domain of the v(t) and i(t), V(s) and I(s) was easier, the final results are

1763217706309.png

v(t) =
1763217733287.png
i(t) =
1763217752593.png
I had to take the help of maxima, i could not have done manually. Now the question is the equations are too big to understand or work with it, what shall i do next, shall i understand the circuit behaviour with average values? which i have not done yet.
 

MrAl

Joined Jun 17, 2014
13,707
It took quite long to find the time domain of the v(t) and i(t), V(s) and I(s) was easier, the final results are

View attachment 358909

v(t) =
View attachment 358910
i(t) =
View attachment 358911
I had to take the help of maxima, i could not have done manually. Now the question is the equations are too big to understand or work with it, what shall i do next, shall i understand the circuit behaviour with average values? which i have not done yet.
Hi again,

Those are probable right, the next thing to do would be to use them in some calculations. To do that, you do a few steps:
1. Set v0 and i0 both equal to zero, that is the starting point where you first turn the converter 'on'.
2. Calculate both of these:
V=v(t)
I=i(t)
that is the solution at the end of the first half cycle for both iL and vC.
Next, set v0=vC and i0=iL, then repeat the calculations. That is the solution for the end of the 2nd half cycle where you get yet another new vC and iL.
Using the new vC and iL, repeat the calculations yet again. That gives you the solution for vC and iL at the end of the third half cycle.
Keep repeating this procedure until you get vC and iL that start to repeat from one full cycle to the next. That's steady state. You can then calculate the inductor ripple current and capacitor ripple voltage. That helps to decide if you have the right values for L and C.

Yes using averaging could be an option and that would give you another view. However, there is another standard way to do it and that is to:
1. Write the ODE's (I think you did that already), and get the derivatives on the left hand side of both equations.
2. Solve the ODE's using a standard ODE solver method like Taylors Method. You could also use Maxima but you'll have to look that up.
The Taylors Method is easy to remember you can do a few steps by hand. The method reads like this:
iL=iL+h*di/dt, where 'iL' is the inductor current and di/dt is from the ODE for the inductor current.
vC=vC+h*dv/dt where vC is the cap voltage and dv/dt is from the ODE for the cap voltage.
The 'h' is the step size, typically small, and for this problem 1us (1e-6) should be good enough.
This is a first order Taylors Method which is good enough if you keep the step size small, like say 1us. That means you will be doing 25 calculations per half cycle.
Now of course after 25 steps you have to turn the switch off, which brings you to the next topology which means the ODE's change. When you write the ODE's though you write both sets which means two for the cap voltage and two for the inductor current. You then switch after each set of 25 calculations. After 25 steps with the switch off you then "turn the switch back on" by switching back to the first set of ODE's.
After enough time (like maybe 4000 or more switch cycles) you will start to see the values repeat at the end of each half cycle. That's when you know you had reached steady state. That's the main goal really so you can calculate the ripple values.
This is a very interesting method because it's so easy to remember, and you can do it with any computer language like even Basic.

Using Maxima, you just use a function like "desolve" and you can read up on that for the complete syntax and what the parameters are.

The 2nd order Taylors method for the inductor current would be:
iL=iL+h*(di/dt)-h^2*(di/dt)/2
and 4th order would just build on that:
iL=iL+h*(di/dt)-h^2*(di/dt)/2+h^3*(di/dt)/6-h^4*(di/dt)/24
and the denominator constants are just factorials: 2! and 3! and then 4! for 4th order, etc.
Also note the sign alternates, positive for odd powers, negative for even powers.
For the current problem the first order solution is good enough, and in that case there are other names for the Method also.
If you are really interested in this (and it's a good idea) you could look up other methods. One of the most popular is RKF45 which you can find on the web. That's more complicated to implement in code though and not needed for this problem. We generally need that for more complicated problems like for nonlinear systems.

There is also matrix methods where the system is described in terms of state variables and then a matrix is solved to get the solutions.
In that case it could be called a state vector differential equation, or just State Space.

There are a lot of other aspects to these circuit solutions too though, like general averaging methods. For now you might just start using these methods above and get a feel for it. The averaging method depends on finding the simple solution like Vout=Vin/(1-D) and then using that to figure other things out. The averaging method we talked about previously is a different averaging method which attempts to find solutions for each half cycle like the pure time domain solutions.

As far as understanding the equations themselves, it depends what it is you want to understand. If you want to see how each part of the solution works then you might try using partial fraction decomposition, then use the Inverse Laplace Transform on each term. That gives you a time solution that is a sum of the more basic parts of the equation which could give you more insight as to how these equations work.
Maxima also does partial fractions so that should not be difficult either.

To make the Taylors Method a little more clear, it helps to use the notation:
x1=di/dt (for the inductor current)
and
x2=dv/dt (for the cap voltage).
This leads to a more compact form which of course is the same thing:
X1=X1+h*x1-h^2*x1/2
X2=X2+h*x2-h^2*x2/2
and be sure to note the upper case is the variable, and lower case is the derivative of the variable.
So for example X2 is the cap voltage itself, while x2 is the derivative of the cap voltage.
This makes it a lot simpler to type in and remember.

Once you do a few of these problems it starts to become amazingly simple and easy to do.
 
Top