Numerical Methods Tutorial
Numerical Methods Tutorial
KEY POINTS
𝑎+𝑏
• Bisection Method: 𝑐 = where 𝑓(𝑎) < 0 𝑎𝑛𝑑 𝑓(𝑏) > 0
2
𝑏−𝑎
• Regula-Falsi Method: 𝑐 = 𝑏 − 𝑓(𝑏)−𝑓(𝑎) 𝑓(𝑏) where 𝑓(𝑎) < 0 𝑎𝑛𝑑 𝑓(𝑏) > 0
𝑥 −𝑥
• 𝑖 𝑖−1
Secant Method: 𝑥𝑖+1 = 𝑥𝑖 − 𝑓(𝑥 )−𝑓(𝑥 𝑓(𝑥𝑖 )
𝑖 𝑖−1 )
𝑓(𝑥 )
• Newton-Raphson Method: 𝑥𝑖+1 = 𝑥𝑖 − 𝑓′ (𝑥𝑖 )
𝑖
• Fixed Point Iteration Method: 𝑓(𝑥) = 0 ⇒ 𝑥𝑖+1 = 𝜙(𝑥𝑖 ) where |𝜙 ′ (𝑥)| < 1
1. Explain the types of errors. An approximate value of 𝜋 is given by 𝑋1 = 3.1428571 and its true value
is 𝑋 = 3.1415926. Find the absolute and relative errors. (***)
2. If 𝑥 = 1.350253 is rounded off to four significant digits find the absolute and relative errors.
3. Use the Bisection Method to compute a root of the equation: 𝑥𝑒 𝑥 = cos 𝑥 correct to four decimal places.
4. Find where the graph of 𝑦 = 𝑥 − 3 and 𝑦 = ln(𝑥) intersect using bisection method. Get the intersection
value correct to four decimal places.
5. Using the bisection method, find an approximate root of the equation sin 𝑥 = 1/𝑥, that lies between x=1
and x=1.5 (in radians). Carry out computations up to 7th stage.
6. Find the root of the equation 𝑓(𝑥) = 𝑥 2 − 4𝑥 − 10 correct to three decimal places using False Position
Method.
7. Find the positive real root of the equation cos 𝑥 + 𝑒 𝑥 + 𝑥 2 = 3 using False position method, correct to
three decimal places.
8. Discuss the application of Numerical methods in the field of science and engineering. Find a real root
of 𝑒 cos 𝑥 − sin 𝑥 − 1 = 0 correct to four decimal places using False position method.
9. Find a positive root of the equation 𝑥 sin 𝑥 − 1 = 0 using any closed end method up to four decimal
places.
10. What is the fixed point of a non-linear equation? Find a real root of the equation: 𝑥𝑒 𝑥 = 3 by using any
bracketing method correct to three decimal places. (Take 𝑥1 = 1 and 𝑥2 = 1.5)
11. Solve the equation log 𝑥 − cos 𝑥 = 0 correct to three significant digits after decimal, using Bracketing
method.
12. The equation: 𝛼 tan 𝛼 = 1 occurs in theory of vibrations.
i. How many roots does it have in the interval (-6,6)? What is the assumption being made?
ii. Find one of the positive real roots by using any closed-end method, correct to at least three
decimal places.
13. The flux equation of an iron core electric circuit is given by: 𝑓(𝜙) = 10 − 2.1𝜙 − 0.01𝜙 3 . The steady
state value of flux is obtained by solving the equation, 𝑓(𝜙) = 0. By using any close-end method,
estimate the steady state value of "𝜙" correct to three decimal places.
1. Write a difference between secant method and false position method. Using secant method find a root
of the equation 3𝑥 + sin 𝑥 − 𝑒 𝑥 = 0 correct up to three decimal places.
2. Using Secant method, find the zero of the function 𝑓(𝑥) = 2𝑥 − log10 𝑥 − 7 correct up to three decimal
places.
3. Solve 𝑓(𝑥) = 𝑥𝑒 𝑥 − 1 by secant method for tolerance value 0.0001.
4. Using Secant method find a root of the equation 𝑒 𝑥 sin 𝑥 − 𝑥 2 = 0 correct to three decimal places.
5. Solve 𝑓(𝑥) = 3𝑥 + sin 𝑥 − 𝑒 𝑥 by secant method.
6. Write an algorithm to find a real root of a non-linear equation using secant method.
7. Obtain a real root of the equation: sin 𝑥 + 1 = 2𝑥 by using secant method such that the real root must
have relative error less than 0.0001.
8. Define root with example. Determine the root of 𝑒 𝑥 = 𝑥 3 + cos(25𝑥) using secant method correct to
four decimal places.
9. Estimate the root of the equation 𝑓(𝑥) = 𝑥𝑒 𝑥 − cos 𝑥 using Newton Raphson Method correct to three
decimal places.
10. What is the difference between Bisection Method and False Position Method even though both are
bracketing methods? Find the real root of the given non-linear equation correct to three decimal places
using Newton Raphson Method. 𝑥𝑒 𝑥 = sin 𝑥
11. Find the root of the equation log 𝑥 − cos 𝑥 = 0 correct to three decimal places by using N-R method.
12. Evaluate one of the real roots of the given equation: 𝑥𝑒 𝑥 − cos(𝑥) = 0 by using NR-method correct to
at least four decimal places.
13. Discuss the drawbacks of Newton-Raphson method. Find the real root of the equation𝑥 sin 𝑥 − cos 𝑥 =
0 using Newton-Raphson method, correct to three decimal places.
14. Find the root of the equation log 𝑥 − cos 𝑥 = 0 correct to three decimal places using N-R Method.
15. Find the root of 𝑒 𝑥 tan 𝑥 = 1 by creating iterative formula of Newton-Raphson method.
16. Derive an iterative formula for NR-method. Find a positive real root of the equation 𝑥 log10 (𝑥) = 1.2
by using this formula correct to four significant digits.
17. Find the root of the equation3𝑥 = cos(𝑥) + 1 using NR method with the tolerance of 10E-5.
18. What are the limitations of Newton-Raphson method? Using Newton-Raphson method find a root of
the equation 𝑥𝑒 𝑥 = 2.
19. Find the root of the equation 𝑥 sin 𝑥 + cos 𝑥 = 0 using Newton Raphson’s Method so that relative error
is less than 0.1.
20. Find the square root of 7 using Newton Raphson method and fixed point iteration method correct up to
four decimal digit.
21. Find a real root of the equation cos 𝑥 = 3𝑥 − 1, correct to three decimal places, using fixed point
method.
22. Find a root of 3𝑥 + sin 𝑥 − 𝑒 𝑥 = 0 using
i. One of the bracketing methods and
ii. One of the non-bracketing methods
KEY POINTS
• Newton forward interpolation:
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3
𝑦(𝑥0 + 𝑝ℎ) = 𝑦0 + 𝑝∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3!
• Newton backward interpolation:
𝑝(𝑝 + 1) 2 𝑝(𝑝 + 1)(𝑝 + 2) 3
𝑦(𝑥𝑛 + 𝑝ℎ) = 𝑦𝑛 + 𝑝∇𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛 + ⋯
2! 3!
• Lagrange interpolation:
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 )
𝑦(𝑥) = 𝑦0 + 𝑦 +⋯
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … (𝑥0 − 𝑥𝑛 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … (𝑥1 − 𝑥𝑛 ) 1
• Newton divided difference:
𝑦(𝑥) = 𝑦0 + (𝑥 − 𝑥0 )[𝑥0 , 𝑥1 ] + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )[𝑥0 , 𝑥1 , 𝑥2 ] + ⋯
• Spline interpolation:
6
𝑀𝑖−1 + 4𝑀𝑖 + 𝑀𝑖+1 = 2 (𝑦𝑖−1 − 2𝑦𝑖 + 𝑦𝑖+1 ), 𝑀0 = 0, 𝑀𝑛 = 0
ℎ
(𝑥𝑖+1 − 𝑥)3 (𝑥 − 𝑥𝑖 )3 (𝑥𝑖+1 − 𝑥) ℎ2 (𝑥 − 𝑥𝑖 ) ℎ2
𝑓(𝑥) = 𝑀𝑖 + 𝑀𝑖+1 + (𝑦𝑖 − 𝑀𝑖 ) + (𝑦𝑖+1 − 𝑀𝑖+1 )
6ℎ 6ℎ ℎ 6 ℎ 6
• Least Square Method:
To fit curve 𝑦 = 𝑎 + 𝑏𝑥 to given points,
Solve ∑ 𝑦 = 𝑛𝑎 + 𝑏 ∑ 𝑥 𝑎𝑛𝑑 ∑ 𝑥𝑦 = 𝑎 ∑ 𝑥 + 𝑏 ∑ 𝑥 2 for unknowns and b.
𝟐 3
(𝑖) 𝒚 = 𝒂𝒙 + 𝒃/𝒙 ⇒ 𝑥𝑦 = 𝑎𝑥 + 𝑏 ⇒ 𝑌 = 𝑎𝑋 + 𝑏
(𝑖𝑖) 𝒚 = 𝒂𝒙𝒃 ⇒ log 𝑦 = log 𝑎 + 𝑏 log 𝑥 ⇒ 𝑌 = 𝐴 + 𝑏𝑋
INTERPOLATION
1. The population of a town in the last six censuses are as given below. Estimate the population in the year
1946. (**)
Year 1911 1921 1931 1941 1951 1961
Populations (000) 12 15 20 27 39 52
2. From the following table, estimate the number of students who obtained marks between 40 and 45.
Marks 30—40 40—50 50—60 60—70 70—80
No. of students 31 42 51 35 31
3. The following table gives the population of a town during the last six censuses. Estimate the increase in
the population during the period from 1976 to 1978.
Year 1941 1951 1961 1971 1981 1991
Populations (000) 12 15 20 27 39 52
4. From the following data given in the table below, evaluate f (2.5) by using Lagrange method.
x 1 2 4 5 7
f (x) 1 1.414 1.732 2.00 2.6
5. Generate a Lagrange’s interpolating polynomial for the function: 𝑦 = cos 𝜋𝑥, taking the pivotal points
0, ¼ and ½.
1. From the data given below, find the number of students whose weight is between 60 to 70.
Weight in lbs 0—40 40—60 60—80 80—100 100—120
No. of students 250 120 100 70 50
2. From the following table, estimate the number of student who obtained marks between 40 and 45.
Marks 30—40 40—50 50—60 60—70
No. of students 31 42 51 35
3. Define interpolation. From the following table, estimate the number of students who passed marks
between 40 and 45:
Marks 30—40 40—50 50—60 60—70 70—80
No. of students 30 40 50 38 31
4. Find the number of students securing marks between 50—55 using following table.
Marks Obtained 20—30 30—40 40—50 50—60
No. of students 10 20 30 40
5. The following table gives the viscosity of oil as the function of temperature. Use Lagrange’s
interpolation formula to find the viscosity of oil at a temperature of 140 degree Celsius.
T (degCelsius) 110 130 160 190
Viscosity 10.8 8.1 5.5 4.8
6. The function 𝑦 = 𝑓(𝑥) is given at the points (7, 3), (8, 1), (9, 1) 𝑎𝑛𝑑 (10, 9). Find the value of y for x
= 9.5 using Lagrange interpolation formula.
7. The following table gives the percentage of criminals for different age groups. Using interpolation
formula, find the percentage of criminals under the age of 35.
Under age (x) 25 30 40 50
% of criminals 52 67.3 84.1 94.4
8. Find the missing term in the following table using suitable interpolation.
x 0 1 2 3 4
y 1 3 9 ? 81
9. Obtain divided difference table for the given data set:
x -1 2 5 7
y -8 3 1 12
10. Use Newton’s interpolation Method to evaluate the missing data from the following table.
x 4 5 7 8 10 11 13 15
f(x) 48 100 294 ? 900 1210 2028 ?
11. Estimate the functional values at x=1.5 and x=2.5 by using cubic Spline technique
x 0 1 2 3
y 1.5 4.5 9 25
1. By the method of least square, find the straight line that best fits the following data:
x 1 2 3 4 5
y 14 27 401 55 68
2. The following table gives the heights, x(cm) and weights, y(kg) of five persons.
x 175 165 160 155 145
y 68 58 55 52 48
Assuming the “linear relationship” between x and y, obtain the regression line (x on y). Also obtain ‘x’
value for y = 40.
3. For the following set of data, fit a parabolic curve using Least Square Method and find f(2).
xi 0.5 1 1.5 4.5 6.5 7.5
f(xi) 2.5 2.7 3.5 6.5 8.4 9.5
𝑏
4. Use the method of least squares, fit the curves 𝑦 = 𝑎𝑥 2 + 𝑥 to the following data.
x 1 2 3 4
y -1.52 0.96 8.88 7.66
5. Fit a curve of the form: 𝑦 = 1/(𝑎 + 𝑏𝑥) by using method of least square with the following data points.
x 1 2 3 4 5
f (x) 3.33 2.20 1.52 1.00 0.91
6. Fit a power curve of the form 𝑦 = 𝑎𝑒 𝑏𝑥 to the following data:
x 0 1 2 3
y 10.5 2.15 3.85 8.30
7. From the following experimental data, it is known that the relation connects v and t as 𝑣 = 𝑎𝑡 𝑏 . Find
the possible values of a and b.
v 350 400 500 600
t 61 26 7 2.6
8. The voltage v across a capacitor at time t seconds is given in following table. (**)
Time t(sec) 0 2 4 6 8 10
Voltage v 150 63 28 12 5.6 124
𝑘𝑡
If the relationship between voltage v and time t is of the form 𝑣 = 𝑎𝑒 . Using least-square
approximation estimate the temperature at t = 2.6 minutes.
9. The following table shows the pressure and specific volume of dry saturated steam.
V 38.4 20 8.51 4.44 3.03
P 10 20 50 100 150
𝛼
Find a curve of the form: 𝑃𝑉 = 𝛽 by using least square method.
10. The growth of bacteria (N) in a culture after t hours is given by the following table.
Time t(hr) 0 1 2 3 4 5
Bacteria (N) 32 47 65 92 132 124
𝑡
If the relationship between bacteria N and time t is of the form 𝑁 = 𝑎𝑏 . Use least-square approximation
estimate the N at t = 5 hr.
KEY POINTS
𝑝(𝑝−1) 𝑝(𝑝−1)(𝑝−2)
• Differentiation: 𝑥 = 𝑥0 + 𝑝ℎ and 𝑦 = 𝑦0 + 𝑝∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0 + ⋯
2! 3!
𝑑𝑦 𝑑𝑦 𝑑𝑝 1 2𝑝 − 1 2 3𝑝2 − 6𝑝 + 2 3 4𝑝3 − 18𝑝2 + 22𝑝 − 6 4
= = [∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯ ]
𝑑𝑥 𝑑𝑝 𝑑𝑥 ℎ 2 6 24
𝑑2𝑦 𝑑 𝑑𝑦 𝑑𝑝 1 2 3
12𝑝2 − 36𝑝 + 22 4
= ( ) = [∆ 𝑦0 + (𝑝 − 1)∆ 𝑦0 + ∆ 𝑦0 + ⋯ ]
𝑑𝑥 2 𝑑𝑝 𝑑𝑥 𝑑𝑥 ℎ2 24
Similarly, for Backward Interpolation.
• Trapezoidal Rule:
𝑥𝑛
ℎ
∫ 𝑦 𝑑𝑥 = [(𝑦 + 𝑦𝑛 ) + 2(𝑦1 + 𝑦2 + ⋯ + 𝑦𝑛−1 )]
2 0
𝑥0
• Simpson’s 1/3 Rule:
𝑥𝑛
ℎ
∫ 𝑦 𝑑𝑥 = [(𝑦 + 𝑦𝑛 ) + 2(𝑦2 + 𝑦4 + ⋯ + 𝑦𝑛−2 ) + 4(𝑦1 + 𝑦3 + ⋯ + 𝑦𝑛−1 )]
3 0
𝑥0
• Simpson’s 3/8 Rule:
𝑥𝑛
3ℎ
∫ 𝑦 𝑑𝑥 = [(𝑦0 + 𝑦𝑛 ) + 2(𝑦3 + 𝑦6 + ⋯ + 𝑦𝑛−3 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 + ⋯ + 𝑦𝑛−2 + 𝑦𝑛−1 )]
8
𝑥0
• Romberg Integration:
ℎ 4𝐼2 − 𝐼1
𝐺𝑖𝑣𝑒𝑛, 𝐼1 (ℎ), 𝐼2 (ℎ/2) 𝑡ℎ𝑒𝑛 𝐼3 (ℎ, ) =
2 3
1
• Gaussian Integration: ∫−1 𝑓(𝑢) 𝑑𝑢 = 𝑊1 𝑓(𝑢1 ) + 𝑊2 𝑓(𝑢2 ) + ⋯
1 1
𝐹𝑜𝑟 𝑛 = 2, 𝑊1 = 𝑊2 = 1, 𝑢1 = − , 𝑢2 =
√3 √3
8 5
𝐹𝑜𝑟 𝑛 = 3, 𝑊1 = , 𝑊2 = 𝑊3 = , 𝑢1 = 0, 𝑢2 = −√0.6, 𝑢3 = √0.6
9 9
𝑏
(𝑏 − 𝑎) (𝑏 + 𝑎)
𝐹𝑜𝑟 𝐼 = ∫ 𝑓(𝑥)𝑑𝑥 , 𝑡𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚 𝑤𝑖𝑡ℎ 𝑥 = 𝑢+
2 2
𝑎
NUMERICAL DIFFERENTIATION
1. A slider in a machine moves along a fixed straight rod. Its distance x (cm) along the rod is given below
for various values of time t seconds. Find the velocity and acceleration of the slider when t = 0.2
t 0 0.1 0.2 0.3
x 30.13 31.62 32.87 33.95
2. The following table gives the corresponding values of pressure and specific volume of superheated
steam.
V 2 4 6 8
P 105 42.07 25.3 16.7
(i) Find the rate of change of pressure with respect to volume when V=2.
(ii) Find the rate of change of volume with respect to pressure when P=105.
NUMERICAL INTEGRATION
2 𝑥
4. Evaluate ∫−2 𝑥+2𝑒 𝑥 𝑑𝑥 by using Trapezoidal, Simpson’s 1/3 and 3/8 rule with n = 6.
5. The velocity ‘v’ of a particle at a distance ‘s’ from a point on its path is given by the following table.
s (metre) 0 10 20 30 40 50 60
v (metre/sec) 47 58 64 65 61 52 38
Estimate the time taken to travel 60 metres by using Simpson’s 1/3 rule and Simpson’s 3/8 rule.
2 𝑒 𝑥 +sin 𝑥
6. Use Romberg’s method, to compute ∫0 𝑑𝑥 correct up to two decimal places.
1+𝑥 2
7. Use Romberg integration to find the solution correct up to three decimal places. (**)
1
1
𝐼=∫ 𝑑𝑥
1 + 𝑥2
0
10 −1
8. Evaluate the integral 𝐼 = ∫0 exp (1+𝑥 2 ) 𝑑𝑥 using Gauss quadrature formula with n = 2 and n = 3.
51
9. Evaluate ∫1 𝑥 𝑑𝑥 by using Gaussian integration formula for n = 3 and compare the value with exact
solution.
1. Using forward interpolation formula, derive differentiation formula for the first and second derivative
of a function f(x).
𝑑𝑦 𝑑2 𝑦
2. From the following table of values of x and y, obtain 𝑑𝑥 𝑎𝑛𝑑 𝑑𝑥 2 for x = 1.2.
x 1.0 1.2 1.4 1.6 1.8
y 2.7183 3.3201 4.0552 4.9530 6.0496
3. The following table gives the displacement, x(cms) of an object at various of time, t(seconds). Find the
velocity and acceleration of the object at t=1.6 sec using suitable interpolation method.
t 1.0 1.2 1.4 1.6 1.8
x 9.0 9.5 10.2 11.0 13.2
4. Use following table of data to estimate velocity at t = 7 sec
Time, t(s) 5 6 7 8 9
Distance, s(t) (km) 10.0 14.5 19.5 25.5 32.0
Hint: Velocity is first derivative of s(t).
5. The following data gives corresponding values of pressure ‘P’ and specific volume ‘V’ of steam.
P 105 42.7 25.3 16.7 13
V 2 4 6 8 10
Find the rate of change of volume when pressure is 105 and 13.
𝜋
sin 𝑢
6. Evaluate ∫02 𝑑𝑢 by using Trapezoidal, Simpson’s 1/3 and 3/8 rule with n = 6.
𝑢
5.2
7. Evaluate ∫4 log 𝑥 𝑑𝑥 from the following data.
x 4.0 4.2 4.4 4.6 4.8 5.0 5.2
y 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094 1.6487
by using
i) Trapezoidal Method
ii) Simpson 1/3 Method
iii) Simpson 3/8 Method
8. Consider the following table showing the distance (in meters) travelled by an object at different time
intervals (in seconds):
Time (t) 0 1 2 3 4
Distance (s) 0 2 8 18 32
Using the trapezoidal and Simpson integration rule, calculate the average velocity of the bicycle over
the time interval from t = 0 to t = 4 seconds.
9. Integrate the following function by using Trapezoidal rule, Simpson’s 1/3 rule and Simpson’s 3/8 rule.
𝜋
Take n = 6. ∫0 sin 𝑥 𝑑𝑥.
2
𝜋
10. Evaluate the integral 𝐼 = ∫02 (1 + 3 cos 2𝑥) 𝑑𝑥. Compare the result in both conditions for Simpson 1/3
and 3/8 rule.
11. Estimate the following integral by
i. Simpson’s 3/8 method
ii. Simpson’s 1/3 method and compare the result
5.2
4. Use Romberg’s integration to evaluate ∫4 log 𝑥 𝑑𝑥 correct to two decimal places.
5. Using three-point Gaussian Quadrature formula, evaluate
1
𝑑𝑥
∫
1+𝑥
0
2 𝑥 2 +2𝑥+1
6. Evaluate ∫0 1+(𝑥+1)4 𝑑𝑥 by using Gaussian Integration formula for n = 2, n = 3 and compute their
values with exact solution.
𝜋
cos 𝑥
7. Integrate the given integral ∫02 𝑑𝑥 using Gauss quadrature formula for n = 2 and n = 3.
√1+sin 𝑥
8. Compute the integral using Gaussian 3-point formula.
5
𝑒 𝑥 + sin 𝑥
∫ 𝑑𝑥
1 + 𝑥2
2
9. Use Gauss-Legendre 2-point and 3-point formula to evaluate
1.5
2
∫ 𝑒 𝑥 𝑑𝑥
0.5
10. Evaluate the following integral using Gaussian 2 and 3 points formula.
10
1
(− )
∫𝑒 1+𝑥2 𝑑𝑥
0
KEY POINTS
• Gauss Elimination Method: Convert coefficient matrix into Upper-Triangular matrix and use back
substitution
• LU Factorization or Decomposition Method: 𝑨𝑿 = 𝑩 ⇒ (𝑳𝑼)𝑿 = 𝑩
Dolittle Algorithm Crout Algorithm Cholesky Algorithm
𝑙11 0 0 1 𝑢12 𝑢13 𝑎 0 0 𝑎 𝑏 𝑐
1 0 0 𝑢11 𝑢12 𝑢13
0] [ 0 𝑢22 𝑢23 ] 𝑙
𝐴 = [ 21 𝑙22 0 ] [0 1 𝑢23 ] 𝐴 = [𝑏 𝑑 0 ] [0 𝑑 𝑒]
𝐴 = [𝑙21 1
𝑙31 𝑙32 𝑙33 0 0 1 𝑐 𝑒 𝑓 0 0 𝑓
𝑙31 𝑙32 1 0 0 𝑢33
1. Solve the following system of equations by applying Gauss Elimination Method (GEM) with partial
pivoting technique. And, also determine the determinant value.
2𝑥 + 2𝑦 + 𝑧 = 6, 4𝑥 + 2𝑦 + 3𝑧 = 4, 𝑥−𝑦+𝑧=0
2. Solve the following system of equations using Gauss elimination method. (Use Partial pivoting if
necessary)
6𝑥1 − 2𝑥2 + 𝑥3 = 4, −2𝑥1 + 7𝑥2 + 2𝑥3 = 5, 𝑥1 + 2𝑥2 − 5𝑥3 = −1
3. Solve the following set of equations by using LU decomposition method.
3𝑥 + 2𝑦 + 7𝑧 = 32, 2𝑥 + 3𝑦 + 𝑧 = 40, 3𝑥 + 4𝑦 + 𝑧 = 56
4. Using Dolittle LU decomposition method, solve the following system of equations: (***)
3𝑥 + 2𝑦 + 𝑧 = 10, 2𝑥 + 3𝑦 + 2𝑧 = 14, 𝑥 + 2𝑦 + 3𝑧 = 14
5. Solve the following set of equations by using LU Crout method.
3𝑥 + 2𝑦 + 𝑧 = 10, 2𝑥 + 3𝑦 + 2𝑧 = 14, 𝑥 + 2𝑦 + 3𝑧 = 14
6. Solve the system 3𝑥1 + 2𝑥2 + 𝑥3 = 14, 2𝑥1 + 3𝑥2 + 2𝑥3 = 14, 𝑥1 + 2𝑥2 + 3𝑥3 = 14 by using
Cholesky method.
7. Solve the equations by Gauss-Jacobi method:
20𝑥 + 𝑦 − 2𝑧 = 17, 3𝑥 + 20𝑦 − 𝑧 = −19, 2𝑥 − 3𝑦 + 20𝑧 = 25
8. Use Gauss-Seidel iteration method to solve
2𝑥 + 𝑦 + 𝑧 = 5, 3𝑥 + 5𝑦 + 2𝑧 = 15, 2𝑥 + 𝑦 + 4𝑧 = 8
9. Find the largest eigenvalue and the corresponding eigen vector correct up to three decimal places using
2 −1 0
power method for the matrix 𝐴 = {−1 2 −1} (****)
0 −1 2
1 2 0
10. Find the largest eigenvalue 𝜆 and the corresponding eigenvector X of the matrix. 𝐴 = [2 1 0 ]
0 0 −1
1. Use Gauss Elimination method to solve the equations. Use partial pivoting method where necessary.
4𝑥1 + 5𝑥2 − 6𝑥3 = 28, 2𝑥1 − 7𝑥3 = 29, −5𝑥1 − 8𝑥2 = −64
2. Solve the following system of equations by the process of Gauss elimination (Use partial pivoting if
necessary)
3𝑥 + 2𝑦 = 𝑧 = 10, 2𝑥 + 3𝑦 + 2𝑧 = 14, 𝑥 + 2𝑦 + 3𝑧 = 14
3. What is a pivotal element? Solve the following system of linear equations by using Gauss-elimination
method with partial pivoting technique.
𝑥 + 𝑦 + 𝑧 + 𝑤 = 2, 𝑥 + 𝑦 + 3𝑧 − 2𝑤 = −6,
2𝑥 + 3𝑦 − 𝑧 + 2𝑤 = 7, 𝑥 + 2𝑦 + 𝑧 − 𝑤 = −2
++
4. Write a program in any high level language (C or C ) to solve a system of linear equations, using Gauss
elimination method.
5. Apply the factorization method to solve the equation 3𝑥 + 2𝑦 + 7𝑧 = 4; 2𝑥 + 3𝑦 + 𝑧 = 5; 3𝑥 +
4𝑦 + 𝑧 = 7
6. Obtain the solution of the following system using the Dolittle LU decomposition method. (***)
3𝑥1 + 2𝑥2 + 𝑥3 = 10, 2𝑥1 + 3𝑥2 + 2𝑥3 = 14, 𝑥1 + 2𝑥2 + 3𝑥3 = 14
7. Solve the following system of equations using Crout method.
𝑥 + 𝑦 + 𝑧 = 4, 𝑥 + 4𝑦 + 3𝑧 = 0, 𝑥 + 6𝑦 + 2𝑧 = 6
8. Solve the following system of equations using Factorization method.
2𝑥 + 3𝑦 + 𝑧 = 9, 𝑥 + 2𝑦 + 3𝑧 = 6, 3𝑥 + 𝑦 + 2𝑧 = 8
9. Solve the following set of equations using LU factorization method:
5𝑥 − 2𝑦 + 𝑧 = 4, 7𝑥 + 𝑦 − 5𝑧 = 8, 3𝑥 + 7𝑦 + 4𝑧 = 10
10. Solve the following system of equations by using Crout’s algorithm.
2𝑥 − 3𝑦 + 10𝑧 = 3, −𝑥 + 4𝑦 + 2𝑧 = 20, 5𝑥 + 2𝑦 + 𝑧 = −12
11. Solve the following set of equations using Cholesky method.
3𝑥 + 2𝑦 + 𝑧 = 10, 2𝑥 + 3𝑦 + 2𝑧 = 14, 𝑥 + 2𝑦 + 3𝑧 = 14
12. Using Gauss Jacobi method, solve the following system of linear equations:
10𝑥1 + 6𝑥2 − 5𝑥3 = 27, 3𝑥1 + 8𝑥2 + 10𝑥3 = 27, 4𝑥1 + 10𝑥2 + 3𝑥3 = 27
13. Use Gauss-Seidel iterative method to solve given equations.
40𝑥 − 20𝑦 − 10𝑧 = 390, 10𝑥 − 60𝑦 + 20𝑧 = −280, 10𝑥 − 30𝑦 + 120𝑧 = −860
14. Solve the following using Gauss Seidel method.
𝑏 + 3𝑐 + 2𝑑 = 19, 3𝑏 + 2𝑐 + 2𝑑 = 20,
𝑎 + 4𝑏 + 2𝑑 = 17, −2𝑎 + 2𝑏 + 𝑐 + 𝑑 = 9
15. Solve the following system of equations by using Gauss Seidel Method:
10𝑥 − 5𝑦 − 2𝑧 = 3, 𝑥 + 6𝑦 − 10𝑧 = −3, 4𝑥 − 10𝑦 + 3𝑧 = −3
16. Solve the following equations by Gauss-Seidel Method:
27𝑥 + 6𝑦 − 𝑧 = 85, 𝑥 + 𝑦 + 54𝑧 = 110, 6𝑥 + 15𝑦 + 2𝑧 = 72
17. Find the solution of the given simultaneous linear equation using Gauss Seidel method.
6𝑥1 − 2𝑥2 + 𝑥3 = 11
−2𝑥1 + 7𝑥2 + 2𝑥3 = 5
𝑥1 + 2𝑥2 − 5𝑥3 = −1
18. Write a program to solve a system of linear equations by using Gauss Seidel method.
Determine the largest Eigen value and corresponding Eigen vector for the matrix using power method correct
up to 3-decimal places.
3 1 1 2 −1 0 25 1 2
1. [1 4 2] 2. [−1 2 −1] 3. [ 1 3 0]
1 2 5 0 −1 2 2 0 4
(****)
1 4 4 5 0 1 1 −3 2
4. [4 1 8] 5. [0 −2 0] 6. [4 4 −1]
4 8 1 1 0 5 6 3 5
1 3 −1 15 −4 −3 4 6 0
7. [ 3 2 4 ] 8. [−10 12 −6] 9. [0 5 3]
−1 4 10 −20 4 −2 2 0 3
(**) (**)
3 1 4 1 2 0
10. [1 2 3] 11. [2 1 0 ]
4 3 5 0 0 −1
KEY POINTS
𝒅𝒚
• Euler’s Method (RK-1): 𝒅𝒙 = 𝒇(𝒙, 𝒚) ⇒ 𝒚𝟏 = 𝒚𝟎 + 𝒉 × 𝒇(𝒙𝟎 , 𝒚𝟎 )
𝒅𝒚 𝒉
• Modified Euler Method: 𝒅𝒙 = 𝒇(𝒙, 𝒚) ⇒ 𝒚𝟏 = 𝒚𝟎 + 𝟐 × [𝒇(𝒙𝟎 , 𝒚𝟎 ) + 𝒇(𝒙𝟏 , 𝒚𝟏 )]
• RK-2 Method • RK-4 Method
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 )
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 )
𝑘2 = ℎ𝑓(𝑥0 + ℎ/2, 𝑦0 + 𝑘1 /2)
𝑘2 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘1 )
1 𝑘3 = ℎ𝑓(𝑥0 + ℎ/2, 𝑦0 + 𝑘2 /2)
∴ 𝑦1 = 𝑦0 + [𝑘1 + 𝑘2 ] 𝑘4 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘3 )
2
1
∴ 𝑦1 = 𝑦0 + [𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ]
6
• For higher order differential equations, convert into a system of simultaneous first order differential
equations and use any suitable method.
• For boundary value problem, convert into an initial value problem using shooting method and solve
𝑚2 −𝑚0 𝑚1 −𝑚0
by any suitable method. 𝑦(1)−𝑦(𝑚 = 𝑦(𝑚 ; 1)−𝑦(𝑚
; 1)
0 1 0 ; 1)
1. Use Picard’s method to approximate the value of y when x = 0.1, x = 0.2, and x = 0.4, given that y = 1
at x = 0 and 𝑑𝑦/𝑑𝑥 = 1 + 𝑥𝑦 correct to three decimal places (Use up to second approximations).
𝑑𝑦
2. Using Euler’s method, solve 𝑑𝑥 = 𝑦 + sin 𝑥, with 𝑦(0) = 1 in the interval 0 ≤ 𝑥 ≤ 1. Take ℎ = 0.2.
3. Using the Euler’s (RK 1st order method) find an approximate value of y corresponding to x=1, given
that 𝑑𝑦/𝑑𝑥 = 𝑥 + 𝑦 and y = 1. When x =0, h =0.1.
4. Use Runge-Kutta of order second to find the solution of the given differential equation at x=1.5 taking
a step size of h=0.25.
𝑑𝑦
+ 2𝑦 = 𝑥 2 , 𝑦(1) = 5
𝑑𝑥
𝑑𝑦 2𝑥𝑦+𝑒 𝑥
5. Using the RK method of fourth order, solve for y at x = 1.2, 1.4 from 𝑑𝑥 = 𝑥 2 +𝑥𝑒 𝑥 given 𝑥0 = 1, 𝑦0 = 0.
6. Using Runge-Kutta method of second order (RK-2), obtain a solution of the equation 𝑦 ′′ = 𝑦 + 𝑥𝑦′ with
initial condition 𝑦(0) = 1, 𝑦’(0) = 0 to find 𝑦(0.2) and 𝑦’(0.2), taking h = 0.1
7. Apply RK-4 method to solve 𝑦(0.2) for the given equation.
𝑑2𝑦 𝑑𝑦 𝑑𝑦
2
+𝑥 − 𝑦 = 0 𝑔𝑖𝑣𝑒𝑛 𝑡ℎ𝑎𝑡 𝑦 = 1 𝑎𝑛𝑑 = 0 𝑤ℎ𝑒𝑛 𝑥 = 0.
𝑑𝑥 𝑑𝑥 𝑑𝑥
8. Solve the Boundary Value Problem (BVP) using Shooting method by dividing into four sub-interval
employing Euler’s method.
𝑦 ′′ + 2𝑦 ′ − 𝑦 = 𝑥
Subject to boundary condition 𝑦(1) = 2 and 𝑦(2) = 4
1. Using Runge-Kutta second order method, solve the differential equation 𝑦 ′′ = 𝑥𝑦 ′ − 𝑦; 𝑦(0) = 3,
𝑦 ′ (0) = 0 𝑓𝑜𝑟 𝑥 = 0, 0.2, 0.4
𝑑2 𝑦 𝑑𝑦
2. Using RK-4 method, solve the equation for 𝑦(0.2). Given + 2𝑥 𝑑𝑥 − 3𝑦 = 6𝑥 with 𝑦(0) =
𝑑𝑥 2
0, 𝑦 ′ (0) = 1, ℎ = 0.1
3. Solve the given differential equation by RK-4th order method 𝑦 ′′ − 𝑥 2 𝑦 ′ − 2𝑥𝑦 = 0 with initial
condition 𝑦(0) = 1, 𝑦 ′ (0) = 0, for y(0.1) taking h = 0.1
𝑑2 𝑦 𝑑𝑦 𝑑𝑦
4. Use RK-4 method to find y(0.2) for 𝑑𝑥 2 = 𝑥 𝑑𝑥 − 𝑦 given that y=1 and 𝑑𝑥 = 0 when x=0.
𝑑2 𝑦 𝑑𝑦 𝑑𝑦
5. Apply RK-4 method to solve y(0.2) for the given equation 𝑑𝑥 2 + 𝑥 𝑑𝑥 − 𝑦 = 0 given that y=1 and 𝑑𝑥 =
0 when x=0. (Assume h=0.2)
6. Solve the given differential equation by RK-4th order method 𝑦 ′′ − 𝑥𝑦 ′ + 𝑦 = 0 with initial condition
𝑦(0) = 3, 𝑦 ′ (0) = 0 𝑓𝑜𝑟 𝑦(0.2) taking h = 0.2
𝑑2 𝑦
7. Solve the following differential equation within 0 ≤ 𝑥 ≤ 0.5 using RK 4th order method. 10 𝑑𝑥 2 +
𝑑𝑦
2 𝑑𝑥 − 4𝑦 = 5, 𝑦(0) = 0, 𝑦 ′ (0) = 0. Take h=0.25
𝑑2 𝑦
8. Solve the following differential equation within 0 ≤ 𝑥 ≤ 0.5 using RK 4th order method. 20 𝑑𝑥 2 +
𝑑𝑦
2 𝑑𝑥 − 4𝑦 = 5, 𝑦(0) = 0, 𝑦 ′ (0) = 0. Take h=0.25
9. Solve the boundary value problem 𝑦 ′′ (𝑥) = 𝑦(𝑥), 𝑦(0) = 0 𝑎𝑛𝑑 𝑦(1) = 1.1752 by shooting method,
taking 𝑚0 = 0.8 and 𝑚1 = 0.9
10. Give the boundary value problem: 𝑦 ′′ = 6𝑥 with y(1)=2 and y(2)=9. Solve it in the interval (1,2) by
using RK method of second order (take h=0.5 and guess value=3.25)
11. How can the shooting method be used to solve boundary value problems. Explain each step of the
algorithm with a suitable example.
KEY POINTS
• Laplace Equation: 𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 0
Poisson Equation: 𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 𝑓(𝑥, 𝑦)
Heat Conduction: 𝑢𝑥𝑥 − 𝑢𝑡 = 0
• Finite Difference Approximations to Derivatives:
𝜕𝑢 𝑢𝑖+1,𝑗 − 𝑢𝑖−1,𝑗 𝜕𝑢 𝑢𝑖,𝑗+1 − 𝑢𝑖,𝑗−1
𝑢𝑥 = = , 𝑢𝑦 = =
𝜕𝑥 2ℎ 𝜕𝑦 2𝑘
2 2
𝜕 𝑢 𝑢𝑖−1,𝑗 − 2𝑢𝑖,𝑗 + 𝑢𝑖+1,𝑗 𝜕 𝑢 𝑢𝑖,𝑗−1 − 2𝑢𝑖,𝑗 + 𝑢𝑖,𝑗+1
𝑢𝑥𝑥 = 2 = 2
, 𝑢𝑦𝑦 = 2 =
𝜕𝑥 ℎ 𝜕𝑦 ℎ2
1. Given the Poisson’s equation: ∇2 𝑢 = −10(𝑥 2 + 𝑦 2 + 5) over the square domain such that 0 ≤ 𝑥 ≤ 3
and 0 ≤ 𝑦 ≤ 3 with Dirichlet boundary condition of 𝑢(𝑥, 𝑦) = 0. Calculate the steady state
temperatures at interior points by using Gauss-Seidel method upto 5th iteration. Assume ℎ = 𝑘 = 1.
2. Torsion on a square bar of size 9cm*9cm subjected to twisting is governed by: ∇2 𝑢 = −4, with Dirichlet
boundary condition of 𝑢(𝑥, 𝑦) = 0 and ℎ = 1. Calculate the steady state temperatures at interior points.
Assume a grid size of 3cm*3cm. Iterate until the minimum difference at any point is correct up to two
decimal places by applying Gauss-Seidel method.
3. Determine the steady-state heat distribution in a thin square metal plate with dimensions 0.5 m by 0.5
m using 𝑛 = 𝑚 = 4. Two adjacent boundaries are held at 00C, and the heat on the other boundaries
increases linearly from 00C at one corner to 1000C where the sides meet.
4. Solve the parabolic equation 2𝑓𝑥𝑥 (𝑥, 𝑡) = 𝑓𝑡 (𝑥, 𝑡) 0 ≤ 𝑡 ≤ 1.5 and given initial condition 𝑓(𝑥, 0) =
50(4 − 𝑥), 0 ≤ 𝑥 ≤ 4 with boundary condition 𝑓(0, 𝑡) = 0 = 𝑓(4, 𝑡) 0 ≤ 𝑡 ≤ 1.5