Numerical methods-II PDF
Numerical methods-II PDF
Numerical methods-II PDF
3 Decimal places.
Example 2. Use Taylor series method to find y(0.1) and y (0.2) from the
equation = with y(0)=1.
Solution. Given = . Therefore (0) = 0.
= , (0) = 1
= 2 , (0) = 0
= 3 , (0) = 3 Similarly, (0) = 0, (0) = 15
Substituting these values in the above Taylor series expansion (2),we get
2 3 4 5 6
=1+0+ (1) + (0) + (3) + (0) + (15) +.. .
2! 3! 4! 5! 6!
2 4 6
=1 + +
2 8 48
Exercises: Use Taylor series method to solve the differential equations
numerically correct to three decimal places.
i) = 2 + 3 , y(0)=1 at x=0.1
ii) = (1 2 2 ), y(0)=1 at x=0.1 and x=0.2
Eulers Method:
In Taylor series method, we express a series for y in terms of powers of x,
from which the value of y can be obtained by direct substitution. As the
approximation is poor, we derive Euler method by using Taylor series method,
where the values of y are computed by short steps ahead for equal intervals
h of the independent variable.
dy
Consider the differential equation f (x, y)
dx
with the initial condition y(x 0 ) y0 .
If y(x) is the exact solution of the above equation, then the Taylors
Taking x1 x 0 h , we get y1 y0 h f (x 0 , y0 ) .
Similarly y2 y1 h f (x1 , y1 ) .
Solution. (, ) = + 2 .
+1 = + ( , ) = + 0.1( + 2) Let us take n=10 and h=0.1.
The various calculations are arranged as follows.
Note: In Euler method, the interval length h should be kept small and
hence these methods can be applied for tabulating y over a limited range
only.
Exercise
length h=0.05.
Runge-Kutta Methods
Introduction:
Eulers method is less efficient in practical problems since it requires h to be
small for obtaining reasonable accuracy. The Runge-Kutta methods are designed
to give greater accuracy and they possess the advantage of requiring only the
function value at some selected points on the subinterval. The basic idea of R-
K methods is to approximate the integral by a weighted average of slopes and
approximate slopes at a number of points in the interval [ xi, x i+1]
Consider the initial value problem = (, ), ( ) = .
That is the value of y at x = xi is : = + ( + ).
Where, = ( , )
= ( + , + ).
Example 1. Apply RK method of order two to find the value of y when x=0.2,
given that = + y=1 when x=0.
Where = ( , )
= ( + , + )
= ( + , + )
= ( + , + ).
Example 1. Using 4th order Runge Kutta method , solve = + 2 with
y(0)=1 at x= 0.2 in steps of length h=0.1
Solution. Here (, ) = + 2 x0=0, y0=1 , h=0.1, x1= 0+h=0.1,
x2 = 0.1+0.1=0.2 To fond y2=y(x2)=y(0.2).
k1 = h f(x0, y0)=(0.1)(0+12)=0.1
k2 = h f(x0+h/2, y0+k1/2)=(0.1)f(0.05, 1.05)=0.11525
k3 = h f(x0+h/2, y0+k2/2)=(0.1)f(0.05, 1.057625)=0.116857
k4 = h f(x0+h, y0+k3)=(0.1)f(0.1, 1.116857)=0.13474. Then using RK formula,
= ( + ) = + ( + + + ) we get
we get
y2 = y(0.4)= 0.2027074+1/6(0.208218 +2 (0.2188272 +2(0.21948319) +
0.235649) ) =0.42279.
Exercise :