0% found this document useful (0 votes)
138 views7 pages

Runge-Kutta 4th Order Method For Ordinary Differential Equations-More Examples Computer Engineering

1) The document discusses using the 4th order Runge-Kutta method to solve an ordinary differential equation modeling the charging of a capacitor in a power supply. 2) As an example, it provides the equation for the specific power supply with a 150 μF capacitor and uses the Runge-Kutta method to solve for the voltage at t = 0.00004 s in steps of 0.00002 s. 3) The method calculates the slope (k values) at each step using the given equation and sums them to determine the final approximate voltage of 26.661 V.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
138 views7 pages

Runge-Kutta 4th Order Method For Ordinary Differential Equations-More Examples Computer Engineering

1) The document discusses using the 4th order Runge-Kutta method to solve an ordinary differential equation modeling the charging of a capacitor in a power supply. 2) As an example, it provides the equation for the specific power supply with a 150 μF capacitor and uses the Runge-Kutta method to solve for the voltage at t = 0.00004 s in steps of 0.00002 s. 3) The method calculates the slope (k values) at each step using the given equation and sums them to determine the final approximate voltage of 26.661 V.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

Chapter 08.

04
Runge-Kutta 4th Order Method for Ordinary
Differential Equations-More Examples
Computer Engineering
Example 1
A rectifier-based power supply requires a capacitor to temporarily store power when the
rectified waveform from the AC source drops below the target voltage. To properly size this
capacitor a first-order ordinary differential equation must be solved. For a particular power
supply, with a capacitor of 150 μF , the ordinary differential equation to be solved is

dv(t ) 1 
  18 cos120  t    2  v t   
  0.1  max ,0 
dt 150  10  6 
  0.04 

v (0)  0

Using the Runge-Kutta 4th order method, find voltage across the capacitor at t  0.00004 s .
Use step size h  0.00002 s .
Solution
dv 1 
  18 cos120  t    2  v  
  0.1  max ,0 
dt 150  10  6 
  0.04 

1 
  18 cos120  t    2  v  
f  t, v   0.1  max ,0 
150  10 6 
  0.04 

1
vi 1  vi  k1  2 k 2  2 k 3  k 4  h
6
For i  0 , t 0  0 , v 0  0
k1  f  t 0 , v 0 
 f  0,0 
1 
  18 cos120  0    2   0   
  0.1  max ,0 
150  10  6 
  0.04 

1
   0.1  max  400,0
150  10 6
1
   0.1  400
150  10 6
 2.6660  10 6

08.05.1
08.05.2 Chapter 08.05

 1 1 
k 2  f  t 0  h, v 0  k 1 h 
 2 2 
 f  0   0.00002 ,0   2.6660  106 0.00002 
 1 1 
 2 2 
 f  0.00001,26.660
1 
  18 cos120  0.00001   2   26.660  
  0.1  max ,0 
150  10 6 
  0.04 

1
   0.1  max   266.50,0
150  10 6
1
   0.1  266.50
150  10 6
 666.67
 1 1 
k 3  f  t 0  h, v 0  k 2 h 
 2 2 
 1 1 
 f  0   0.00002 ,0    666.67  0.00002 
 2 2 
 f  0.00001,0.0066667 
1 
  18 cos120  0.00001   2    0.0066667    
  0.1  max  ,0  
150  10  6 
  0.04 
1
   0.1  max 400.16,0
150  10 6
1
   0.1  400.16
150  10 6
 2.6671  106
k 4  f  t 0  h, v 0  k 3 h 
 
 f 0  0.00002,0  2.6671 10 6 0.00002  
 f  0.00002 , 53.342
1 
  18 cos120  0.00002   2   53.342  
  0.1  max ,0 
150  10 6 
  0.04 

1
   0.1  max  933.56,0
150  10 6
1
   0.1  0
150  10 6
 666.67
1
v1  v 0 ( k1  2 k 2  2 k 3  k 4 ) h
6
 0   2.6660  106  2  666.67  2 2.6671  106     666.67 0.00002
1
6
1

 0  7.9982  10 6 0.00002
6

 26.661 V
Runge-Kutta 4th Order Method for ODE-More Examples: Computer Engineering 08.05.3

v1 is the approximate voltage at


t  t1  t 0  h  0  0.00002  0.00002
v  0.00002   v1  26.661 V
For i  1, t1  0.00002, v1  26.661
k1  f  t1 , v1 
 f  0.00002,26.661
1 
  18 cos120  0.00002   2   26.661  
  0.1  max ,0 
150  10 6 
  0.04 

1
   0.1  max  266.51,0
150  10 6
1
   0.1  0
150  10 6
 666.67
 1 1 
k 2  f  t1  h, v1  k1 h 
 2 2 
 1 1 
 f  0.00002   0.00002 ,26.661    666.67  0.00002 
 2 2 
 f  0.00003,26.654 
1 
  18 cos120  0.00003   2   26.654  
  0.1  max ,0 
150  10 6 
  0.04 

1
   0.1  max  266.35,0
150  10 6
1
   0.1  0
150  10 6
 666.67
 1 1 
k 3  f  t1  h, v1  k 2 h 
 2 2 
 1 1 
 f  0.00002   0.00002 ,26.661    666.67  0.00002 
 2 2 
 f  0.00003,26.654 
1 
  18 cos120  0.00003   2   26.654  
  0.1  max ,0 
150  10 6 
  0.04 

1
   0.1  max  266.35,0
150  10 6
1
   0.1  0
150  10 6
 666.67
k 4  f  t1  h, v1  k 3 h 
 f  0.00002   0.00002  ,26.661    666.67  0.00002 
 f  0.00003,26.647 
08.05.4 Chapter 08.05

1 
  18 cos120  0.00003   2   26.634  
  0.1  max ,0 
150  10 6 
  0.04 

1
   0.1  max  265.87,0
150  10 6
1
   0.1  0
150  10 6
 666.67

1
v 2  v1  ( k1  2 k 2  2 k 3  k 4 ) h
6
1
 26.661    666.67  2  666.67   2  666.67     666.67   0.00002
6
1
 26.661    4000.0 0.00002
6
 26.647 V
v 2 is the approximate voltage at t  t 2
t 2  t1  h = 0.00002  0.00002  0.00004 s
v .00004  v 2  26.647 V

Figure 1 compares the exact solution of v 0.00004   15.974 V with the numerical solution
using Runge-Kutta 4th order method step size of h  0.00002 s .
Runge-Kutta 4th Order Method for ODE-More Examples: Computer Engineering 08.05.5

Figure 1 Comparison of Runge-Kutta 4th order method with exact solution for
different step sizes.

Table 1 and Figure 2 shows the effect of step size on the value of the calculated temperature
at t  0.00004 s .

Table 1 Value of voltage at time, t  0.00004 s for different step sizes.

Step size, v 0.00004  Et |t | %


h
0.00004 53.335 37.361 233.89
0.00002 26.647 10.673 66.817
0.00001 15.986 0.012299 0.076996
0.000005 15.975 0.00050402 0.0031552
0.0000025 15.976 0.0015916 0.0099639
08.05.6 Chapter 08.05

Figure 2 Effect of step size in Runge-Kutta 4th order method.

In Figure 3, we are comparing the exact results with Euler’s method (Runge-Kutta 1 st order
method), Heun’s method (Runge-Kutta 2nd order method) and Runge-Kutta 4th order method.
Runge-Kutta 4th Order Method for ODE-More Examples: Computer Engineering 08.05.7

Figure 3 Comparison of Runge-Kutta methods of 1st, 2nd, and 4th order.

You might also like