You are on page 1of 4

NMPDEA Numerical methods for PDE and applications

Cristinel Moise

5 11 0.083 0.51

Solution:
- Write Kirchhoff’s equations in ratio to currents (i1,i2) and time (t).

2
d i1 di1 d ( i1−i2 ) dE dE/dt ≈ 0
L 2
+ R1 +R 2 =
dt dt dt dt

d i2
2
d ( i2−i 1 ) 1 d q 2
L 2
+R 2 + =0
dt dt C dt

'' −R 1 ' R 2 ' R 2 '


i1 = i1 − i1 + i2
L L L
'' −R 2 ' R 2 ' 1
i2 = i2 + i1 − i2
L L L. C
To solve the equations above, we convert them to first-order equations by letting:

[ ][ ]
y1 i1
'
y2 = i1
y3 i2
'
y4 i2

The equivalent first-order equations become:

[ ][ ]
y2
y 1' −R 1 R2 R2
' y 2− y 2+ y4
y = y 2' = L L L
'

y3 y4
y4
' −R 2 R2 1
y 4+ y 2− y3
L L L.C

- Write the function code for the previous equations:

- Write the function code for the solving method ( Fourth-order Runge-Kutta Method):
- Write the function code that represents the numerical solution using Fourth-order Runge-Kutta
Method:

- Write the executive program that contains all the previous functions along with initial conditions
and plot orders :

- Run the program:

You might also like