0% found this document useful (0 votes)
1 views26 pages

Numerical Methods Tutorial

The document outlines various numerical methods for finding roots of equations, including the Bisection Method, Regula-Falsi Method, Secant Method, Newton-Raphson Method, and Fixed Point Iteration Method. It provides examples and exercises for applying these methods to specific equations and discusses interpolation techniques such as Newton forward and backward interpolation, Lagrange interpolation, and spline interpolation. Additionally, it covers the Least Square Method for fitting curves to data.

Uploaded by

Ramesh Khanal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views26 pages

Numerical Methods Tutorial

The document outlines various numerical methods for finding roots of equations, including the Bisection Method, Regula-Falsi Method, Secant Method, Newton-Raphson Method, and Fixed Point Iteration Method. It provides examples and exercises for applying these methods to specific equations and discusses interpolation techniques such as Newton forward and backward interpolation, Lagrange interpolation, and spline interpolation. Additionally, it covers the Least Square Method for fitting curves to data.

Uploaded by

Ramesh Khanal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CHAPTER

KEY POINTS
• Bisection Method: � = 2 where �(�) < 0 ��� � (�) > 0
�+�

• Regula-Falsi Method: � = � − �(�) where �(�) <


�−�

0 ��� � (� ) > 0
�� (�)
−��(�)
𝑥𝑖−𝑥𝑖
• Secant Method: ���+1 = −1 �(��� )

�𝑖
−𝑓
�� (𝑥 )𝑥 ( ��−1 )

• Newton-Raphson Method: ���+1 = �


𝑓(𝑥𝑖)
��

𝑖
�� )

