Documente Academic
Documente Profesional
Documente Cultură
All one-step methods can be expressed in the general form, with the only difference being the
manner in which the slope is estimated. As in the falling parachutist problem, the simplest approach
is to use the differential equation to estimate the slope in the form of the first derivative at x i. In
other words, the slope at the beginning of the interval is taken as an approximation of the average
slope over the whole interval. This approach, called Euler’s method, is discussed in the next section.
This is followed by other one-step methods that employ alternative slope estimates that result in
more accurate predictions. All these techniques are generally called Runge-Kutta (RK) methods.
Euler’s Method
The first derivative provides a direct estimate of the slope at xi:
f xi , y i
dy
dx xi
and the Euler method uses that estimate as the increment function:
𝜙 = 𝑓(𝑥𝑖 , 𝑦𝑖 )
where f (xi, yi) is the differential equation evaluated at xi and yi. This estimate can be substituted to
1
get
Page
𝑦𝑖+1 = 𝑦𝑖 + 𝑓 𝑥𝑖 , 𝑦𝑖 ℎ
Prepared BY
Shahadat Hussain Parvez
EEE 305 Lecture 12: Initial Value Problems
This formula is referred to as Euler’s (or the Euler-Cauchy or the point-slope) method. A new value of
y is predicted using the slope (equal to the first derivative at the original value of x) to extrapolate
linearly over the step size h (Fig. 2).
Prepared BY
Shahadat Hussain Parvez
EEE 305 Lecture 12: Initial Value Problems
Heun’s Method
One method to improve Euler’s method is to determine derivatives at the beginning and predicted
ending of the interval and average them:
Figure 3 Graphical depiction of Heun’s method. (a) Predictor and (b) corrector.
This process relies on making a prediction of the new value of y, then correcting it based on the
slope calculated at that new value.
From Eulers method
𝑦𝑖′ = 𝑓(𝑥𝑖 , 𝑦𝑖 )
Is used to extrapolate linearly to 𝑦𝑖+1 :
0
𝑦𝑖+1 = 𝑦𝑖 + 𝑓 𝑥𝑖 , 𝑦𝑖 ℎ
For the standard Euler method we would stop at this point. However, in Heun’s method the y 0i +1
calculated in last equation is not the final answer, but an intermediate prediction. This is why we
have distinguished it with a superscript 0. This equation is called a predictor equation. It provides an
estimate of yi+1 that allows the calculation of an estimated slope at the end of the interval:
′ 0
𝑦𝑖+1 = 𝑓(𝑥𝑖+1 , 𝑦𝑖+1 )
Thus, the two slopes can be combined to obtain an average slope for the interval:
This average slope is then used to extrapolate linearly from yi to yi+l using Euler’s method:
𝑗 −1 𝑗
where 𝑦𝑖+1 𝑎𝑛𝑑 𝑦𝑖+1 are the result from the prior and the present iteration of the corrector,
Page
respectively.
Prepared BY
Shahadat Hussain Parvez
EEE 305 Lecture 12: Initial Value Problems
Midpoint Method
Another improvement to Euler’s method is similar to Heun’s method, but predicts the slope at the
midpoint of an interval rather than at the end:
This method has a local truncation error of O(h3) and global error of O(h2)
yi 1 yi
1
k1 2k2 2k3 k4 h
6
where:
k1 f x i , y i
1 1
k 2 f x i h, y i k1 h
2 2
1 1
k 3 f x i h, y i k 2 h
4
2 2
k 4 f x i h, y i k 3 h
Page
Prepared BY
Shahadat Hussain Parvez
EEE 305 Lecture 12: Initial Value Problems
Figure 4 Graphical depiction of the slope estimates comprising the fourth-order RK method.
Example 25.7
5
Page
Prepared BY
Shahadat Hussain Parvez
EEE 305 Lecture 12: Initial Value Problems
Figure 5 Comparison of percent relative error versus computational effort for first- through fifth-order RK methods
Systems of Equations
Many practical problems require the solution of a system of equations:
dy1
f 1 x , y1 , y 2 , , y n
dt
dy 2
f 2 x , y1 , y 2 , , y n
dt
dy n
f n x , y1 , y 2 , , y n
dt
The solution of such a system requires that n initial conditions be known at the starting value of x.
Solution Methods
Single-equation methods can be used to solve systems of ODE’s as well; for example, Euler’s method
can be used on systems of equations - the one-step method is applied for every equation at each
step before proceeding to the next step.
Fourth-order Runge-Kutta methods can also be used, but care must be taken in calculating the k’s.
Prepared BY
Shahadat Hussain Parvez