Maths
Maths
Step 1. Let ( xi , yi ) , i = 1 , 2, , n be the ‘n’ sets of observations and let the related relation
be y = ax + b.
Step 2. The normal equations are
n n n n n
a xi + nb = yi − − − (1) a xi2 + b xi = xi yi − − − (2)
i =1 i =1 i =1 i =1 i =1
Step 3. Solve for a and b from (1) and (2) and obtain the best fit y = ax + b.
3. Write down the steps involved in fitting a parabola by the method of least squares.
Step 1: Let ( xi , yi ) , i = 1 , 2, , n be the ‘n’ sets of observations and let the related relation
be y = ax 2 + bx + c.
Step 2: The normal equations are
n n n n n n n
a xi 2 + b xi + nc = yi − − − (1) ; a xi2 + b xi + c xi = xi yi − − − (2)
i =1 i =1 i =1 i =1 i =1 i =1 i =1
n n n n
a xi4 + b xi 3 + c xi 2 = xi 2 yi − − − (3)
i =1 i =1 i =1 i =1
Step 3 : Solve for a and b from (1), (2) and (3) and obtain the best fit y = ax 2 + bx + c.
Let f ( x) = x3 – 2 x + 5
f( – 1) = 6 = positive ; f( – 2) = 1 = positive ; f( – 3) = – 16 = Negative
Hence the root lies between – 3 and – 2
6. State Fixed point theorem.
Suppose the equation f ( x) = 0 can be written in the form x = g ( x ) . Let ‘ a’ be a root of f ( x) = 0
and let I be the interval containing ‘a’. If g ( x) and g '( x) are continuous in I and
g '( x) a 1, x , then the sequence of successive approximations x0 , x1 ,... converges to ‘a’.
Let x = N x 2 = N .
Take f ( x) = x 2 − N f '( x) = 2 x
f ( xn ) xn2 − N
xn+1 = xn − = xn −
f '( xn ) 2 xn
1 N
xn+1 = xn +
2 xn
1 N
The Newton’s algorithm for N is x n+1 = xn + .
2 xn
Let f ( x) = x 2 − 15.
f (3) = 9 − 15 = −6 (−ve) ; f (4) = 16 − 15 = 1 (+ve)
The root lies between 3and 4.
Let x0 = 3, N = 15
1 N 1 15
x1 = x0 + = 3 + = 4
2 x0 2 3
1 15
x2 = 4 + = 3.875
2 4
1 15
x3 = 3.875 + = 3.873
2 3.875
1 15
x4 = 3.873 + = 3.873
2 3.873
Hence x3 = x4
The value of 15 is 3.873
13. Find an iterative formula to the reciprocal of a given number N, by Newton’s method
1 1
Let x = N=
N x
1 −1
f ( x) = − N ; f '( x) = 2
x x
1
−N
f ( xn ) xn 1
Now xn +1 = xn − = xn − = xn + xn2 − N
f ( xn ) −1 xn
2
xn
xn +1 = xn (2 − Nxn )
14. Distinguish between direct and iterative method of solving simultaneous equation.
In this method the augmented matrix [A , B] is transformed into an equivalent upper triangular
matrix by elementary row operations, and then by back substitution we get the solution.
Gauss Seidel method is faster. In this method, the latest values of unknowns at each stage of
iterations are used in preceding to the next stage of iteration.
A matrix is diagonally dominant if the numerical value of the leading diagonal element in each
row is greater than or equal to the sum of the numerical values of the other element in that row.
i.e. a1 b1 + c1 ; b2 a2 + c2 ; c3 a3 + b3
19. State the condition for the convergence of Gauss Seidel technique.
Given equation are not diagonally dominant in the current form. Interchanging the equations, it
becomes diagonally dominant.
Let the equation be 28 x + 4 y − z = 32, 2 x + 17 y + 4 z = 35 , x + 2 y + 10 z = 24 .
1 1
Now it is diagonally dominant: x = ( 32 − 4 y + z ) , y = ( 35 − 2 x − 4 z ) ,
28 17
1
z= ( 24 − x − 2 y )
10
First iteration: Let y = 0, z = 0
( 32 − 4 y + z ) = ( 32 − 4 ( 0 ) + 0 ) = ( 32 ) = 1.142
1 1 1
x=
28 28 28
x y X Y X2 X3 X4 XY X2 Y
1929 352 –3 –5 9 –27 81 15 –45
1930 356 –2 –1 4 –8 16 2 –4
1931 357 –1 0 1 –1 1 0 0
1932 358 0 1 0 0 0 0 0
1933 360 1 3 1 1 1 3 3
1934 361 2 4 4 8 16 8 16
1935 361 3 4 9 27 81 12 36
Total 0 6 28 0 196 40 6
Hence, the normal equations become,
28a + 7c = 6 − − − − − ( 4 ) ; 28b = 40 − − − − − (5 ) 196a + 28c = 6 − − − − − ( 6 )
From (5), b = 1.4286
Substitute the value of b in (4) and (6), we get, a = –0.21429 and c = 1.7143
The equation is Y = – 0.21429 X 2 + 1.4286 X + 1.7143
y – 357 = –0.21429 ( x –1932 ) + 1.4286 ( x –1932 ) + 1.7143
2
x y x2 x3 x4 xy x2y y2
1 4 1 1 1 4 4 16
2 8 4 8 16 16 32 64
3 10 9 27 81 30 90 100
4 12 16 64 256 48 192 144
5 16 25 125 625 80 400 256
6 20 36 216 1296 120 720 400
Total 21 70 91 441 2275 298 1438 980
The normal equations are 21a + 7b = 70 -----(1) & 91a + 21b = 298 -----(2)
Solving (1) and (2), we get, a = 3.1428 and b = 0.5714
The best straight line fit is y = 3.1428 x + 0.5714
(ii) Fitting Parabola Equation
The normal equations are
n n n n n n n
a xi 2 + b xi + nc = yi − − − (1) a xi2 + b xi + c xi = xi yi − − − (2)
i =1 i =1 i =1 i =1 i =1 i =1 i =1
n n n n
a xi4 + b xi 3 + c xi 2 = xi 2 yi − − − (3)
i =1 i =1 i =1 i =1
x y x2 x3 x4 xy x2y y2
0 1 0 0 0 0 0 1
1 1.8 1 1 1 1.8 1.8 3.24
2 1.3 4 8 16 2.6 5.2 1.69
3 2.5 9 27 81 7.5 22.5 6.25
4 6.3 16 64 256 25.2 100.8 39.69
Total 10 12.9 30 100 354 37.1 130.3 51.87
The normal equations are 10a + 5b = 12.9 -----(1)
30a + 10b = 37.1 -----(2)
Solving (1) and (2), we get, a = 1.33 and b = 0.32
The best straight line fit is y = 1.33x + 0.32
Error: E1 = y 2
− a xy − b y = 51.87 − 1.33(37.1) − 0.32(12.9) = −1.60
(ii) Fitting Parabola Equation
1
Clearly ' ( x ) = 1 in ( 0,1)
2 ( x + 1)
3/2
1
For when x = 0.5, ' ( 0.5) = 1
2 (1.5)
3/2
6. Find a positive root of the equation cos x − 3 x + 1 = 0 by the method of fixed point iteration.
Find the approximate root of e = 3 x by fixed point iteration method correct to four
x
7.
decimal places.
Solution: Let f ( x) = e x − 3x
f ( 0 ) = e0 − 3(0) = 1( +ve ) ; f (1) = e1 − 3 (1) = −0.2817 = ( −ve )
Therefore a root lies between 0 and 1.
ex
The given equation can be written as x =
3
ex ex
Let ( x) = , ' ( x) =
3 3
Here ' ( x) 1 in the interval [0,1]
By fixed point iteration method, xn +1 = ( xn )
f ( xn )
We know that Newton’s formula is xn +1 = xn −
f ' ( xn )
The first approximation to the root is given by
f ( x0 ) x log x − 1.2 3log10 3 − 1.2
x1 = x0 − = x0 − 0 10 0 = 3− = 2.746
f ' ( x0 ) log10 x0 + 0.4343 log10 3 + 0.4343
The second approximation to the root is given by
f ( x1 ) x log x − 1.2 2.746log10 2.746 − 1.2
x2 = x1 − = x1 − 1 10 1 = 2.746 − = 2.741
f ' ( x1 ) log10 x1 + 0.4343 log10 2.746 + 0.4343
The third approximation to the root is given by
f ( x2 ) x log x − 1.2 2.741log10 2.741 − 1.2
x3 = x2 − = x2 − 2 10 2 = 2.741 − = 2.741
f ' ( x2 ) log10 x2 + 0.4343 log10 2.741 + 0.4343
Hence the real root of f ( x ) = 0, correct to three decimal places is 2.741
10. Find Newton’s iterative formula to find the reciprocal of a given number N and hence find
1
the value of
19
1 1
Solution : Let x = =N
N x
1 −1
Let f ( x ) = − N = 0; f '( x) =
x x2
f ( xn )
We know that Newton’s iterative formula is xn +1 = xn −
f ' ( xn )
1
−N
xn 1
= xn − = xn + xn2 − N = xn + xn − Nxn2
−1 xn
2
x
= xn 2 − Nxn − − − − − − (1)
2 −1 3 x
Solution: The given system is equivalent to AX = B, where A = −1 2 1 , X = y ,
3 1 −4 z
8
B = 4 .
0
2 −1 3 8
The augmented matrix is [A|B] = −1 2 1 4
3 1 −4 0
2 −1 3 8
0 3/ 2 5/ 2 8 R2 → R2 + (1/ 2) R1
0 5/ 2 −17 / 2 −12 R3 → R3 − (3 / 2) R1
2 −1 3 8
0 3/ 2 5/ 2 8
0 0 −38 / 3 −76 / 3 R3 → R3 − (5 / 3) R2
1 2 1 3
The augmented matrix is [A|B] = 2 3 3 10
3 −1 2 13
1 2 1 3
0 −1 1 4 R2 → R2 − 2 R1
0 −7 1 4 R3 → R3 − 3R1
1 2 1 3
0 −1 1 4
0 0 −8 −24 R → R − 7 R
3 3 2
1 1 1
x4 = ( 6 − 2 y3 + z3 ) y4 = ( 5 − 2 x4 + 3z3 ) z4 = (12 − x4 + 2 y4 )
5 6 5
IV
= ( 6 − 2 (1.804 ) + 2.894 ) = ( 5 − 2 (1.057 ) + 3 ( 2.894 ) ) = (12 − 1.057 + 2 (1.928 ) )
1 1 1
5 6 5
= 1.057 = 1.928 = 2.960
1 1 1
x5 = ( 6 − 2 y4 + z4 ) y5 = ( 5 − 2 x5 + 3z4 ) z5 = (12 − x5 + 2 y5 )
5 6 5
V
= ( 6 − 2 (1.928 ) + 2.960 ) = ( 5 − 2 (1.021) + 3 ( 2.960 ) ) = (12 − 1.021 + 2 (1.973) )
1 1 1
5 6 5
= 1.021 = 1.973 = 2.985
1 1 1
x6 = ( 6 − 2 y5 + z5 ) y6 = ( 5 − 2 x6 + 3z5 ) z6 = (12 − x6 + 2 y6 )
5 6 5
VI
= ( 6 − 2 (1.973) + 2.985 ) = ( 5 − 2 (1.008 ) + 3 ( 2.985 ) ) = (12 − 1.008 + 2 (1.990 ) )
1 1 1
5 6 5
= 1.008 = 1.990 = 2.994
1 1 1
x7 = ( 6 − 2 y6 + z6 ) y7 = ( 5 − 2 x7 + 3z6 ) z7 = (12 − x7 + 2 y7 )
5 6 5
VII
= ( 6 − 2 (1.990 ) + 2.994 ) = ( 5 − 2 (1.003) + 3 ( 2.994 ) ) = (12 − 1.003 + 2 (1.996 ) )
1 1 1
5 6 5
= 1.003 = 1.996 = 2.998
1 1 1
x8 = ( 6 − 2 y7 + z7 ) y8 = ( 5 − 2 x8 + 3z7 ) z8 = (12 − x8 + 2 y8 )
5 6 5
VIII
= ( 6 − 2 (1.996 ) + 2.998 ) = ( 5 − 2 (1.001) + 3 ( 2.998 ) ) = (12 − 1.001 + 2 (1.999 ) )
1 1 1
5 6 5
= 1.001 = 1.999 = 2.999
1 1 1
x9 = ( 6 − 2 y8 + z8 ) y9 = ( 5 − 2 x9 + 3z8 ) z9 = (12 − x9 + 2 y9 )
5 6 5
IX
= ( 6 − 2 (1.999 ) + 2.999 ) = ( 5 − 2 (1.000 ) + 3 ( 2.999 ) ) = (12 − 1.000 + 2 ( 2.000 ) )
1 1 1
5 6 5
= 1.000 = 2.000 = 3.000
1 1 1
x10 = ( 6 − 2 y9 + z9 ) y10 = ( 5 − 2 x10 + 3z9 ) z10 = (12 − x10 + 2 y10 )
5 6 5
= ( 6 − 2 ( 2.000 ) + 3.000 )
1
= ( 5 − 2 (1.000 ) + 3 ( 3.000 ) ) = (12 − 1.000 + 2 ( 2.000 ) )
X 1 1
5
6 5
= 1.000
= 2.000 = 3.000
Hence x = 1, y = 2, z = 3
14. Solve by Gauss Seidal method, the following system: 20 x + y – 2 z = 17,
3 x + 20 y – z = – 18, 2 x – 3 y + 20z = 25.
Hence x = 1, y = –1, z = 1 .
Solve the system, starting with initial vector of 0,0,0 using Gauss – Seidal method,
T
15.
6 x1 − 2 x2 + x3 = 11, − 2 x1 + 7 x2 + 2 x3 = 5, x1 + 2x2 − 5x3 = −1 .
Solution : The given system of equation 6 x1 − 2 x2 + x3 = 11, − 2 x1 + 7 x2 + 2 x3 = 5,
x1 + 2 x2 − 5 x3 = −1 is diagonally dominant.
1
6 x1 − 2 x2 + x3 = 11 x1 = (11 + 2 x2 − x3 ) − − − −(1)
6
1
−2 x1 + 7 x2 + 2 x3 = 5 x2 = (5 + 2 x1 − 2 x3 ) − − − −(2)
7
1
x1 + 2 x2 − 5 x3 = −1 x3 = (1 + x1 + 2 x2 ) − − − −(3)
5
since the initial vector[0, 0, 0].
1 1
First iteration : x1(1) = [11 + 2(0) − 0] = 1.833 x2(1) = [5 + 2(1.833) − 2(0)] = 1.2380
6 7
1
x3(1) = [1 + 1.833 + 2(1.2380)] = 1.06190
5
Second iteration : x1(2) = 2.0690, x2(2) = 1.0020, x3(2) = 1.0146
Third iteration : x1(3) = 1.9982, x2(3) = 0.9953, x3(3) = 0.9977
Fourth iteration : x1(4) = 1.9988, x2(4) = 1.0002, x3(4) = 0.9998
Fifth iteration : x1(5) = 2.0001, x2(5) = 1.0000, x3(5) = 1.0000
sixth iteration : x1(6) = 2.0001, x2(6) = 1.0000, x3(6) = 1.0000
The required solution is x1 = 2.0001, x2 = 1, x3 = 1
Interpolation is the process of finding the values of f(x) for intermediate values of x in the given
interval. Extrapolation is the process of finding the values of f(x) for values of x lying outside the
given interval.
2. What is the use of Newton’s forward formula and Newton’s Backward formula?
Newton’s forward formula is used to interpolate value of y nearer to the beginning value of the
table. Newton’s Backward formula is used to interpolate value of y nearer to the end of set of
tabular values.
3. State any two properties of Divided difference.
(i) The divided differences are symmetrical in all their arguments. i.e. the value of any difference
is independent of the order of the arguments.
(ii) The divided differences of the sum or difference of two functions is equal to the sum or
difference of the corresponding separate divided differences.
4. What is the relationship between the Newton’s Divided Difference and Newton’s forward
Difference?
n f ( xo )
If the arguments are equally spaced, then n f ( xo ) =
n !hn
5. Construct a linear interpolation polynomial given the points ( xo , y o ) and ( x1 , y1 )
( x − xo )
y = f ( x) = yo + yo
h
6. State Lagrange’s Interpolation formula, given ( x0 , y 0 ) , ( x1 , y 1 ) , ( x 2 , y 2 ) .
( x − x1 )( x − x2 ) ( x − xo )( x − x2 ) ( x − x0 )( x − x1 )
f ( x) = yo + y1 + y2
( xo − x1 )( xo − x2 ) ( x1 − xo )( x1 − x2 ) ( x2 − xo )( x2 − x1 )
7. Using Lagrange’s interpolation formula find y value when x=1 from the following data
x: 0 –1 2 3
y: –8 3 1 12
( y − y1 )( y − y2 )....( y − yn ) ( y − y0 )( y − y2 )....( y − yn )
x= xo + x1 + ......
( y0 − y1 )( y0 − y2 )....( y0 − yn ) ( y1 − y0 )( y1 − y2 )....( y1 − yn )
( y − y0 )( y − y1 )....( y − yn −1 )
+ xn
( yn − y0 )( yn − y1 )....( yn − yn −1 )
1
9. Find the second order divided difference with arguments a, b, c if f(x) =
x
1 1
− f (c) − f (b) −1
f (b) − f (a ) b a −1
f ( a, b) = = = Similarly, f (b, c) = =
b−a b − a ab c −b bc
−1 −1
−
f (b, c) − f (a, b) bc ab 1
Now f (a, b, c) = = =
c−a c−a abc
10. State Newton’s forward formula
Newton’s forward formula is
u (u − 1) 2 u (u − 1)(u − 2) 3 u (u − 1)....(u − (n − 1)) n
y ( x) = yo + u yo + yo + yo + ... + yo + ...
2! 3! n!
x − x0
where u =
h
11. State Newton’s Backward formula
Newton’s Backward formula is
v(v + 1) 2 v(v + 1)(v + 2) 3 v(v + 1)....(v + (n − 1)) n
y ( x) = yn + vyn + yn + yn + ..... + yn + ...
2! 3! n!
x − xn
where v =
h
12. State the Error in Newton’s Backward formula
p( p + 1)( p + 2)......( p + n) n+1 n+1
Error = f ( x) − pn ( x) = h y (c)
(n + 1)!
13. Show that the second divided difference x0 , x1 , x2 is independent of the order of the
arguments.
f ( x0 ) f ( x1 ) f ( x2 )
f ( x0 , x1, x2 ) = + +
( x0 − x1 )( x0 − x2 ) ( x1 − x0 )( x1 − x2 ) ( x2 − x0 )( x2 − x1 )
f ( x0 , x1, x2 ) = f ( x1 , x2 , x0 ) = f ( x2 , x0 , x1 )
f ( x0 , x1 , x2 ) is independent of the order of the arguments.
x y Δ Δ2 Δ3 Δ4
0 3
9
1 12 60
69 –10
2 81 50 –259(4y0)
119 –269
3 200 –219
–100
4 100
x f(x) 2 3
1 4
16
3 32 0.67
69.33 1.2533
6 224 23.2
254.33
11 1344
Third degree polynomial employed to connect each pair of data points are called cubic spline. If
the second order derivative at its end points is equal to zero (i.e.,M0=0 &Mn=0), then the cubic
spline is called as natural cubic spline.
f ( x) = 2 x 2 − 3x + 4
When x = 3, f (3) =18 − 9 + 4 = 13
2. Using Lagrange’s interpolation formula, calculate the profit in the year 2000 from the
following table.
Year 1997 1999 2001 2002
Profit (in lakhs) 43 65 159 248
y = f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1 , x2 ) +
( x − x0 )( x − x1 )( x − x2 ) f ( x0 , x1 , x2 , x3 ) + ( x − x0 )( x − x1 )( x − x2 )( x − x3 ) f ( x0 , x1 , x2 , x3 , x4 )
Here x = 1, x = 2, x = 4 , x = 7 , x = 12 ,
f ( x0 ) = 22, f ( x0 , x1 ) = 8, f ( x0 , x1 , x2 ) = 6, f ( x0 , x1 , x2 , x3 ) = −1.6, f ( x0 , x1 , x2 , x3 , x4 ) = 0.194
Take x = 5,
y (5) = 22 + (5 − 1)(8) + (5 − 1)(5 − 2)(6) + (5 − 1)(5 − 2)(5 − 4)(−1.6) + (5 − 1)(5 − 2)(5 − 4)(5 − 7)(0.194)
= 102.144
6. Evaluate f ( 9 ) using Newton’s divided difference formula from the given data
x 5 7 11 13 17
y=f(x) 150 392 1452 2366 5202
Solution: Newton Divided difference formula is
y = f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1 , x2 ) +
( x − x0 )( x − x1 )( x − x2 ) f ( x0 , x1 , x2 , x3 ) + ( x − x0 )( x − x1 )( x − x2 )( x − x3 ) f ( x0 , x1, x2 , x3 , x4 )
x y Δ Δ2 Δ3 Δ4
5 150
121
7 392 24
265 1
11 1452 32 0
457 1
13 2366 42
709
17 5202
Here x1 = 5, x2 = 7, x3 = 11 , x4 = 13 , x5 = 17 , x = 9
f ( x0 ) = 121, f ( x0 , x1 ) = 24, f ( x0 , x1 , x2 ) = 1, f ( x0 , x1 , x2 , x3 ) = 0
y (9) = 150 + (9 − 5)(121) + (9 − 5)(9 − 7)(24) + (9 − 5)(9 − 7)(1) + (9 − 5)(9 − 7)(9 − 11)(9 − 13)(0)
y (9) = 150 + 484 + 192 -16 = 810
7. If f ( 1) = 1, f ( 2 ) = 5 , f ( 7 ) = 5 and f ( 8 ) = 4 , find a polynomial that satisfies this data using
Newton’s divided difference formula. Hence, find f(6).
Solution: The divided difference table is
x y Δ Δ2 Δ3
1 1
4
2 5 −4
6
0 1
14
7 5 −1
6
–1
8 4
f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1, x2 ) + ( x − x0 )( x − x1 )( x − x2 ) f ( x0 , x1, x2 , x3 ) + ....
−4 1
= 1 + ( x − 1)4 + ( x − 1)( x − 2) + ( x − 1)( x − 2)( x − 7)
6 14
2 1
= 1 + 4 x − 4 − ( x − 1)( x − 2) + ( x − 1)( x − 2)( x − 7)
3 14
1
= 168 x − 126 − 28 x 2 + 84 x − 56 + 3 x 3 − 3 x 2 + 2 x − 7 x 2 + 21x − 14
42
45 1.0000
0.03553
0.00131
46 1.03553 0.0009
0.03684 0.00003
0.00140 –0.00005
47 1.07237 0.00012
0.03824 -0.00002
0.00152
48 1.11061 0.00010
0.03976
0.00162
49 1.15037
0.04138
50 1.19175
u u(u − 1) 2 u(u − 1)(u − 2) 3 u(u − 1)(u − 2)(u − 3) 4
y ( x) = y0 + y0 + y0 + y0 + y0
1! 2! 3! 4!
u(u − 1)(u − 2)(u − 3)(u − 4) 5
+ y0
5!
1 3 1 3 7
− − −
1 4 4 4 4 4
= 1.0000 + (0.03553) + (0.00131) + (0.00009)
4 2 6
x − x0 21 − 20
Solution : Here u = = = 0.33333
h 3
x y Δ Δ2 Δ3
20 0.3420
0.0487
23 0.3907 –0.0010
0.0477 –0.0003
26 0.4384 –0.0013
0.0464
29 0.4848
(i) By Newton’s forward interpolation formula
u (u − 1) 2 u (u − 1)(u − 2) 3 u (u − 1)(u − 2)(u − 3) 4
y = y0 + uy0 + y0 + y0 + y0
2 6 12
0.3333(0.3333 − 1)
y = 0.3420 + (0.3333)(0.0487) + (−0.0010)
2
0.3333(0.3333 − 1)(0.3333 − 2)
+ (−0.0003)
6
y(21) = 0.3583
(ii) By Newton’s backward interpolation formula
v(v + 1) 2 v(v + 1)(v + 2) 3
y = yn + vyn + yn + yn + ...... …..
2 6
x − xn 28 − 29
Where v = = = − 0.33333
h 3
(−0.3333)(−0.3333 + 1)
y = 0.4848 + (−0.3333)(0.0464) + (−0.0013)
2
−0.3333(−0.3333 + 1)(−0.3333 + 2)
+ (−0.0003)
6
y(28) = 0.4695
12. From the given data, find θ at x = 43 and x = 84
X 40 50 60 70 80 90
θ 184 204 226 250 276 304
x − x0 45 − 40
Here u = = = 0.5
h 10
M1 + 4M 2 + M 3 = 6[ y1 − 2 y2 + y3 ]
This reduces to, (taking M 0 , M 3 = 0)
4 M1 + M 2 = 180 → (1)
M1 + 4M 2 = 1080 → (2)
dy d 2 y
State Newton’s formula to find the derivatives , using forward differences when
2. dx dx 2
x x0 .
When x x0
dy 1 (2u − 1) 2 (3u 2 − 6u + 2) 3 (4u 3 − 18u 2 + 22u − 6) 4
y ' = f '( x) = = yo + yo + yo + yo + ...
dx h 2! 3! 4!
d2y 1 2 6u 2 − 18u + 11 4 x − xo
y '' = f ''( x) = 2
= 2
yo + (u − 1) 3
yo + yo + ... where u =
dx h 12 h
dy d 2 y
State Newton’s formula to find the derivatives , using forward differences when
3. dx dx 2
x = x0 .
When x = x0 ,
dy 1 1 1 1
y ' = f '( x) = = yo − 2 yo + 3 yo − 4 yo + ...
dx h 2 3 4
d2y 1 2 11
y '' = f ''( x) = = 2 yo − 3 yo + 4 yo + ...
dx 2
h 12
dy d 2 y
State Newton’s formula to find the derivatives , using backward differences when
4. dx dx 2
x xn .
When x xn
dy 1 (2v + 1) 2 (3v 2 + 6v + 2) 3 (4v3 + 18v 2 + 22v + 6) 4
y ' = f '( x) = = yn + yn + yn + yn + ...
dx h 2! 3! 4!
d2y 1 2 6v 2 + 18v + 11 4 x − xn
y '' = f ''( x) = = y + (v + 1) 3
y + y + ... where v =
dx 2 h2
n n n
12 h
dy d 2 y
State Newton’s formula to find the derivatives , using backward differences when
5. dx dx 2
x = xn .
When x = xn ,
dy 1 1 1 1
y ' = f '( x) = = yn + 2 yn + 3 yn + 4 yn + ...
dx h 2 3 4
d2y 1 2 11
y '' = f ''( x) = = 2
yn + 3 yn + 4 yn + ...
dx 2
h 12
6. Define Numerical Integration
xn
The process of computing the value of a definite integral y dx from a set of values
x0
x 0 0.5 1
y 1 0.6666 0.5
1
h
ydx = ( y0 + y n ) + 2 ( y1 + y 2 + .... + y n −1 ) = (1 + 0.5 ) + 2 ( 0.6666 ) = 0.7083
2
0
12. What is the error in Trapezoidal rule and Simpson’s rules also write down its order.
Trapezoidal rule
( xn − x0 ) 2
Error : E h y ''( ), x0 xn ; Order of the error = h2
12
Simpson’s rule:
( xn − x0 ) 4 iv
Error : E h y ( ), x0 xn ; Order of the error = h4
180
4
13. Using Simpson’s rule find e x dx, given e0 = 1, e1 = 2.72, e2 = 7.39, e3 = 20.09 & e4 = 54.6
0
4
h
e dx = 3 ( y0 + y4 ) + 2y 2 + 4 ( y1 + y3 ) = (1 + 54.6 ) + 2 ( 7.39 ) + 4 ( 2.72 + 20.09 ) = 53.8733
x
0
14. Compare Trapezoidal rule and Simpson’s 1/3 rule for evaluating numerical
Integration.
5 3 3 8
1
Three point formula: f (x)dx = f − +f + f (0)
−1
9
5 5 9
1
1
16. Evaluate x + 3 dx by Gaussian two-point formula
−1
1 1
1
1 1 1
I= x + 3 dx = f −
−1
+f = +
3 3 3 − 1 3 + 1
= 0.6903
3 3
1
dt
17. Evaluate I = by using three point Gaussian quadrature formula.
0 1+ t
2
5 3 3 8
1
f (x)dx = 9 f − +f + f (0)
−1 5 5 9
1 1
1
dt dt 1 1
I= = = [1.5833] = 0.79165 1 + t 2 is an even function
01+ t
2 2 −1 1 + t 2
2
2
18. Change the limits of sin x dx in to (–1, 1).
0
b−a b+a
By Substituting x= z + , we get
2 2
b−a 1
b 1 2
a f (x) dx = 2 −1 g(z) dz sin x dx = sin ( z + 1) dz
0
4 −1
4
b d
19. State Trapezoidal rule for evaluating f ( x, y )dxdy.
a c
hk
I= [ (Sum of values of ‘f ’ at the four corners ) + 2(Sum of values of ‘f ’ at the
4
remaining nodes on the boundary) + 4(Sum of the values of ‘f ’ at the interior nodes)]
h2
1 3 1
3
f (1.5) = 3 3 y0 − 4 y0 ...... = 0.75 = 6
h 2 (0.5)
2. 1
Find the first two derivatives of ( x ) 3 at x=50 and x= 56, for the following table.
X 50 51 52 53 54 55 56
1
y = ( x) 3 3.6840 3.7084 3.7325 3.7563 3.7798 3.8030 3.8259
3. d2y
Given the following values of x and y, find dy and 2 at x = 1.05
dx dx
X 1 1.05 1.10 1.15 1.20 1.25 1.30
f(x) 1 1.025 1.049 1.072 1.095 1.118 1.140
0.023 0 0
1.2 1.095 0 –0.001
0.023 –0.001
1.25 1.118 –0.001
0.022
1.3 1.14
dy 1 1 1
= [y0 − 2 y0 + 3 y0 + .........]
dx x = x0 h 2 3
dy 1 1 1 1
= [0.024 − (−0.001) + (0.001) − (−0.001)] = 0.4717
dx x =1.05 0.05 2 3 4
d2 y 1 2 11 4
2 = 2 y0 − y0 + 12 y0 − ......
3
dx x = x0 h
d2 y 1 11
2 = 2 −0.001 − 0.001 + 12 (−0.001) = 0.0333
dx x =1.05 h
4. Find f ’(10) from the following data:
x 3 5 11 27 34
y=f(x) –13 23 899 17315 35606
Solution: Since table values of x are not equally spaced, we use Newton divided difference
table.
x y =f(x) ∆y ∆2y ∆3y ∆4y
3 –13
18
5 23 16
146 1
11 899 40 0
1026 1
27 17315 69
2613
34 35606
Find the value of x for which y=f(x) is minimum and find the minimum value from the table
6. x 0.6 0.65 0.7 0.75
y= f(x) 0.6221 0.6155 0.6138 0.617
Solution : Newton’s Difference table is
X Y ∆y ∆2y ∆3 y
0.60 0.6221
-0.0066
0.65 0.6155 0.0049
-0.0017 0
0.7 0.6138 0.0049
0.0032
0.75 0.617
Newton’s formula for derivative is
dy 1 (2u − 1) 2 (3u 2 − 6u + 2) 3 (4u 3 − 18u 2 + 22u − 6) 4
= y '( x) = yo + yo + yo + yo + ...
dx h 2! 3! 4!
x − x0
Where u =
h
x − 0.60
Here x0 = 0.60 , so u =
0.05
dy 1 2u − 1
= −0.0066 + (0.0049)
dx 0.05 2
1 2u − 1 dy
0= −0.0066 + (0.0049) for max or min dx = 0
0.05 2
(2u − 1)(0.0049) = 0.0132
u = 1.8469
We have
x − 0.60
u=
0.05
1.8469(0.05) = x − 0.60
x = 0.6923
To find the value of y at x=0.6923
u (u − 1) 2 u (u − 1)(u − 2) 3
y ( x) = y0 + u y0 + y0 + y + ...
2 3
(1.8469)(1.8469 − 1)
y (0.6923) = 0.6221 + (1.8469)(−0.0066) + (0.0049)
2
= 0.6137 − 0.0066(1.8469) + 0.00245(1.8469)(0.8469)
= 0.6137426
7. 6
1 1 rd 3 th
Evaluate 1 + x2 dx by i) Trapezoidal rule (ii) Simpson’s
3
rule (iii) Simpson’s
8
rule
0
and also by actual integration.
1 6−0
Solution : Let y = . Divide the intervals into 6 equal parts i.e. h = =1
1+ x 2
6
x 0 1 2 3 4 5 6
y 1.000 0.5000 0.20000 0.10000 0.058824 0.038462 0.27027
6
1 1
I = dx = [(1 + 0.027027) + 2(0.5 + 0.2 + 0.1 + 0.058824 + 0.038462)] = 1.4107
0
1+ x 2
2
(ii) By Simpson’s 1/3rd rule
h
ydx = 3 [( y 0 + y6 ) +4( y1 + y3 + y5 ) + 2( y2 + y4 )]
6
1 1
I = dx = [(1 + 0.027027) + 2(0.5 + 0.058824) + 4(0.2 + 0.1 + 0.038462)] = 1.36617
0
1+ x 2
3
(iii) By Simpson’s 3/8th rule
3h
ydx = 8 [( y 0 + y6 ) +3( y1 + y2 + y4 + y5 ) + 2( y3 )]
6
1 3
I = dx = [(1 + 0.027027) + 3(0.5 + 0.2 + 0.058824 + 0.038462) + 2(0.1)] = 1.35708
0
1+ x 2
8
(iv) By actual integration
6
1
I = dx = tan −1 x = tan −1 ( 6 ) = 1.4056
6
0
1+ x 2 0
8. The velocity v of a particle at a distance S from a point on its path is given by the table :
S (ft.) 0 10 20 30 40 50 60
V (ft. / sec) 47 58 64 65 61 52 38
1
Estimate the time taken to travel 60 feet by using Simpson’s rule. Compare the result
3
with Simpson’s three-eighth rule.
ds 1
Solution: We know that = v dt = ds
dt v
60
1
t = v ds
0
x 0 10 20 30 40 50 60
y=1/v 0.02127 0.01724 0.01563 0.01538 0.01640 0.01923 0.0263
( y0 ) ( y1 ) ( y2 ) ( y3 ) ( y4 ) ( y5 ) ( y6 )
Here h =10
(i) Simpson’s 1/3rd rule
h
yds = 3 [( y0 + y6 ) +4( y1 + y3 + y5 ) + 2( y2 + y4 )]
10
= [(0.02127 + 0.0263) + 4(0.01724 + 0.01538 + 0.01923) + 2(0.01563 + 0.01640)]
3
= 3.75[0.04757+0.2054+0.03076] = 1.064
ii) Simpson’ 3/8th rule
3h
yds = 8 [( y 0 + y6 ) +3( y1 + y2 + y4 + y5 ) + 2( y3 )]
30
= [(0.02127 + 0.0263) + 3(0.01724 + 0.01563 + 0.01923 + 0.01640) + 2(0.01538)]
8
= 3.75[0.0475+0.2055+0.03076] = 1.0641
1
x2 1
0 1 + x 3 dx using Simpson’s 3 rule with h = 0.25
1/3
9. Find the value of log 2 from
x2
Solution: Here y = , h = 0.25
1 + x3
x 0 0.25 0.5 0.75 1
h
By Simpson’s rule, I = ( y0 + y4 ) + 2( y2 ) + 4( y1 + y3 )
3
0.25
= (0 + 0.5) + 2(0.2222) + 4(0.0615 + 0.3956) = 0.2311
3
Actual Integration:
1
1 3 1 1
1
x2
0 1 + x3 = 3 log(1 + x )0 = 3 log(1 + (1) ) − log(1 + (0) ) = 3 log 2 = 0.2311
3 3
By dividing the range into 10 equal parts, evaluate sin x dx by using Trapezoidal rule
10. 0
1
Solution: h = 0.5 y = ,
1+ x2
x 0 0.5 1
y 1 0.80 0.50
using Trapezoidal rule,
0.5
I= 1.5 + 2(0.8) = 0.775
2
Evaluation:
1
dx
1+ x
1
2
= 0.7854 tan −1 x = 0.7854
0
0
e − x dx
2
12. Evaluate using three point Gaussian Quadrature formula
0.2
b−a b+a
Solution : Transform the variable from x to z by the transformation x = z +
2 2
1.5 − 0.2 1.5 + 0.2
Here a=0.2 , b=1.5, x = z + = 0.65 z + 0.85, dx = 0.65 dz
2 2
Limit :
x 0.2 1.5
z -1 1
e dx = e
− x2 − (0.65 z + 0.85) 2
(0.65)dt
0.2 −1
3
1
f − = 0.8869;
= (0.65) e − (0.65 t + 0.85) 2
dt 5
−1
3
5 3 3 8 f = 0.1601;
= (0.65) f − + f + f (0) 5
9 5 5 9
f (0) = 0.4855
= (0.65)(1.0133) = 0.65865
1.5
e − x dx = (0.65)(1.0133) = 0.65865
2
0.2
2
x2 + 2 x + 1
13. Using Gaussian three point quadrature formula, evaluate 1 + ( x + 1) 2
dx
0
b−a b+a
Solution : Transform the variable from x to z by the transformation x = z +
2 2
b−a b+a 2−0 2+0
Let x = z + = z + = z + 1; dx = dz
2 2 2 2
Limits x 0 2
z -1 1
2
x2 + 2 x + 1 ( z + 1)2 + 2( z + 1) + 1
1
( z + 2)2
0 1 + ( x + 1)2 dx = −1 1 + [( z + 1) + 1]2 dz Here f ( z ) =
( z + 2)4 + 1
z2 + 4z + 4
1
= dz f (0) =
4
−1
( z + 2) 4 + 1 17
2
z2 + 4z + 4 ( z + 2)2 3
f ( z) = = − + 2
( z + 2)4 + 1 ( z + 2)4 + 1
(
f − 3 =
5
5
3
4) = 0.4614
5 3 8
3 − + 2 + 1
1
f ( z )dz = 9 f − f
5
+
+ f (0)
9
5
5
−1
2
5 8 4 3
= 0.4614 + 0.12774 + + 2
9
= 0.5365
9 17
f ( ) 3 =
5 3
5
4
= 0.12774
+ 2 + 1
5
Simpson’s Rule
hk
I= [( Sum of the values of ‘f ’ at the four corners) + 2 (Sum of the values of ‘f ’ at the odd
9
positions on the boundary except the corners) + 4 (Sum of the values of ‘f ’ at the even positions
on the boundary) + { 4 (Sum of the values of ‘f ’ at odd positions) + 8 (Sum of the values of ‘f ’
at even positions) on the odd row of the matrix except boundary rows} + { 8 (Sum of the values
of ‘f ’ at the odd positions) + 16 (Sum of the values of ‘f ’ at the even positions) on the even
rows of the matrix} ]
I = [(0.7071 + 0.7071 + 1) + 4(0.3827 + 0.3827 + 0.9239 + 0.9239) + 16(0.7071)]
8 8
9
= 0.4143
1.4 2.4
dx dy
16. Evaluate
1 2
xy
by using Trapezoidal rule, verify your results by actual integration.
1
Solution: Let f ( x, y ) = ; Limits : x = 2 to 2.4; y = 1 to 1.4; h = 0.1, k = 0.1
xy
By Trapezoidal rule
hk
I= [ (Sum of values of f at the four corners ) + 2(Sum of values of f at the remaining nodes
4
on the boundary) + 4(Sum of the values of f at the interior nodes)]
0.4762 + 0.4545 + 0.4348
( 0.5 + 0.4167 + 0.2976 + 0.3571) + 2 +0.3788 + 0.3472 + 0.3205
dx dy 0.1 0.1 +0.3106 + 0.3247 + 0.3401
1.4 2.4
1 2 xy = 4
+0.3846 + 0.4167 + 0.4545
0.4329 + 0.4132 + 0.3953 + 0.3968 +
+4
0.3788 + 0.3623 + 0.3663 + 0.3497 + 0.3344
1.4 2.4
dx dy
1 2
xy
= 0.0614
1.4 2.4 1.4 2.4
dx dy dy dx
Actual Integration
1 2
xy
=
1
y
2
x
= log y 1 log x 2 = (log1.4 − log1)(log 2.4 − log 2)
1.4 2.4
= (log1.4)(log1.2)
1.4 2.4
dx dy
1 2
xy
= 0.0613
1
Solution: Let f ( x, y ) = ; Limits : x = 3 to 4; y = 1 to 2; h = 0.5, k = 0.5
( x + y) 2
y\x 3 3.5 4
1 0.0625 0.0494 0.04
1.5 0.0494 0.04 0.0331
2 0.04 0.0331 0.0278
Trapezoidal rule:
hk
I= [ (Sum of values of f at the four corners ) + 2(Sum of values of f at the remaining nodes
4
on the boundary) + 4(Sum of the values of f at the interior nodes)]
0.5 0.5
= [(0.0625 + 0.04 + 0.04 + 0.0278) + 2(0.0494 + 0.0331 + 0.0331 + 0.0494) + 4(0.04)]
4
= 0.0413
Simpson’s rule:
hk
I= {sum of values of f at the four corners+2(sum of the values of f at odd position on the
9
boundary except corners) + 4(sum of the values of f at even position on the boundary except
corners) + 4(sum of the values of f at odd position on odd row) + 8(sum of the values of f at even
position on odd row) + 8(sum of the values of f at odd position on even row) + 16(sum of the
values of f at even position on even row)}
0.5 0.5
= [(0.0625 + 0.04 + 0.04 + 0.0278) + 4(0.0494 + 0.0331 + 0.0331 + 0.0494) + 16(0.04)]
9
I = 0.0408
UNIT IV INITIAL VALUE PROBLEMS FOR ORDINARY DIFFERENTIAL EQUATIONS
PART - A
1. Compare Single-step method and Multi-step method.
2. Write down the Taylor series formula for solving first order ODE.
h h2 h3
yn+1 = yn + yn + yn + yn + .......
1! 2! 3!
h h2 h3
When n = 0, y1 = y0 + y0 + y0 + y0+ .......
1! 2! 3!
dy
3. Find by Taylor series method, the value of y at x = 0.1 from = y 2 + x and y(0) = 1 correct
dx
to 4 decimal places
Let h = 0.1
x0 = 0, y0 =1, y = y 2 + x , y0 =1
y = 2 yy + 1 , y0'' = 3
y = 2 yy + 2( y) 2 , y0''' = 8
y iv = 2 yy + 6 yy , y0iv = 34
(0.1)2 (0.1)3 (0.1)4
y ( 0.1) = 1 + (0.1)(1) + (3) + (8) + (34) = 1.1165
2! 3! 4!
4. Write the merits and demerits of the Taylor’s series method of solution.
Merits:
(i) Taylor formula is easily derived for any order according to our interest
(ii) The values of y(x) for any x (x need not be at grid points) are easily obtained.
Demerits: This method suffers from the time consumed in calculating the higher derivatives
5. What is the truncation error in Taylor’s series method?
( x − xo )n n
Error = y ( )
n!
6. Write down the Euler’s formula.
y n+1 = y n + h f ( x n , y n ) , n = 0,1, 2,... where h = x − x0
dy
7. Using Euler’s method find y (0.1) given that = x + y , y (0) = 1.
dx
y n +1 = yn + h f(x n ,yn ) y1 = y 0 + h f ( x 0 , y 0 ) , let h = 0.1
y1 = 1 + (0.1)(0 + 1) = 1.1
8. What is the error of Euler’s method?
h2 ''
Error at ( x = x1) = y ( x1, y1)
2!
9. What are the limitations of Euler’s method?
1 1
yn +1 = yn + h f xn + h, yn + h f ( xn , yn ) , n = 0,1, 2,...
2 2
dy 2 2
11. Use Modified Euler’s method to y(0.1) given = x + y , y(0) = 1
dx
= x 2 + y 2 (i.e) f ( x, y) = x 2 + y 2 and y (0) = 1 (i.e) x0 = 0, y0 = 1
dy
Solution: Given
dx
Tofind y (0.1) (i.e) y1 at x1 = 0.1for h = 0.1
h h
Modified Euler’s formula: y( xn+1 ) = yn+1 = yn + h f xn + , yn + f ( xn , yn )
2 2
h h
Put n = 0 y(0.1) = y1 = y0 + h f x0 + , y0 + f ( x0 , y0 )
2 2
0.1
f (0,1) = 1 + 0.1 f ( 0.05,1 + 0.05(02 + 12 ) )
0.1
y(0.1) = 1 + 0.1 f 0 + ,1 +
2 2
= 1 + 0.1 f ( 0.05,1.05) ) = 1 + 0.1(0.052 + 1.052 ) = 1.1105
12. Write down 4th order Runge-Kutta formula to solve first order differential equation.
We have y ' = f ( x, y ) , y(x 0 ) = y0
k1 = h f ( x0, y0 )
h k
k2 = h f x0 + , y0 + 1
2 2
h k
k3 = h f x0 + , y0 + 2
2 2
k4 = h f ( x0, + h, y0 + k3 )
1
y = (k1 + 2(k2 + k3 ) + k4 ), y1 = y0 + y
6
13. What is the truncation error in Fourth order Runge-kutta method?
y (5) ( ) h5
Truncation Error value = , x x + h and the order of error is O (h5).
5!
14. What are the advantages of R-K method over Taylor series method?
The Runge Kutta methods are designed to give greater accuracy and they possess the advantage of
requiring only the function values at some selected points on the sub interval..
h h2 h3 hiv
For n = 1, y2 = y1 + y1 + y1 + y1+ y1iv + ... → (2)
1! 2! 3! 4!
To Find y(1.1):
x0 = 1, y0 = 2, h = 0.1 and y = x 2 + y 2
( ( ))
( )
2
y = 2+2 y y +y y y 0 = 2+2 y 0 y 0 + y 0
= 2+2 y y + ( y )
= 2+2 ( ( 2 )( 22 ) +52 ) = 140
2
(
yiv = 2 yy + y y + 2 y y ) (
y0iv = 2 y0 y0 + 3 y0 y0 )
(
= 2 yy + 3 y y ) = 2 ( ( 2 )(140 ) + 3 ( 5 )( 22 ) ) = 1220
y (x) = 2x + 2 yy y1 = 2x1 + 2 y1 y1 = 2 (1.1) + 2 ( 7.6616 )(59.9101) = 920.2144
( ( ))
( )
2
y (x) = 2+2 y y +y y y1 = 2+2 y1 y1 + y1
= 2+2 y y + ( y ) ( )
2
= 2+2 ( 7.6616 )( 920.2144 ) + ( 59.9101)
2
= 21281.0694
(
yiv (x) = 2 yy + y y + 2 y y ) (
y1iv = 2 y1 y1 + 3 y1 y1 )
= 2 ( yy + 3 y y ) = 2 ( ( 7.6616 )( 21281.0694 ) + 3 ( 59.9101)( 920.2144 ) )
= 656874.903
Substituting the values in (2),
h h 2 h3 h 4 iv
y2 = y1 + y1 + y1 + y1 + y1 + ...
1! 2! 3! 4!
y (1.2) = 24.5373
2. Obtain the approximate value of y at x = 0.1 & 0.2 for the differential equation
dy
= 2 y + 3e x , y(0) = 0. by Taylor’s Series method. Compare the numerical solution
dx
obtained with the exact solution.
Given x0 = 0, y0 = 0, h = 0.1 and y = 2 y + 3ex
h h2 h3
Taylor’s series expansion is y n +1 = y n + yn + yn + yn + ...... .
1! 2! 3!
h h2 h3
For n = 0 , y1 = y 0 + y0 + y0 + y0 + .......
1! 2! 3!
dy
= y' (x) = 2y + 3e x , y0 ' = 3
dx
Differentiating y / ( x) = 2 y + 3e x successively three times and putting x = y = 0, we get
y '' ( x) = 2 y '+ 3e x y0 ' ' = 9
y '''( x) = 2 y ''+ 3e x y 0 ' ' ' = 21
yiv ( x) = 2 y ''' + 3e x y 0 = 45
iv
h h2 h3
For n = 0 , y1 = y0 +
y0 +
y0 + y0 + ....... → (1)
1 ! 2 ! 3 !
At (x 0 , y0 ) = (0,0)
y = 1 − 2xy y'0 = 1
y'' = −2(xy '+ y) y''0 = 0
y''' = −2(xy ''+ y '+ y ') y'''0 = −4
Putting the values in (1)
0.1 (0.1)2 (0.1)3
y1 = (0) + (1) + (0) + (−4) + .......= 0.0993
1! 2 ! 3!
y1 = y(0.1)=0.0993
h h2 h3
For n = 1 , y2 = y1 + y1 + y1 + y1+ ....... → (1)
1! 2 ! 3!
At (x 0 , y0 ) = (0.1,0.0993)
y = 1 − 2xy y1' = 0.9801
y'' = −2(xy '+ y) y1'' = −0.3947
y''' = −2(xy ''+ y '+ y ') y1''' = −3.8416
Putting the values in (1)
0.1 (0.1)2 (0.1)3
y1 = (0.0993) + (0.9801) + (−0.3946) + (−3.8412) + .......=0.1954
1! 2 ! 3!
y2 = y(0.2)=0.1954
4. Using Taylor’s series method up to fourth order find 𝒚 at 𝒙 = 𝟎. 𝟏 by solving the equation
dy
= x 2 − y, y (0) = 1 with 𝒉 = 𝟎. 𝟏 up to four decimals.
dx
Given, y ' = x 2 − y, y ( 0 ) = 1( i.e ) x0 = 0, y0 = 1
WKT , xn = xn−1 + h h = xn − xn−1
for n = 1, h = x1 − x0 = 0.1 − 0 = 0.1
x0 = 0 ; y0 = 1; x1 = 0.1; y1 = ?
h h2 h3 h iv iv
Taylor’s series expansion is yn +1 = yn + yn + yn + yn + yn + ...
1! 2! 3! 4!
h h2 h3 h iv
For n = 0 , y1 = y0 + y0 + y0 + y0 + y0iv + ... → (1)
1! 2! 3! 4!
We have y ' = x2 − y, x0 = 0, y0 = 1, h = 0.1
y ' = x2 − y y0 ' = x0 2 − y0 = ( 0 ) − 1 = −1
y '' = 2 x − y ' y0 '' = 2 x0 − y0' = 2 ( 0 ) − ( −1) = 1
y ''' = 2 − y '' y0''' = 2 − y0'' = 2 − (1) = 1
y iv = − y ''' y0iv = − y0''' = −1
2 − 1.010025
= 1.005 + (0.1)
20.5
= 1.005 + 0.004829
y2 = y (4.2) = 1.0098
dy
8. Solve = sin x + cos y, y(2.5) = 0 by Modified Euler’s method with h = 0.5, find y(3.5)
dx
Given Data is : x 0 = 2.5, y 0 = 0, h = 0.5 and f(x, y) = sin x + cos y
h h
y n +1 = y n + h f x n + , y n + f ( x n , y n )
2 2
0.5 0.5
Put n = 0, we get y1 = y 0 + 0.5 f ( x 0 + , y0 + [f ( x 0 , y 0 )]
2 2
y = 0 + 0.5 f (2.5 + 0.25,0 + 0.25[ f (2.5,0)] = 0.6354
1
0.5 0.5
Put n = 1 , we get y2 = y1 + h f ( x1 +, y1 + [ f ( x1, y1)]
2 2
y2 = 0.6354 + 0.5 f (3 + 0.25,0.6354 + 0.25 [ f (3,0.6354)] = 0.93155
h h
Put 𝑛 = 1 in (1), y2 = y1 + h f x1 + , y1 + f ( x1 , y1 )
2 2
0.1 0.1
y2 = 1.0955 + 0.1 f 0.1 + , 1.0955 + f ( 0.1,1.0955)
2 2
2 ( 0.1)
y 2 = 1.0955 + 0.1 f 0.15, 1.1455 1.0955 −
1.0955
y2 = 1.0955 + 0.1 f ( 0.15, 1.1455 ( 0.9129 ) ) = 1.0955 + 0.1 f ( 0.15, 1.0458)
2 ( 0.05 )
y 2 =1.0955 + 0.11.0458 − = 1.0955 + 0.1( 9502 ) = 1.1905
1.0458
y ( 0.2 ) = 1.1905 ( i.e ) y 2 = 1.1905 when x1 = 0.2
10. Apply Runge – Kutta method, to find an approximate value of y when x = 0.2 given that
dy
= x + y, y(0) = 1
dx
Given: x0 = 0, y 0 = 1, h = 0.2 and f ( x, y ) = x + y
Finding y1 = y (0.2) :
1
R – K method (for n = 0) is: y1 = y(0.2) = y0 + ( k1 + 2k2 + 2k3 + k4 ) -------- (1)
6
k1 = h f ( x 0 , y 0 ) = 0.2 [0 + 1] = 0.2 ;
h k 0.2 0.2
k 2 = h f x 0 + , y 0 + 1 = 0.2 0 + + 1 + = 0.2400
2 2 2 2
h k 0.2 0.24
k 3 = h f x 0 + , y 0 + 2 = 0.2 0 + + 1 + = 0.2440
2 2 2 2
k 4 = h f (x 0 + h, y 0 + k 3 ) = 0.2 (0 + 0.2) + (1 + 0.2440) = 0.2888
Using the values of k1 , k 2 , k 3 and k 4 in (1), we get
1
y1 = y (0.2) = 1 + ( 0.2 + 2(0.24 + 0.244) + 0.2888 ) = 1.2468
6
Hence the required approximate value of y is 1.2468.
11. Compute y(0.2) given y ' + y + xy 2 = 0, y(0) = 1 by taking h = 0.1 using Runge Kutta
method.
(
Given: x0 = 0, y0 = 1, h = 0.1and f ( x, y) = − xy 2 + y )
Finding y1 = y (0.1) :
1
R – K method (for n = 0) is: y1 = y(0.1) = y0 + ( k1 + 2k2 + 2k3 + k4 ) -------- (1)
6
k1 = h f ( x0 , y0 ) = 0.1 [−1] = −0.1
k
k2 = h f x0 + , y0 + 1 = 0.1 − ( 0.05 0.952 + 0.95) = −0.0995
h
2 2
k
h
(
k3 = h f x0 + , y0 + 2 = 0.1 − 0.05 0.950252 + 0.95025 = −0.0995
2 2
)
k4 = h f ( x0 + h, y0 + k3 ) = 0.1 − ( 0.1 0.90052 + 0.9005) = −0.0982
Using the values of k1 , k 2 , k 3 and k 4 in (1), we get
y1 = y (0.1) = 0.9006
(
x1 = 0.1, y1 = 0.9006, h = 0.1and f ( x, y) = − xy 2 + y )
Finding y2 = y (0.2) :
1
R – K method (for n = 0) is: y2 = y(0.2) = y1 + ( k1 + 2k2 + 2k3 + k4 ) -------- (2)
6
( )
k1 = h f ( x1 , y1 ) = 0.1 − 0.1 0.90062 + 0.9006 = −0.0982
k
h
( )
k2 = h f x1 + , y1 + 1 = 0.1 − 0.15 0.85152 + 0.8515 = −0.0960
2 2
k
h
( )
k3 = h f x1 + , y1 + 2 = 0.1 − 0.15 0.85262 + 0.8526 = −0.0962
2 2
( )
k4 = h f ( x1 + h, y1 + k3 ) = 0.1 − 0.2 0.80442 + 0.8044 = −0.0934
Using the values of k1 , k 2 , k 3 and k 4 in (2), we get
y2 = y (0.2) = 0.8046
y −x
2 2
dy
12. Using Runge – Kutta method of 4th order, solve = , y (0) = 1 at x = 0.2 & 0.4
y +x
2 2
dx
dx y 2 + x 2 y 2 + x2
WKT , xn = xn−1 + h
h = xn − xn−1 for n = 1, h = x1 − x0 h = 0.2 − 0 = 0.2
To Find y(0.2) by R.K Method:
1
R – K method (for n = 0) is : y1 = y0 + y where y = (k1 + 2(k2 + k3 ) + k4 )
6
h k 0.2 0.1891
k2 = h f x1 + , y1 + 1 = 0.2 f 0.2 + ,1.19599 +
2 2 2 2
1.29062 − 0.32 1.5756
= 0.2 f ( 0.3,1.2906 ) = 0.2 2
= 0.2 = 0.1795
1.2906 + 0.3 1.7556
2
h k 0.2 0.1795
k3 = h f x1 + , y1 + 2 = 0.2 f 0.2 + ,1.19599 +
2 2 2 2
1.285742 − 0.32 1.5631
= 0.2 f ( 0.3,1.28574 ) = 0.2 2
= 0.2 = 0.1793
1.28574 + 0.3 1.7431
2
h k 0.1 0.1155
k3 = h f x0 + , y0 + 2 = (0.1) f 0 + , 1+
2 2 2 2
= (0.1) f 0.05, 1.05775 = (0.1)[(0.05) (1.05775) + (1.05775) 2 ]
= (0.1) 0.0528875 + 1.118835
= (0.1) (1.1717225) = 0.11717
k4 = h f x0 + h, y0 + k3 = (0.1) f 0 + 0.1, 1 + 0.11717
= (0.1) f 0.1, 1.11717 = (0.1)[(0.1) (1.11717) + (1.11717)2 ]
= (0.1) 0.111717 + 1.24807 = 0.13598
Substituting the values of k1 , k 2 , k 3 and k 4 in (1), we get
1
y (0.1) = 1 + 0.1 + 2(0.1155) + 2(0.11717) + (0.13598)
6
1
y (0.1) = 1 + 0.70132 = 1 + 0.11689 = 1.11689
6
To find y2 = y(0.2) by 4thRunge-kutta method:
1
R – K method (for n = 1) is: y2 = y1 + y where y = (k1 + 2(k2 + k3 ) + k4 )
6
1
y1 = y (0.2) = 1.11689 + ( k1 + 2k2 + 2k3 + k4 ) …………………..(2)
6
We have f ( x, y) = xy + y 2 , x1 = 0.1, y1 = 1.11689 and h = 0.1
Given:
x0 = 0, y0 = 0 and f 0 = f ( x0 , y0 ) = 0 ;
x1 = 0.2, y1 = 0.02 and f1 = f ( x1, y1 ) = 0.1996
x2 = 0.4, y2 = 0.0795 and f 2 = f ( x2 , y2 ) = 0.3937
y4
(P)
= y(0.8) = y 0 +
4h
2f1 − f 2 + 2f 3 = 0 + 4(0.2) (2 0.1996) − 0.39372 + 2 0.56895 =
3 3
0.30491
Now we compute f 4 = f (0.8,0.30491) = 0.7070
Corrector Method
y (4C) = y(0.8) = y 2 +
h
f 2 + 4f 3 + f 4 = 0.0795 + 0.2 0.3937 + 4 0.56895 + 0.7070 = 0.3046
3 3
dy
Given 5 x + y 2 − 2 = 0 , y(4) = 1, y(4.1) = 1.0049, y(4.2) = 1.0097, y(4.3) = 1.0143. Compute
15. dx
y(4.4) by Milne’s Predictor-Corrector Method.
dy 2 − y2
Solution: Given = y = , y(4) = 1, y(4.1) = 1.0049, y(4.2) = 1.0097, y(4.3) = 1.0143
dx 5x
dy
16. Given = x 2 (1 + y ) , y(1) = 1, y(1.1) = 1.233, y(1.2) = 1.548, y(1.3) = 1.979 . Evaluate
dx
y(1.4) by Adam’s – Bashforth method.
dy
Solution: Given = y = x 2 (1 + y ) , y (1) = 1, y (1.1) = 1.233, y (1.2) = 1.548, y (1.3) = 1.979
dx
x0 = 1 x1 = 1.1 x2 = 1.2 x3 = 1.3 x4 = 1.4
(i.e) Where, ℎ = 0.1
y0 = 1 y1 = 1.233 y2 = 1.548 y3 = 1.979 ?
we have y = x 2 (1 + y )
y0' = x02 (1 + y0 ) = 12 (1 + 1) = 2
y1' = x12 (1 + y1 ) = 1.12 (1 + 1.233) = 2.70193
y2' = x22 (1 + y2 ) = 1.22 (1 + 1.548) = 3.66912
y3' = x32 (1 + y3 ) = 1.32 (1 + 1.979 ) = 5.03451
Adam’s – Bashforth Predictor Method:
h
y4, P = y (1.4) = y3 + 55 y3 − 59 y2 + 37 y1 − 9 y0
24
(0.1)
y4, P = 1.979 + (55 5.03451) − (59 3.66912) + (37 2.70193) − (9 2) = 2.57277
24
Now we compute y4' = x4 2 (1 + y4 ) = 1.42 (1 + 2.57277 ) = 7.0027
Adam’s – Bashforth Corrector Method:
h
y4,C = y (1.4) = y3 + 9 y4 + 19 y3 − 5 y2 + y1
24
0.1
= 1.979 + (9 7.0027) + (19 5.03451) − (5 3.66912) + 2.70193 = 2.57498
24
y4 = 2.57498
Determine the value of y(0.4) by Milne’s method given that y ' = xy + y 2 , y(0)=1. Use Taylor
17.
series method to get the values of y(0.1), y(0.2) and y(0.3)
h h2 h3
For n = 0 , y1 = y 0 + y0 + y0 + y0 + .......(1)
1! 2! 3!
dy
= y'(x) = xy + y 2 , y0' = 1
dx
Differentiating y / ( x) = xy + y 2 successively three times and putting x = 0, y = 1, we get
y'' (x) = xy' + y+2yy' y 0 '' = 3
Find y (0.1), y (0.2), y (0.3) from y ' = x 2 − y ; y (0) = 1 using Taylor’s series method
18.
and hence obtain y (0.4) using Adams-Bashforth method.
Solution:
Given, y ' = x 2 − y, y ( 0 ) = 1( i.e ) x0 = 0, y0 = 1
WKT , xn = xn−1 + h h = xn − xn−1
for n = 1, h = x1 − x0 = 0.1 − 0 = 0.1
x0 = 0 x1 = 0.1 x2 = 0.2 x3 = 0.3
y0 = 1 y1 = ? y2 = ? y3 = ?
h h2 h3 h iv iv
Taylor’s series expansion is yn +1 = yn + yn + yn + yn + yn + ...
1! 2! 3! 4!
h h2 h3 h iv
For n = 0 , y1 = y0 + y0 + y0 + y0 + y0iv + ... → (1)
1! 2! 3! 4!
h h2 h3 h iv
For n = 1, y2 = y1 + y1 + y1 + y1+ y1iv + ... → (2)
1! 2! 3! 4!
h h2 h3 h iv iv
For n = 2, y3 = y2 +
y2 +
y2 +
y2 + y2 + ... → (3)
1! 2! 3! 4!
We have y ' = x2 − y, x0 = 0, y0 = 1, h = 0.1
y ' = x 2 − y y0 ' = x0 2 − y0 = ( 0 ) − 1 = −1
y '' = 2 x − y ' y0 '' = 2 x0 − y0' = 2 ( 0 ) − ( −1) = 1
y ''' = 2 − y '' y0''' = 2 − y0'' = 2 − (1) = 1
y iv = − y ''' y0iv = − y0''' = −1
From (1),
( 0.1) 1 + ( 0.1) 1 + ( 0.1) −1 + ...
2 3 4
0.1
y1 = y ( 0.1) = 1 + ( −1) + () () ( )
1 2 3! 4!
= 1− 0.1+ 0.005 + 0.0001666 − 0.00000416
y (0.1) = 0.9052
Now, x1 = 0.1, y1 = 0.9052, h = 0.1
y ' = x 2 − y y1 ' = x12 − y1 = ( 0.1) − 0.9052 = −0.8952
2
From (2),
h h2 h3 h iv
y2 = y1 + y1 + y1 + y1+ y1iv + ...
1! 2! 3! 4!
( 0.1) 1.0952 + ( 0.1) 0.9048 + ( 0.1) −0.9048 + ...
2 3 4
0.1
y2 = y ( 0.2 ) = 0.9052 + ( −0.8952) + ( ) ( ) ( )
1 2 3! 4!
y2 = y ( 0.2 ) = 0.9052 − 0.08952 + 0.0055 + ... = 0.8213
Now, x2 = 0.2, y2 = 0.8213, h = 0.1
y ' = x 2 − y y2 ' = x2 2 − y2 = ( 0.2 ) − 0.8213 = −0.7813
2
h
Adam’s predictor formula is yn +1 , p = yn + 55 y 'n − 59 yn' −1 + 37 yn' − 2 − 9 yn' −3
24
h
Put n = 3 , y4 , p = y3 + 55 y 3' − 59 y2' + 37 y1' − 9 y0'
24
y0 ' = x0 2 − y0 = ( 0 ) − 1 = −1
h
y4 , p = y3 + 55 ( −0.6592 ) − 59 ( y − 0.7813) + 37 ( −0.8952 ) − 9 ( −1)
24
0.1
y4 , p = 0.7492 + (−36.256 + 46.0967 − 33.1224 + 9)
24
y4 , p = 0.6897
y4 ' = x4 2 − y4 = ( 0.4 ) − 0.6897 = −0.5297
2
h
Adam’s Corrector formula: yn +1 , c = yn + 9 y 'n +1 + 19 yn' − 5 yn' −1 + yn' − 2
24
h
Put n = 3 , y4 , c = y3 + 9 y 4' + 19 y3' − 5 y2' + y1'
24
0.1
= 0.7492 + 9 ( −0.5297 ) + 19 ( −0.6592 ) − 5 ( −0.7813) − 0.8952
24
0.1
= 0.7492 + ( −4.7672 ) − 12.5248 + 3.9065 − 0.8952
24
y4,c = 0.6897
19. dy
Consider the initial value problem = y − x 2 + 1, y(0) = 0.5
dx
dy
Solution: Given = y − x 2 + 1 x0 = 0, y0 = 0.5, h = 0.2, f ( x, y ) = y − x 2 + 1
dx
To find y(0.2) by modified Euler’s method:
1 1
y1 = y0 + hf x0 + h, y0 + h f ( x0 , y0 ) − − − −(1)
2 2
1
y1 = 0.5 + 0.2 f 0 + (0.2),0.5 +
2
0.2
2
y0 − x02 + 1
( f ( x, y) = y − x 2 + 1 )
= 0.5 + 0.2 f ( 0.1,0.65) = 0.5 + 0.2 0.65 − ( 0.1) + 1 = 0.5 + 0.2 0.65 − 0.01 + 1
2
= 0.5 + 0.328 = 0.828 y1 = y ( 0.2 ) = 0.828
To find y(0.4) by 4thorder Runge-kutta method:
dy
= y − x 2 + 1 = f ( x, y ) , x1 = 0.2, y1 = 0.828, h = 0.2
dx
k1 = hf ( x1 , y1 ) = ( 0.2 ) y1 − x 2 + 1 = ( 0.2 ) 0.828 − ( 0.2 ) + 1
2
= ( 0.2 ) 0.828 − 0.04 + 1 = 0.358
h k 0.2 0.358
k2 = hf x1 + , y1 + 1 = ( 0.2 ) f 0.2 + 2 ,0.828 + 2
2 2
= ( 0.2 ) f 0.3,1.007 = ( 0.2 ) 1.007 − 0.09 + 1 = 0.383
h k 0.2 0.383
k3 = hf x1 + , y1 + 1 = ( 0.2 ) f 0.2 + ,0.828 +
2 2 2 2
= ( 0.2 ) f 0.3,1.0195 = ( 0.2 ) 1.0195 − 0.09 + 1 = 0.386
k4 = hf ( x1 + h, y1 + k3 ) = ( 0.2 ) f 0.2 + 0.2,0.828 + 0.386
= ( 0.2 ) 1.214 − 0.16 + 1 = 0.4108 = 0.411
1 1
y = k1 + 2k2 + 2k3 + k4 = 0.358 + 2 ( 0.383) + 2 ( 0.386 ) + 0.411
6 6
1
= 0.358 + 0.766 + .772 + 0.411 = 0.385
6
y2 = y ( 0.4 ) = 0.828 + y = 0.828 + 0.385 = 1.213
To find y(0.6) by 4th order Runge-kutta method:
Now x2 = 0.4, y2 = 1.213, h = 0.2 y3 = ?
k1 = hf ( x2 , y2 ) = ( 0.2 ) f 0.4,1.213 = ( 0.2 ) 1.213 − 0.16 + 1
= ( 0.2 ) 1.213 − 0.16 + 1 = 0.411
h k 0.2 0.411
k2 = hf x2 + , y2 + 1 = ( 0.2 ) f 0.4 + ,1.213 +
2 2 2 2
= ( 0.2 ) f 0.5,14185 = ( 0.2 ) 1.4185 − 0.25 + 1 = 0.4337
h k 0.2 0.4337
k3 = hf x2 + , y2 + 2 = ( 0.2 ) f 0.4 + ,1.213 +
2 2 2 2
= ( 0.2 ) f 0.5,1.4298 = ( 0.2 ) 1.4298 − 0.25 + 1 = 0.436
k4 = hf ( x2 + h, y2 + k3 ) = ( 0.2 ) f 0.4 + 0.2,1.213 + 0.436
= ( 0.2 ) 1.649,1.649 = ( 0.2 ) 1.649 − 0.36 + 1 = 0.458
1 1
y = k1 + 2k2 + 2k3 + k4 = 0.411 + 2 ( 0.4337 ) + 2 ( 0.436 ) + 0.458
6 6
1
= 0.411 + .8674 + .872 + 0.458 = 0.4347
6
y3 = y ( 0.6 ) = y2 + y = 1.213 + 0.4347 = 1.6477
To find y(0.8) by Adam-Bash forth predictor corrector method:
x0 = 0 x1 = 0.2 x2 = 0.4 x3 = 0.6 x4 = 0.8
y0 = 0.5 y1 = 0.828 y2 = 1.213 y3 = 1.6477 y4 = ?
h
Adam’s predictor formula is yn +1 , p = yn + 55 y 'n − 59 yn' −1 + 37 yn' − 2 − 9 yn' −3
24
h
Put n = 3 , y4 , p = y3 + 55 y 3' − 59 y2' + 37 y1' − 9 y0'
24
y0' = y0 − x02 + 1 = 0.5 − 0 2 + 1 = 1.5
y1' = y1 − x12 + 1 = 0.828 − ( 0.2 ) + 1 = 0.828 − 0.04 + 1 = 1.828 − 0.04 = 1.788
2
0.2
y4 , p = 1.6477 + 55. ( 2.2877 ) − 59 ( 2.053 ) + 37 (1.788 ) − 9 (1.5 )
24
0.2
= 1.6477 + 125.8235 − 121.127 + 66.156 − 13.5
24
= 1.6477 + 0.4779375
= 2.1256
y4' = y4 − x42 + 1 = 2.1256 − ( 0.8) + 1 = 3.1256 − 0.64 = 2.4856
2
h
Adam’s Corrector formula yn +1 , c = yn + 9 y 'n +1 + 19 yn' − 5 yn' −1 + yn' − 2
24
h
Put n = 3 , y4 , c = y3 + 9 y 4' + 19 y3' − 5 y2' + y1'
24
0.2
= 1.6477 + 9 ( 2.4856 ) + 19 ( 2.2877 ) − 5 ( 2.053) + 1.788
24
0.2
= 1.6477 + 22.3704 + 43.4663 − 10.265 + 1.788
0.4
= 1.6477 + 0.477975 = 2.1256975
y4 , c = 2.1257
dy xy
Solution : given = = f ( x, y ) . To find y(0.4)
dx 2
x0 = 0, y0 = 1 and f 0 = f ( x0 , y0 ) = 0
x1 = 0.1, y1 = 1.01 and f1 = f ( x1, y1 ) = 0.0505
x2 = 0.2, y2 = 1.022 and f 2 = f ( x2 , y2 ) = 0.1022
x3 = 0.3, y3 = 1.023 and f3 = f ( x3 , y3 ) = 0.1534
To Find : y4 = y ( x4 ) = y (0.4)
(i) Milline’s Predictor and Corrector Method
4h
Milne’s predictor formula: y4, p = y0 + 2 y1 − y2 + 2 y3
3
4 (0.1)
= 1+ 2(0.0505) − (0.1022) + 2(0.1534) = 1.0408
3
1 1
y4 = [ x 4 . y4 ] = [( 0.4 ) . (1.0408 )] = 0.2082
2 2
h
Milne’s corrector formula: y4, c = y2 + y2 + 4 y3 + y4
3
0.1
= 1.022 + 0.1022 + 4(0.1534) + 0.2082 =1.0528
3
y (0.4) = 1.0528
(ii) Adams Bash forth Predictor Corrector Method
h
y4( P ) = y (0.4) = y3 + 55 f 3 − 59 f 2 + 37 f1 − 9 f 0
24
0.1
= 1.023 + 55(0.1534) − 59(0.1022) + 37(0.0505) − 9(0) = 1.0408
24
Now we compute f 4 = f (0.4,1.0408) = 0.2082
h
y4(C ) = y (0.4) = y2 + 9 f4 + 19 f3 − 5 f2 + f1
24
0.1
= 1.023 + 9(0.2082) + 19(0.1534) − 5(0.1022) + (0.0505) = 1.041
24
UNIT-V BOUNDARY VALUE PROBLEMS IN ORDINARY & PARTIAL DIFFERENTIAL
EQUATIONS
PART - A
1. Solve xy”+y=0, y(1) =1, y(2)=2 with h=0.5.
y + y − 2 yi
xi i −1 i2+1
h + yi = 0 4 xi ( yi −1 + yi +1 − 2 yi ) + yi = 0
When i = 1, y 1 = y (1.5) = 1.6364
2. Write the forward, central and backward finite difference formula for ux.
ui +1, j − ui , j ui +1, j − ui −1, j ui , j − ui −1, j
ux = , ux = , ux =
h 2h h
3. State the central difference approximations for yi' and yi'' .
y −y y − 2yi + yi −1
yi = i +1 i −1 and yi = i +1
2h h2
4. State the Forward difference approximations for yi' and yi'' .
yi +1 − yi y -2yi +1 + yi
yi = and yi = i + 2
h h2
5. State the Backward difference approximations for yi' and yi'' .
1 h
If 2 = 2
i.e, k = then u i, j+1 = u i+1, j + u i−1, j − u i, j−1
a a
12. Write down the classification of linear second order partial differential equation.
The linear second order partial differential equation
Auxx + Buxy + Cu yy + Du x + Eu y + Fu + G = 0 can be classified as
(i) Elliptic if B 2 – 4 AC < 0 (ii) Parabolic if B 2 – 4 AC = 0
(iii) Hyperbolic if B 2 – 4 AC > 0
13. Classify the following equation u xx + 4u xy + 4u yy − u x + 2u y = 0
Comparing with general equation of second
order partial differential equation
Auxx + Buxy + Cu yy + Dux + Eu y + Fu + G = 0 , we get A= 1, B = 4, C = 4
B 2 – 4 AC = 16-4(1)(4 )= 0
Therefore, the given partial differential equation is parabolic.
x
14. Classify u xx + yuxy + uyy − ux + u = 0.
4
Here B 2 – 4 AC = y 2 – x
i) PDE is Elliptic if y 2 x ii) PDE is Parabolic if y 2 = x
iii) PDE is Hyperbolic if y2 x
15. Write down the centre finite difference formula for uyy.
ui , j +1 − 2ui , j + ui , j −1
u yy =
k2
16. Write down the Standard five point formula
ui , j −1 + ui , j +1 + ui−1, j + ui+1, j
ui , j =
4
17. Write down the Diagonal five point formula
1
ui , j = u i −1, j−1 + u i −1, j+1 + u i +1, j−1 + u i +1, j+1
4
18. Write down the Liebmann’s iteration process formula:
+1) 1 (n +1) (n +1)
u i(n
,j = u i −1, j + u i(n
+1, j + u i , j−1 + u i , j+1
) (n )
4
19. Write down the centre finite difference formula for uxx.
ui+1,j − 2u i,j + ui−1,j
u xx =
h2
20. Obtain the finite difference scheme for the differential equation 2 y '' ( x) + y ( x) = 5
y + yi +1 − 2yi
2 i −1 + yi − 5 = 0 2( yi −1 + yi +1 ) + yi (h − 4) − 5h = 0
2 2
2
h
1. Solve y'' − y = 0 , with y(0)=0, y(1)=1 using finite difference method with h=0.2.
yk −1 − 2 yk + yk +1 − 0.04 yk = 0
yk −1 − 2 yk + yk +1 − 0.04 yk = 0
yk −1 − 2.04 yk + yk +1 = 0
2. Solve y'' − y = x, x (0,1) , with y(0)=y(1)=0 using finite differences by dividing the interval
into four equal parts.
The given differential equation can be written as y" (x ) − y (x ) = x (1)
using the central difference approximation, we have
y − 2 y k + y k +1
y " = k −1 (2)
h2
substituting (2) in (1)
y − 2 y k + y k +1
we have k −1 − y k = xk
h2
yk −1 − 2 yk + yk +1 − h 2 yk = h 2 xk
3. 1 1
, take h =
2 3
Solution:
x0 =0 x1=1/3 x2=2/3 x3=1
y0 =0 y1=? y2=? y3=1/2
1
9 1 + ( y 2 − 2 y1 ) + 4 ( y1 − 0 ) + 2 y1 = 2
9
10 y 2 − 20 y1 + 6 y1 = 2
−14 y1 + 10 y2 = 2
(−14) y1 − 0.7143 y2 = −0.1429 → (1)
Put i = 2 in (1), we get
9(1 + x2 2 ) ( y3 − 2 y 2 + y1 ) + 12 x2 ( y2 − y1 ) + 2 y2 = 2
2 2 1 2
9 1 + − 2 y 2 + y1 + 12 ( y2 − y1 ) + 2 y2 = 2
3 2 3
4 1 24
9 1 + − 2 y2 + y1 + ( y2 − y1 ) + 2 y2 = 2
9 2 3
13 ( 0.5 − 2 y 2 + y1 ) + 8 ( y2 − y1 ) + 2 y2 = 2
6.5 − 26 y2 + 13 y1 + 8 y2 − 8 y1 + 2 y2 = 2
5 y1 − 16 y2 = −4.5
(5) y1 − 3.2 y2 = −0.9 → (2)
(1) − (2) 2.4857 y2 = 0.7571 y2 = 0.30458
y1 − 3.2 y2 = −0.9 y1 − 3.2(0.30458) = −0.9
y1 = 0.07466
Evaluate the pivotal values of the equation u tt = 16u xx taking x = 1 upto t = 1.25. The
4.
boundary conditions are u(0, t) = u(5, t) = u t (x, 0) = 0 and u(x, 0) = x 2 ( 5 − x )
2u 2u h 1
Solution: The given equation is 2 = 16 2 , here =4, h=1 we get k = = .
t x 4
From the initial conditions u(0,t)=0 and u(5,t)=0 we get the values of u along the entire line
x=0and x=5 as zero. In difference form these initial conditions becomes
u0, j = 0 and u5, j = 0 for all values of j.
1
Put = in above formula we get the simplest form ui, j+1 = (ui+1, j + ui−1, j ) − ui, j-1
4
x 0 1 2 3 4 5
i
t 0 1 2 3 4 5
j
0 0 0 4 12 18 16 0
0.25 1 0 6 11 14 9 0
0.5 2 0 7 8 2 –2 0
0.75 3 0 2 –2 –8 –7 0
1 4 0 –9 –14 –11 –6 0
1.25 5 0 –16 –18 –12 –4 0
Solve u xx = 4utt , given that u( x ,0) = x(4 − x ), u(0, t ) = 0, u(4, t ) = 0 and ut ( x ,0) = 0 by
5.
Explicit formula. Compute u up to t = 4 (taking h=1, k = 1/2).
Solution:
x
0 1 2 3 4
t
0 0 3 4 3 0
2 0 2 3 2 0
4 0 0 0 0 0
2u 2uu
Solve by explicit difference method 25 =
, given that ( x ,0) = 0, u(0, t ) = 0,
x 2 t 2 t
6.
2 x, when 0 x 2.5
u(5, t ) = 0, u( x ,0) = taking h = 1. Find u( x , t ) upto t = 2.
10 − 2 x , when 2.5 x 5
2 2 2 2
Solution: Explicit formula is u i, j + 1 = 2(1 − λ )u i, j + λ (u i − 1, j + u i + 1, j ) - u i, j − 1
i.e. H = 2(1 − λ α )E + λ α (D + F) - B
2 2 2 2
1 1
Here 2 = 25 , h =1 =2 =
2
25
2l 2(5)
One period of oscillation = = = 2 sec .
5
Hence k = h/a = 1/5
Put = 1/5 in above formula we get the simplest form
u i, j+1 = (u i+1, j + u i−1, j ) − u i, j
i.e) H = (D+F) – B
(A + C)
Condition ut(x,0) = 0 is equivalent to E =
2
x
0 1 2 3 4 5
t
0 0 2 4 4 2 0
1/5 0 2 3 3 2 0
2/5 0 1 1 1 1 0
3/5 0 –1 –1 –1 –1 0
4/5 0 –2 –3 –3 –2 0
5/5 = 1 0 –2 –4 –4 –2 0
6/5 0 –2 –3 –3 –2 0
7/5 0 –1 –1 –1 –1 0
8/5 0 1 1 1 1 0
9/5 0 2 3 3 2 0
10/5 = 2 0 2 4 4 2 0
x
t 0 1 2 3 4
0 0 3 4 3 0
1 0 2 3 2 0
2 0 1.5 2 1.5 0
3 0 1 1.5 1 0
4 0 0.75 1 0.75 0
2 f f
8. Given = , f (0, t ) = 0 = f (5, t ), f (x,0) = x 2 (25 − x 2 ) , find f in the range taking h = 1
x 2
t
and upto 5 seconds.
h 2 k 1
Here = 1, h=1, k=0.5 ( k = ) ,we get = 2 = ,
2 h 2
u(x,0) = x 2 (25 − x 2 ), u(0,0)=0,u(1,0)=24, u(2,0)=84, u(3,0)=144, u(4,0)=144.
we know that Schmidt relation is u i, j+1 = λ(u i +1, j + u i −1, j ) + (1 − 2)u i, j
(u i+1, j + u i−1, j )
in the above equation we get u i, j+1 =
1
substituting =
2 2 ,
remaining values are calculated by using the above formula
x 0 1 2 3 4 5
i
t 0 1 2 3 4 5
j
0 0 0 24 84 144 144 0
0.5 1 0 42 84 114 72 0
1 2 0 42 78 78 57 0
1.5 3 0 39 60 67.5 39 0
2 4 0 30 53.25 49.5 33.75 0
2.5 5 0 26.625 39.75 43.5 24.75 0
3 6 0 19.875 35.063 32.250 21.750 0
3.5 7 0 17.531 26.063 28.406 16.125 0
4 8 0 13.031 22.969 21.094 14.203 0
4.5 9 0 11.484 17.063 18.586 10.547 0
5 10 0 8.531 15.035 13.805 9.293 0
Using Bender Schmidt’s method solve u t = u xx subject to the condition, u(0,t)=0, u(1,t)=0,
9.
u(x,0) = sin x, 0<x<1 and h=0.2, Find the value of u upto t=0.1.
h 2
Here = 1, h=0.2, k=0.02 ( k = )
2
k 1
we get = = ,
h 2
2
Solve u t = u xx , for 0<x<1, t>0 given that u(x,0) = 100x (1 − x ) , u(0,t)=0,u(1,t)= 0 by Crank
10.
Nicholson formula. Compute u for 1 time step. (taking h=1/4, k=1/64)
0 u1 u2 u3 21.9
0 u4 u5 u6 21.0
0 u7 u8 u9 17.0
0 9.0
8.7 12.1 12.8
Solution: Let the values of u at the interior lattice points be u1, u2, …, u9. Now the initial values
of ‘u’ are calculated either by using standard five point formula or diagonal five point formula.
Rough values :
1
ui, j = u i −1, j + u i +1, j + u i , j−1 + u i , j+1 for the grid point u5,
4
Applying SFPF
we get
1
u5 = 0 + 17 + 21 + 12.1 = 12.5
4
1
Applying DFPF ui , j = ui −1, j −1 + ui −1, j + ui +1, j −1 + ui +1, j +1 for the grid points u1, u3, u7, u9
4
we get
1 1
u1 = 0 + 12.5 + 0 + 17 = 7.4; u3 = 12.5 + 18.6 + 17 + 21 = 17.3;
4 4
1 1
u7 = 12.5 + 0 + 0 + 12.1 = 6.2; u9 = 12.5 + 9 + 21 + 12.1 = 13.7;
4 4
1
u1 = 0 + 11.1 + u4 + u2 u1 = 7.8 u1 = 7.9 u1 = 7.9
4
1
u2 = u1 + 17 + u5 + u3 u2 = 13.7 u2 = 13.7 u2 = 13.7
4
1
u3 = u2 + 19.7 + u6 + 21.9 u3 = 17.9 u3 = 17.9 u3 = 17.9
4
1
u4 = 0 + u1 + u7 + u5 u4 = 6.6 u4 = 6.6 u4 = 6.6
4
1
u5 = u4 + u2 + u8 + u6 u5 = 11.9 u5 = 11.9 u5 = 11.9
4
1
u6 = u5 + u3 + u9 + 21 u6 = 16.1 u6 = 16.3 u6 = 16.3
4
1
u7 = 0 + u4 + 8.7 + u8 u7 = 6.6 u7 = 6.6 u7 = 6.6
4
1
u8 = u7 + u5 + 12.1 + u9 u8 = 11 u8 = 11.2 u8 = 11.2
4
1
u9 = u8 + u6 + 12.8 + 17 u9 = 14.2 u9 = 14.3 u9 = 14.3
4
Iterate until the maximum difference between successive values at any grid point is less than
0.001
ui , j −1 + ui , j +1 + ui−1, j + ui+1, j
Standard five point formula is ui , j =
4
Let u2 =1.6
1
u1 = (1 + 1 + 1.6 + 1.6) = 1.3 (by using standard five point formula)
4
1
u2 = ( 2 + 2 + 1.3 + 1.3) = 1.65
4
I iteration:
1 1
u1 = ( 2 + 2u2 ) = 1.325 , u2 = ( 4 + 2u1 ) = 1.6625
4 4
II iteration
1 1
u1 = (1 + u2 ) = 1.33125 , u2 = ( 2 + u1 ) = 1.6656
2 2
III iteration
1 1
u1 = (1 + 1.6656) = 1.3328, u2 = (3.3328) = 1.6664
2 2
IV iteration
1 1
u1 = (1 + 1.6664) = 1.3332 , u2 = (3.3332) = 1.6666
2 2
We conclude that u1 =1.3332 , u2 = 1.6666 , u3 = 1.3332 , u4 = 1.6666
values as shown.
0 500 1000 500 0
1000 u1 u2 u3 1000
2000 u4 u5 u6 2000
1000 u7 u8 u9 1000
0 0
500 1000 500
Solution: Let the values of u at the interior lattice points be u1, u2, …, u9. Now the initial values of
‘u’ are calculated either by using standard five point formula or diagonal five point formula.
Rough values :
1
ui, j = u i −1, j + u i +1, j + u i , j−1 + u i , j+1 for the grid point u5,
4
Applying SFPF
By SFPF
u5 = (2000+2000+1000+1000) / 4 = 1500
Applying DFPF ui , j =
1
4
ui −1, j −1 + ui −1, j + ui +1, j −1 + ui +1, j +1 for the grid points u1, u3, u7, u9
By DFPF
u1 = (0+1000+2000+1500) / 4 = 1125
u3 = (0+1000+1500+2000) /4 = 1125
u7 = (2000+1500+0+1000) /4 = 1125
u9 = (1500+2000+1000+0) / 4 = 1125
By SFPF
u2 = (1125+1125+1000+1500) / 4 = 1188
u4 = (2000+1500+1125+1125) / 4 = 1438
u6= (1500+2000+1125+1125) /4 = 1438
u8 = (1125+1125+1500+1000) / 4 = 1188
For the forthcoming iterations, SFPF will be applied
u1 u2 u3 u4 u5 u6 u7 u8 u9
III 981 1048 962 1298 1174 1275 962 1025 950
2 2
Applying the formula (1) at B i = , j =
3 3
2 2
u1 + 100 + u 3 + 100 − 4u 2 = − .
3 3
−4
u1 − 4u 2 + u1 = − 200 ( u1 = u 3 )
9
−1804
2u1 − 4u 2 =
9
−902
u1 − 2u 2 =
9
902
2u 2 − u1 = .......... ( 3)
9
1 1
Applying the formula (1) at C i = , j =
3 3
1 1
u1 + 0 + 0 + u 3 − 4u 4 = − .
3 3
−1
u1 + u1 − 4u 4 = ( u1 = u 3 )
9
−1
2u1 + = 4u 4
9
1 1
u 4 = 2u1 +
4 9
Substitute for u 4 in (1), we get
1 1 902
4u1 − u 2 − 2u1 + =
4 9 9
7 1 902 3609
u1 − u 2 = + =
2 36 9 36
3609
7u1 − 2u 2 = (4)
18
6314
(2) 7 −7u1 + 14u 2 =
9
Adding,
3609 6314 16237
12u 2 = + =
18 9 18
u 2 = 75.17 75.2
Substituting u 2 in ( 2 ) we get,
902
u1 = 2(75.2) − = 50.18
9
Substituting u1 in ( 3) we get,
1 1
u4 = 2(50.8) + = 25.12
4 9
u1 = 50.18 = u 3 , u 2 = 75.2, u 4 = 25.12