�� (𝑥

• Fixed Point Iteration Method: �(�) = 0 ⇒ ���+1 = ��(��� ) where |�� ′ (�)| < 1

1. Using the bisection method, find an approximate root of the equation, � 3 + 2� 2 + 3� + 4 = 0


BRACKETING METHODS (CLOSE END)

2. Find where the graph of � = 1.2 sin �and � = � ln(�) intersect using bisection method. Get
correct up to four decimal places.

the

3. Find the root of the equation �(�) = � 3 − 4� − 9 correct to three decimal places using False Position
intersection value correct to four decimal places.

4. Find the positive real root of the equation � 𝑥 sin � − 1 = 0 using False position method, correct
Method.

to four significant digits.

5. Find the root of the equation �� 𝑥 = cos � using the secant method correct up to four decimal places.
NON-BRACKETING METHOD (OPEN END)

6. Solve � 3 + � 2 − 3� − 3 = 0 by secant method up to 8th iteration. Assume that the error should
be less than 10−4.
7. The current 𝑖 in an electric circuit is given by 𝑖 = 10� −𝑥 sin 2𝜋� where � is in seconds. Using N-R
method, find the value of x correct up to three decimal places for 𝑖 = 2 ����.
8. Find the root of the equation � − 1.5 sin � − 2.5 = 0 using Newton Raphson’s Method so that relative
error is less than 0.01%.
9. Find the square root of 11 using Newton Raphson method and fixed point iteration method correct up

10. Find a root of the equation: 2� − log � = 7, correct to 4 decimal places by using fixed point
to four decimal digit.

iteration method.

Nepal Engineering Numerical


ASSIGNMENT
1A

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

5. Using the bisection method, find an approximate root of the equation sin � = 1/�, that lies
intersection value correct to four decimal places.

6. Find the root of the equation �(�) = � 2 − 4� − 10 correct to three decimal places using False Position
between x=1 and x=1.5 (in radians). Carry out computations up to 7th stage.

7. Find the positive real root of the equation cos � + � 𝑥 + � 2 = 3 using False position method,
Method.

correct to three decimal places.

of � cos 𝑥 − sin � − 1 = 0 correct to four decimal places using False position method.
8. Discuss the application of Numerical methods in the field of science and engineering. Find a real root

9. Find a positive root of the equation � sin � − 1 = 0 using any closed end method up to four

10. What is the fixed point of a non-linear equation? Find a real root of the equation: �� 𝑥 = 3 by using any
decimal places.

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

12. The equation: 𝛼 tan 𝛼 = 1 occurs in theory of vibrations.


Bracketing method.

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

13. The flux equation of an iron core electric circuit is given by: �(��) = 10 − 2.1𝜙 − 0.01�� 3 . The
decimal places.

state value of flux is obtained by solving the equation, �(��) = 0. By using any close-end
steady

method, estimate the steady state value of "��" correct to three decimal places.

Nepal Engineering Numerical


ASSIGNMENT
1B

of the equation 3𝑥 + sin 𝑥 − � 𝑥 = 0 correct up to three decimal places.


1. Write a difference between secant method and false position method. Using secant method find a root

2. Using Secant method, find the zero of the function � (��) = 2𝑥 − log10 𝑥 − 7 correct up to

3. Solve �(��) = ��� 𝑥 − 1 by secant method for tolerance value 0.0001.


three decimal places.

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.

7. Obtain a real root of the equation: sin 𝑥 + 1 = 2𝑥 by using secant method such that the real root
6. Write an algorithm to find a real root of a non-linear equation using secant method.

8. Define root with example. Determine the root of � 𝑥 = �� 3 + cos(25��) using secant method correct
must have relative error less than 0.0001.

to

9. Estimate the root of the equation �(��) = ��� 𝑥 − cos 𝑥 using Newton Raphson Method
four decimal places.

correct to three decimal places.


10. What is the difference between Bisection Method and False Position Method even though both are

using Newton Raphson Method. ��� 𝑥 = sin 𝑥


bracketing methods? Find the real root of the given non-linear equation correct to three decimal places

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-

13. Discuss the drawbacks of Newton-Raphson method. Find the real root of the equation𝑥 sin 𝑥 − cos 𝑥 =
method correct to at least four decimal places.

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

17. Find the root of the equation3𝑥 = cos(��) + 1 using NR method with the tolerance of 10E-5.
by using this formula correct to four significant digits.

the equation ��� 𝑥 = 2.


18. What are the limitations of Newton-Raphson method? Using Newton-Raphson method find a root of

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

21. Find a real root of the equation cos 𝑥 = 3𝑥 − 1, correct to three decimal places, using fixed
four decimal digit.

22. Find a root of 3𝑥 + sin 𝑥 − � 𝑥 = 0 using


point method.

i. One of the bracketing methods and


ii. One of the non-bracketing methods

Nepal Engineering Numerical


CHAPTER 2
INTERPOLATION AND APPROXIMATION
KEY POINTS

𝑝(𝑝 𝑝 ( 𝑝 − 1) (
• Newton forward interpolation:

�(�0 + 𝑝ℎ) = �0 + − 1) 2 �0 𝑝 − 2) �0 + ⋯
��∆�0 + ∆ + ∆3
2! 3!

𝑝(𝑝 + 𝑝 ( 𝑝 + 1) ( 𝑝 �𝑛 + ⋯
• Newton backward interpolation:

�(�𝑛 + 𝑝ℎ) = �𝑛 +
1) �𝑛 + 2)
��∇�𝑛 + ∇ +
2
∇3
2! 3!

( � − �1 ) ( � − �2 ( � − �0 ) ( � − �2 ) … ( � − �𝑛 )
• Lagrange interpolation:

) … ( � − �𝑛 )
� (� ) = � + � +⋯
− ) − )… − ) 0 − ) − )… − ) 1
�1 (�0 �2 (�0 �𝑛 (�1 �0 (�1 �2 (�1 �𝑛
0
(�

�(�) = �0 + (� − �0 )[�0 , �1 ] + (� − �0 )(� − �1 )[�0 , �1 , �2 ] + ⋯


• Newton divided difference:

6
• Spline interpolation:
����−1 + 4��𝑖 + ����+1 = 2 (���−1 − 2�𝑖 + ���+1 ), ��0 =

0, ��𝑛 = 0
( �𝑖 + 1 (� − ( �𝑖 + 1 ℎ (� − ℎ
��(�) = − � ) 3 ��𝑖 � ) 3 ��� − � ) (�𝑖 2 ��� � ) (��� 2 ����+1 )
𝑖 𝑖
+ + − 6 )+ +1 − 6
6ℎ 6ℎ �+1 ℎ � ℎ

To fit curve � = � + �� to given points,


• Least Square Method:

Solve ∑ � = 𝑛� + � ∑ � ���𝑑 ∑ �� = � ∑ � + � ∑ � 2
(�� ) � = ��𝟐 + �/� ⇒ �� = �� 3 +
for unknowns and b.

� ⇒ � = �� + �
(𝑖�� ) � = ��� ⇒ 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 19
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—
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 19
Populations (000) 12 15 20 27 39 52

Nepal Engineering Numerical


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 ½.

Nepal Engineering Numerical


6. Use Newton’s divided difference formula to find f(3) from the following data:
x: 0 1 2 4 5 6
f (x): 1 14 15 5 6 1
7. Find the cubic spline interpolation formula for the following data:
x 1 2 3 4 5
f (x) 1 0 1 0 1

LEAST SQUARE METHOD


8. By using the least square method, find the straight line that best fits the following data:
x: 1 2 3 4 5

9. The pressure and volume of a gas are related by the equation ���� = ��, 𝛾 and C being
y: 14 27 40 55 68
𝛾

constants. Fit
this equation to the following set of observations. (***)
P (kg/cm2) 0.5 1.0 1.5 2.0 2.5 3.0
V (litres) 1.62 1.00 0.75 0.62 0.52 0.4

Nepal Engineering Numerical


ASSIGNMENT
2A

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—
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—
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
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

Nepal Engineering Numerical


ASSIGNMENT
2B

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 1

If the relationship between voltage v and time t is of the form 𝑣 = ��� . Using least-
Voltage v 150 63 28 12 5.6 1
𝑘��

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

Find a curve of the form: ���� = 𝛽 by using least square method.


P 10 20 50 100 150
𝛼

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

If the relationship between bacteria N and time t is of the form 𝑁 = ��


Bacteria (N) 32 47 65 92 132 1
��
. Use least-square approximation
estimate the N at t = 5 hr.

Nepal Engineering Numerical


CHAPTER 3
NUMERICAL DIFFERENTIATION AND INTEGRATION
KEY POINTS
• Differentiation: � = �0 + �ℎ and � = �0 +
𝑝 ( 𝑝 − 1) 𝑝 ( 𝑝 − 1) (𝑝 −
�0 �0 + ⋯
�∆�0 +
2)
∆22! + ∆3!
3

1 2� − 2 3�2 − 6� 3 4� − 18�2 + 3

�� �� = ℎ [∆�0 1 ∆ �0 + 2 ∆ �0 22� − 6 ∆4 �0 + ⋯ ]
��
= +
��
�� �� 2 + 6 + 24
�2� 3 12�2 − 36� + 224
1
= 2 ( ) �0 + (� − �0 ∆ �0 + ⋯ ]
� �� ��

�� 2 1) ∆ + 24
= 2 [∆
�� ��
�� ℎ
Similarly, for Backward Interpolation.
• Trapezoidal Rule:
𝑥𝑛
ℎ [(
∫ � �0 + ��� ) + 2(�1 + �2 + ⋯ + ���−1 )]
2
�� =
• Simpson’s 1/3 Rule: 𝑥0
𝑥𝑛


∫ � �� = [(�0 + ��� ) + 2(�2 + �4 + ⋯ + ���−2 ) + 4(�1 + �3 + ⋯ +
3
𝑥0 ���−1 )]
• Simpson’s 3/8 Rule:
𝑥𝑛
3ℎ
∫ � [(�0 + ��� ) + 2(�3 + �6 + ⋯ + ���−3 ) + 3(�1 + �2 + �4 + �5 + ⋯ +
8
�� = ���−2 + ���−1 )]
𝑥0

ℎ 4��2
• Romberg Integration:
�𝑖���, ��1 (ℎ), ��2 (ℎ/2)

�ℎ�� ��3 (ℎ, ) =
2 ��1
3
• Gaussian Integration: ∫ �(�) �� = )+𝑊 )+⋯
1

−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 =
9 9
√0.6

(� − (� +
��� 𝐼 = ∫ �(�)�� , �)

�)
��������� ����ℎ � = �+
2 2

NUMERICAL DIFFERENTIATION

Nepal Engineering Numerical


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.

Nepal Engineering Numerical


3. Fit cubic polynomial equations to the given data set and find the value of f (3.7) and f’ (7.5).
x 2 4 7 9
f (x) 1 2 1 2

NUMERICAL INTEGRATION
4. Evaluate ∫
2 𝑥
−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
�� �� +
∫ 0
s in 𝑥
6. Use Romberg’s method, to compute �� 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

3. Evaluate the integral 𝐼 = 0∫ exp ( ) �� using Gauss quadrature formula with n = 2 and n =
10
1+�� 2
8.

9. Evaluate ∫51
𝑥
�� by using Gaussian integration formula for n = 3 and compare the value with exact
solution.

Nepal Engineering Numerical


ASSIGNMENT 3A
NUMERICAL DIFFERENTIATION AND INTEGRATION

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 for x = 1.2.
�� 2
��

x 1.0 1.2 1.4 1.6 1.8


y 2.7183 3.3201 4.0552 4.9530 6.049
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.
𝜋
s in 𝑢
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
y 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094
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.
sin 𝑥 ���.
𝜋


2
Take n = 6. 0

10. Evaluate the integral 𝐼 = ∫ 2 (1 + 3 cos 2��) ���. Compare the result in both conditions for Simpson
𝜋

0
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

Nepal Engineering Numerical



2 �𝑥
1 �𝑥 (Assume n = 4)
0.6


2
0
12. Evaluate the integral � � using Simpson’s 1/3 rule and Simpson’s 3/8 rule, dividing the
interval into six parts.
𝜋
13. Evaluate the integral ∫ 2 sin 𝑥 �𝑥 for n = 6 and compare the result in both conditions for Simpson’s 1/3
0

14. Evaluate the integral ∫ (1 + 3 cos2


and 3/8 rule.
��

�� ) �𝑥 by i.
0
Trapezoidal rule.
ii. Simpson’s 3/8 rule, taking number of intervals (n) = 6.

Nepal Engineering Numerical


ASSIGNMENT 3B
NUMERICAL DIFFERENTIATION AND INTEGRATION

1. Integrate the given integral using Romberg integration.


2
1
∫ �𝑥
1+
�� 3
2. Apply Romberg’s method to evaluate 1

𝜋
2
cos
𝑥

�𝑥
√1 + sin
𝑥
0
3𝜋
3. Use Romberg’s integration to evaluate ∫ 2
� 𝑥 sin 𝑥 �𝑥 correct to two decimal places.
0
4. Use Romberg’s integration to evaluate ∫5.2
4
log 𝑥 �𝑥 correct to two decimal places.
5. Using three-point Gaussian Quadrature formula, evaluate
1

𝑥


1+
𝑥
0
∫20 𝑥 + �𝑥 by using Gaussian Integration formula for n = 2, n = 3 and compute their
2

1+(��+1)4
6. Evaluate
values with exact solution.
𝜋
�𝑥 using Gauss quadrature formula for n = 2 and n = 3.
cos 𝑥
7. Integrate the given integral 0∫2
√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
�𝑥

Nepal Engineering Numerical


CHAPTER
4

KEY POINTS
• Gauss Elimination Method: Convert coefficient matrix into Upper-Triangular matrix and use back

• LU Factorization or Decomposition Method: �𝑿 = � ⇒ (𝑳𝑼)𝑿 = �


substitution

1 ��12 0
Dolittle Algorithm Crout Algorithm Cholesky Algorithm
1 0 ��11
0 0 0 0
��11 � � � �
��12 ��13
𝐴 = [𝑙21 𝑙22 0 ] [0 1 𝑢23 ] 𝐴 = [�
��13
0 𝑢23 ]
� = [0𝑙]21[0
𝐴 1
� 0�] ][
��22

𝑙31 𝑙32 𝑙31 𝑙32 0 0 0 0


0 0
𝑙33 1
� � �
1 𝑢33

• Iterative Method: 2� + � + � = 5, 3� + 5� + 2� = 15, 2� + � + 4� = 8


Cholesky algorithm is applicable only for a symmetric matrix A.

⇒ � = 2.5 − 0.5� − 0.5�, � = 3 − 0.6� − 0.4�,


= 2 − 0.5� − 0.25�

• Power Method: �𝑿 = 𝝀𝑿
Gauss-Jacobi uses same value for the whole iteration while Gauss-Seidel uses most recent value.

Put initial approximation 𝑋 = [1 1 1]𝑇 in 𝐴�� and factor out the largest value.

1. Solve the following system of equations by applying Gauss Elimination Method (GEM) with partial

2� + 2� + � = 6, 4� + 2� + 3� = 4,
pivoting technique. And, also determine the determinant value.

�−�+�=0
2. Solve the following system of equations using Gauss elimination method. (Use Partial pivoting if

6�1 − 2�2 + �3 = 4, −2�1 + 7�2 + 2�3 = 5,


necessary)
�1
+ 2�2 − 5�3 = −1

3� + 2� + 7� = 32, 2� + 3� + � = 40,
3. Solve the following set of equations by using LU decomposition method.

3� + 4� + � = 56

3� + 2� + � = 10, 2� + 3� + 2� = 14,
4. Using Dolittle LU decomposition method, solve the following system of equations: (***)

� + 2� + 3� = 14

3� + 2� + � = 10, 2� + 3� + 2� = 14,
5. Solve the following set of equations by using LU Crout method.

� + 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.

20� + � − 2� = 17, 3� + 20� − � = −19, 2�


7. Solve the equations by Gauss-Jacobi method:

− 3� + 20� = 25
8. Use Gauss-Seidel iteration method to solve

Nepal Engineering Numerical


CHAPTER

2� + � + � = 5, 3� + 5� + 2� = 15,
4

2� + � + 4� = 8

2 −1 0
9. Find the largest eigenvalue and the corresponding eigen vector correct up to three decimal places using

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

Nepal Engineering Numerical


ASSIGNMENT
4A

4�1 + 5�2 − 6�3 = 28, 2�1 − 7�3 = 29, −5�1 − 8�2 = −64
1. Use Gauss Elimination method to solve the equations. Use partial pivoting method where necessary.

2. Solve the following system of equations by the process of Gauss elimination (Use partial pivoting if

3� + 2� = � = 10, 2� + 3� + 2� = 14,
necessary)

� + 2� + 3� = 14
3. What is a pivotal element? Solve the following system of linear equations by using Gauss-elimination

� + � + � + � = 2, �+�+
method with partial pivoting technique.

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

5. Apply the factorization method to solve the equation 3� + 2� + 7� = 4; 2� + 3� + � = 5;


Gauss elimination method.

3� +
4� + � = 7

3�1 + 2�2 + �3 = 10, 2�1 + 3�2 + 2�3 = 14,


6. Obtain the solution of the following system using the Dolittle LU decomposition method. (***)
�1
+ 2�2 + 3�3 = 14

� + � + � = 4, � + 4� + 3� = 0,
7. Solve the following system of equations using Crout method.

� + 6� + 2� = 6

2� + 3� + � = 9, � + 2� + 3� = 6,
8. Solve the following system of equations using Factorization method.

3� + � + 2� = 8

5� − 2� + � = 4, 7� + � − 5� = 8,
9. Solve the following set of equations using LU factorization method:

3� + 7� + 4� = 10

2� − 3� + 10� = 3, −� + 4� + 2� = 20,
10. Solve the following system of equations by using Crout’s algorithm.

5� + 2� + � = −12

3� + 2� + � = 10, 2� + 3� + 2� = 14,
11. Solve the following set of equations using Cholesky method.

� + 2� + 3� = 14

10�1 + 6�2 − 5�3 = 27, 3�1 + 8�2 + 10�3 = 27, 4�1


12. Using Gauss Jacobi method, solve the following system of linear equations:

+ 10�2 + 3�3 = 27

40� − 20� − 10� = 390, 10� − 60� + 20� = −280, 10� −


13. Use Gauss-Seidel iterative method to solve given equations.

30� + 120� = −860

� + 3� + 2� = 19, 3� + 2�
14. Solve the following using Gauss Seidel method.

+ 2� = 20,
Nepal Engineering Numerical
ASSIGNMENT

� + 4� + 2� = 17, −2� + 2�
4A

+�+� =9

10� − 5� − 2� = 3, � + 6� − 10� = −3, 4�


15. Solve the following system of equations by using Gauss Seidel Method:

− 10� + 3� = −3

27� + 6� − � = 85, � + � + 54� = 110, 6�


16. Solve the following equations by Gauss-Seidel Method:

+ 15� + 2� = 72

6�1 − 2�2 + �3
17. Find the solution of the given simultaneous linear equation using Gauss Seidel method.

= 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.

Nepal Engineering Numerical


ASSIGNMENT
4B

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
[1 4 2] 2. [−1 2 −1] 3. [ 1 3
1 2 5 0 −1 2 2 0
1.

1 4 4 5 0 1 1
(****)

[4 1 8] 5. [0 −2 0] 6. [4
4 8 1 1 0 5 6
4.

1 3 −1 15 −4 −3 4
[ 3 2 4 ] 8. [−10 12 −6] 9. [
− 1 4 10 −20 4 −2 2
7.

3 1 4 1 2 0
(**) (**)

10. [1 2 3] 11. [2 1 0 ]
4 3 5 0 0 −1

Nepal Engineering Numerical


CHAPTER
5
KEY POINTS
= ��(�, =
𝒅�
+𝒉× , �� )
�) ⇒ � �� ��(��
• Euler’s Method (RK-1):

𝒅�

= ��(�, = + × , )+ , �� )]
𝒅� 𝒉 �

�) ⇒ � �� [��(� � ��(�
• Modified Euler Method:

𝒅� �
� �

��1 = ℎ� (�0 , �0 )
• RK-2 Method • RK-4 Method
��1 = ℎ� (�0 , �0 )
𝑘2 = ℎ� (�0 + ℎ, �0 𝑘2 = ℎ� (�0 + ℎ/2, �0 + ��1 /2)
+ ��1 ) 𝑘3 = ℎ� (�0 + ℎ/2, �0 + 𝑘2 /2)
1 𝑘4 = ℎ� (�0 + ℎ, �0 + 𝑘3 )
∴ �1 = �0 + [��1 1
2 ∴ �1 = �0 + [��1 + 2𝑘2 + 2𝑘3 + 𝑘4 ]
+ 𝑘2 ] 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
� (1)−�(�� 0 ; 1) �(��1 ; 1)−�(��0 ; 1)
by any suitable method.

at x = 0 and ��/�� = 1 + �� correct to three decimal places (Use up to second


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

approximations).
= � + sin �, with �(0) = 1 in the interval 0 ≤ � ≤ 1. Take ℎ =
��

0.2.
2. Using Euler’s method, solve


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�� +�
= 1, = 0.
�� 𝑥
5. Using the RK method of fourth order, solve for y at x = 1.2, 1.4 from
given � � 2 +�� 𝑥
� 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�
+� − � = 0 �𝑖��𝑛 ��ℎ𝑎�� � = 1 𝑎��� =0
�� ��
2
�ℎ��� � = 0.
�� �� ��

8. Solve the Boundary Value Problem (BVP) using Shooting method by dividing into four sub-interval
Nepal Engineering Numerical
CHAPTER
5

� ′′ + 2� ′ −
employing Euler’s method.

�=�
Subject to boundary condition �(1) = 2 and �(2) = 4

Nepal Engineering Numerical


ASSIGNMENT
5A

1. Using Euler’s method solve the given differential equation (**)


�2�
+ 2 − 3� = 6, �(0) = 0, � (0) = 1 �����ℎ ℎ = 0.2
��
�� 2
���𝑟��(0.4) =?
��

= ; �(1) = 0. Solve for y at x=1.04, by using Euler’s method (take h=0.01)


�� 2� + �
� 2 +�� 𝑥
2. Given: ��
3. Apply Euler’s method to approximate value of y(0.3) for the differential equation:

= � + �,
� ( 0) = 1

4. Using the RK 1 order method, find an approximate value of y corresponding to x = 1, given that�� =

st ��

�−�
�+�
and y = 1 when x = 0 and h = 0.02.
5. Write a program in any higher level language for solution of ordinary differential equation using Euler’s

6. Solve the differential equation � ′ = � + sin � using RK-2 method within 0 ≤ � ≤ 0.2
method.

7. Solve the differential equation � ′ = � + � using RK-2 method within 0 ≤ � ≤ 0.2 with initial
with initial condition y(0) = 2 and step size h = 0.1

condition
y(0) = 1 and step size h = 0.1
8. Use the Runge-Kutta 4th order method to solve 10 = � 2 + � 2 , �(0) = 1 for the interval 0 ≤ �
��

≤ 0.4 �

9. Solve: � ′ = � + � � , y(0) = 0 for y(0.2) and y(0.4) by RK-4th order method.


with h = 0.1

10. Apply Runge-Kutta fourth order method to find an approximate value of y when x = 0.3 given that: � ′ =
2.5� + � 0.3� ; with an initial y(0) = 1, taking h = 0.3
11. Solve the differential equation � ′ = � − using appropriate method within 0 ≤ � ≤ 0.2 with
2�

initial
condition �(0) = 1 and step size h=0.1

Nepal Engineering Numerical


ASSIGNMENT
5B

1. Using Runge-Kutta second order method, solve the differential equation � ′′ = �� ′ − �; �(0) =
3,
� ′ (0) = 0 𝑓�𝑟 � = 0, 0.2, 0.4
2. Using RK-4 method, solve the equation for �(0.2). Given + 2� − 3� = 6� with
2 𝑑 𝑑�

� ( 0) =

𝑑�
0, � (0) = 1, ℎ =
′ �2
��

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
=𝑑 � − � given that 𝑑� = 0 when x=0.
𝑑2 � 𝑑� 𝑑�
��� 2
4. Use RK-4 method to find y(0.2) for y=1 and
2
𝑑 𝑑� 𝑑�
+� − � = 0 given that y=1 and

=

5. Apply RK-4 method to solve y(0.2) for the given equation
𝑑 𝑑�
0 when x=0. (Assume h=0.2) �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
7. Solve the following differential equation within 0 ≤ � ≤ 0.5 using RK 4th order method. 10 +
2 𝑑 �
��� 2
2 𝑑� − 4� = 5, �(0) = 0, � ′ (0) = 0. Take h=0.25
𝑑�

8. Solve the following differential equation within 0 ≤ � ≤ 0.5 using RK 4th order method. 20 +
2 𝑑 �
��� 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

taking �0 = 0.8 and �1 = 0.9


method,

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.

Nepal Engineering Numerical


CHAPTER
6

• Laplace Equation: ��� + ��� = 0


KEY POINTS

Poisson Equation: ��� + ��� = ��(�, �)


Heat Conduction: ��� − �𝑡 = 0

𝜕� ��+1,� − � ��,�+1 − ��,�−1


• Finite Difference Approximations to Derivatives:

��−1,� �
�� = = , �� =
𝜕� = 2𝑘

2ℎ

��−1,� − 2��,� ��,�−1 − 2��,� + ��,�+1


���
�� 2 �
+ ��+1,� 2


��� = , ��� = =
ℎ2 ℎ2

��� 2
=
��� 2

𝟏 𝟏
• Standard 5-point formula • Diagonal 5-point formula
���,� = [���+��,� + ���−��,� + ���,�+𝟏 + ���,�−�� ]
𝟒
���,� = [���−��,�−𝟏 + ���+��,�+𝟏 + ���−��,�+𝟏
𝟒
+ ���+,�−�� ]

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.

iteration. Assume ℎ = 𝑘 = 1.
Calculate the steady state temperatures at interior points by using Gauss-Seidel method upto 5th

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.

m using � = � = 4. Two adjacent boundaries are held at 00C, and the heat on the other
3. Determine the steady-state heat distribution in a thin square metal plate with dimensions 0.5 m by 0.5

boundaries increases linearly from 00C at one corner to 1000C where the sides meet.
Nepal Engineering Numerical
CHAPTER

4. Solve the parabolic equation 2𝑓�� (�, �) = 𝑓𝑡 (�, �) 0 ≤ � ≤ 1.5 and given initial condition
6

��(�, 0) =
50(4 − �), 0 ≤ � ≤ 4 with boundary condition ��(0, �) = 0 =
��(4, �) 0 ≤ � ≤ 1.5

Nepal Engineering Numerical


ASSIGNMENT
6

2. Solve the elliptic equation ���� + ���� = 0 over a square mesh of side four units satisfying
1. What is boundary value problem? Derive Laplace five-point formula.

�(0, �) = 0 𝑓�𝑟 0 ≤ � ≤ 4, �(4, �) = 12 +


� 𝑓�𝑟 0 ≤ � ≤ 4; �(�, 0) =
the following boundary conditions;

3� 𝑓�𝑟 0 ≤ � ≤ 4, �(�, 4) = � 2 𝑓�𝑟 0 ≤ � ≤ 4


3. Solve the Poisson equation ∇2 𝑓 = 2� 2 + �, over the square domain 1 ≤ � ≤ 4, 1 ≤ � ≤
4, with f=0 on the boundary. Take step size in x and y, h=k=1. (**)
4. In a square bar with dimension of 3 𝑖��ℎ × 3 𝑖��ℎ, torsion function 𝜙 can be obtained from the
𝜕 𝜙 2𝜕 𝜙
+ 2 = −2 where 𝜙 = 0 on the outer boundary of the bar’s cross-section.
2

��� 2
following PDE:
Subdivide the region into nine equal squares to form a mesh and find the values of 𝜙 in the
���

5. Solve the Poisson equation ∇2 𝑓 = 4� 2 � + 3�� 2 , over the square


interior nodes.

domain � ≤ 3, 1 ≤ � ≤ 3, with f on the boundary as given in


figure below. Take h=k=1.

6. Solve the Poisson’s equation ���� + ���� = 243(� 2


+ � 2 ) over a square domain 0 ≤ � ≤ 1, 0 ≤ � ≤ 1 with
step size ℎ = with � =
1
3
100 on the boundary.
7. Given the Poisson’s equation: ∇2 𝑓 = 4� 2 � 2 over the square domain: 0 ≤ � ≤ 3 𝑎�� 0 ≤
� ≤ 3 with Dirichlet boundary condition of ��(�, �) = 100 and h=k=1. Calculate the
steady state temperatures at the interior nodes by using Gauss-Seidel method. Iterate until the

8. Solve the Poisson equation ∇2 𝑓 = 2� 2 � 2 , over the square domain 0 ≤ � ≤ 3, 0 ≤ � ≤ 3, with f=0
successive values at any point is correct to two decimal places.

on

9. Solve the equation ∇2 � = −10(� 2 + � 2 + 10) over the square mesh 0 ≤ � ≤ 3, 0 ≤ � ≤ 3 with
the boundary and h=1. (**)

�=0
on the boundary and mesh length ℎ = 𝑘 = 1 (**)
10. Solve the Poisson equation ∇2 𝑓 = � 2 � + 2, over the square domain 0 ≤ � ≤ 3, 0 ≤ � ≤
3, with f=0 on the boundary and h=1.
11. Torsion on a square bar of size 15cm*15cm. If two sides of the sides are held at 1000C and the other
two sides are held at 00C. Calculate the steady state temperature at interior points. Assume a grid size of

12. Solve the parabolic equation 2𝑓�� (�, �) = 𝑓𝑡 (�, �) 0 ≤ � ≤ 1.5 and given initial condition
5cm*5cm.

��(�, 0) =
50(4 − �), 0 ≤ � ≤ 4 with boundary condition ��(0, �) = 0 = ��(4, �) 0 ≤ � ≤ 1.5

Nepal Engineering Numerical

You might also like