SMJM 3053 Numerical Methods Project
SMJM 3053 Numerical Methods Project
Section number 03
Group number
Name of Lecturer Dr Tan Kit Ken
Report’s Rubric
__x 5
Total 20
Contents of Contents of Contents of Contents of Contents of
discussion are discussion are discussion are discussion are discussion are
very poor, very poor, little moderate, broad, very broad,
Content poor knowledge on knowledge on showing showing great
11 knowledge on
the field.
the field. the field are
sufficient.
knowledge on
the field.
knowledge on
the field.
__x 2
Total 5
TABLE OF CONTENTS
2.0 Introduction............................................................................................................................... 8
4.0 Objectives................................................................................................................................... 9
5.0 Methodology..............................................................................................................................10
5.0 Results.......................................................................................................................................21
6.0 Discussion..................................................................................................................................23
7.0 Conclusion.................................................................................................................................24
8.0 References.................................................................................................................................25
1.0 BRIEF BIODATA
Ambition: Engineer
Hello! My name is Nadia and I am 22 years old this year. I was born and raised in
Terengganu. After my SPM, I pursued my foundation in engineering at UiTM Dengkil
and am currently doing my degree in Mechanical Precision Engineering at UTM. To me,
life is about having close friends and family whom you can rely on. I am on the happy
side of life, but sometimes I also have sad and gloomy days. However, I have a few
friends here that cheer me up when I’m having a terrible day. My main goal, for now, is to
graduate successfully and start my career.
1
Name: Ooi Xin Yin
Ambition: Engineer
My name is Ooi Xin Yin. I was born in the city of Ipoh in Perak state in 2001. However, I
moved to Penang when I was still a kindergarten child. Penang is famous for two things, which is
food and education. Every weekend, I can see a lot of tourists coming to Penang mainly for
Penang Laksa and Char Kuey Teow. It is very frustrating to me because my house is located near
to famous spots in Penang (Penang Hills, Kek Lok Si). In peak season, I need to suffer several
heavy traffic jams on my trip. After finishing my secondary studies in Penang Chinese Girls’ High
School, I went to Perak Matriculation College to further my study. It was an unexpected
opportunity for me to go back to Perak again. In Perak Matriculation College, I met with many
lecturers and friends that inspired and influenced me a lot. After my Pre-U study in Perak
Matriculation College, I made an important decision in my life. I put my first choice as
Mechanical Precision Engineering instead of Computer Science in my UPU. It was a huge change
for me because I had planned to be a software engineer since I was 15 and I studied Computer
Science for 3 years ( during secondary school and matriculation college). The main reason that I
made this decision is because I know I can learn about programming, machine learning from the
Internet. I can learn this by joining the workshop, seminar or even enroll for the courses that I am
interested in. The reason why I chose mechanical precision engineering is because of the
uniqueness of MJIIT. It is compulsory for MJIIT students to learn the Japanese language. By
2
learning a foreign language, I will have more choices and advantages when I apply for a job. I
hope that I can get to work in Japan as it would be a wonderful experience to work in foreign
country and experience life there.
3
Name: MUHAMMAD IRFAN BIN AMINUDIN
Ambition: Lecturer
Hi my name is Muhammad Irfan and you may call me Irfan. This year I am 23
years old. I was born at HUKM Cheras on 11th November 2000. I am a graduate from
Politeknik Sultan Salahuddin Abdul Aziz Shah, Shah Alam and currently furthering my
study at UTM KL MJIIT for a degree in Mechanical Engineering Precision. Right now we
have entered a new year, with that we have to make a new resolution. For this year, I hope
to be more productive than last year and get a good pointer in my studies to pay for all the
hardships of my parents to ensure that I got top quality education for my future.My main
goal is to become a successful graduate and get a good career.
4
Name: Nurul Ain Natasha Binti Azmi
Ambition: Engineer
My name is Nurul Ain Natasha and I usually go by Ain. I am turning 22 years old
this year. I was born and raised in Selayang, Selangor. I am a graduate from an
engineering matriculation located at Jengka, Pahang and am currently taking my degree in
Mechanical Precision Engineering at UTMKL. Back in matriculation, we studied all types
of engineering including civil engineering, electrical engineering & mechanical
engineering. For me, electrical engineering is the toughest engineering major while on the
other hand, civil engineering is the easiest engineering major. However, one of our basic
engineering lecturers warned us that civil engineers now are struggling to get a job hence
why I applied for mechanical engineering, specifically MJIIT programme as my first
choice in my UPU. One of the reasons why I chose MJIIT is also because I love Japanese
culture and Japanese language, mainly because I am a big fan of anime, J-drama & J-pop.
I also did self learn Japanese when I was 17 years old by just watching youtube videos
and now I can really use my knowledge after entering MJIIT with ease. Therefore, my
goal right now is to excel in academics, get good grades and pass JLPT so that in future, I
could apply in well-known Japanese companies or maybe even work in Japan as an
engineer.
5
Name: Wee Liang Jun
Ambition: Engineer
My name is Wee Liang Jun , I was born in Ipoh, Perak in 2001. But, our family
moved to Kelantan when I was 3 years old and so I have grown up there since then.
Kelantan is known for their traditional Malay foods, such as Nasi Kerabu (blue rice),
KawJam (green rice) and Nasi Kunyit ( yellow rice). We have a lot of mosques and
ancient museums here. My house is located at the centre of the state which is Kota Bharu,
Kelantan, i am glad to be living here as it is very convenient for me to go anywhere and
its only 3 minutes walking from my house to the nearby mall we have, which is KB mall.
I graduated from SMJK(C) Chung Hwa and after that I went to further my foundation
studies in Universiti Teknologi Petronas. After my Pre-U is done, I applied for this course,
Bachelor of Mechanical Engineering and Bachelor of Mechanical Precision Engineering
in my UPU choices, but I ended up receiving my second choices. I am glad to learn
Japanese Language throughout three semesters in my university life as it will enhance my
soft skills which can aid me in applying for jobs in future. I have always planned to be a
Mechanical Process Engineer after I graduate and my goal is to work in Micron Company
6
in Singapore. However, if I get a chance to work in Japan, I will definitely choose to work
in Japan as I have the advantages of Japanese Language skills. It will be easier for me to
communicate with people there.
7
2.0 INTRODUCTION
Moreover, equations relating to heat transfer can also be solved by using the
Runge-Kutta second-order method. This is because it has been demonstrated many times
that by employing this Runge-Kutta second-order method, we can determine the
temperature over time with a given step size, h.
8
3.0 PROBLEM STATEMENT
We are required to compile a report on the topic of Ordinary Differential Equations
(ODEs), specifically using the second-order Runge-Kutta method, and compare the two
methods in light of an engineering problem that may be solved using numerical methods.
In addition to manual calculations, we will also need to be able to solve the problem using
software such as MATLAB, C++, or any software in order to verify the solution. The
knowledge we have acquired in numerical methods class will be put to use in this report
and applied in actual engineering applications.
4.0 OBJECTIVES
1. To understand the Runge-Kutta second-order method for ordinary differential
equations.
2. To solve heat transfer equations by using the Runge-Kutta second-order method.
3. To calculate and solve the problem using MATLAB, C++ or any software.
9
4.0 METHODOLOGY
Runge–Kutta method is an effective and widely used method for solving the initial-value
problems of differential equations. The Runge-Kutta method can be used to build high
order accurate numerical methods from functions without the need for high order
derivatives of functions. The Runge-Kutta 2nd order method is a numerical technique
used to solve an ordinary differential equation of the form.
𝑑𝑦
𝑑𝑥
=𝑓(𝑥, 𝑦), 𝑦(𝑥0) = 𝑦0
Where
𝑘1 = 𝑓(𝑥𝑖, 𝑦𝑖)
Which satisfy
1 1
𝑎1 + 𝑎2 = 1, 𝑎2𝑝1 = 2
, 𝑎2𝑞11 = 2
(2)
In subsequent sections, we will look at how the Euler and Runge-Kutta methods can be
used to solve higher order ordinary differential equations or simultaneous differential
equations.
10
the tangent intersects the curve. However, the assumption that small step sizes lead to
small errors does not always hold true. The Euler method fails to converge in the case of a
larger step size or a concave up curve because it overestimates the next term. Heun's
method solves this problem by taking two tangents to the curve on both sides. The first
tangent overestimates, while the second underestimates. Heun's method then employs the
Euler method to calculate the next term from both tangents.
(𝑘1+ 𝑘2)(ℎ)
𝑦(𝑖+1) = 𝑦𝑖+ 2
𝑘1 = 𝑓(𝑥𝑖, 𝑦𝑖)
𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1ℎ)
Where:
● 𝑘1 and 𝑘2 are over and underestimates.
11
4.0.1 Application of Ralston’s Method
Ralston's second order method is a Runge-Kutta method for approximating the solution of
the initial value problem y'(x) = f(x,y); y(x0) = y0 which evaluates the integrand,f(x,y),
twice for each step. For step i+1,
1 2
𝑦(𝑖+1) = 𝑦𝑖+ ( 3 𝑘1 + 3
𝑘2)ℎ (1)
Where
𝑘1 = 𝑓(𝑥𝑖, 𝑦𝑖)
3 3
𝑘2 = 𝑓(𝑥𝑖 + 4
ℎ, 𝑦𝑖 + 4
𝑘1ℎ)
and xi = x0 + i h.
Ralston's second order method is a second order procedure that can be used with
Richardson extrapolation.
12
4.1 MANUAL CALCULATION
A metal ball of radius R heated in an oven at 1600K and then taken from the oven
and allowed to cool down in air at an ambient temperature of 298 K so that it can be
fit into a hollow hub. Assuming heat is lost only due to radiation, The rate of change
of temperature of the metal ball is given by
𝑑Ө −12 4 8 3 2
𝑑𝑡
=− 0. 533 × 10 (Ө − 81 × 10 − 5. 211 × 10 Ө )
where θ is in K and t in seconds. Using the Runge-Kutta 2nd order methods (Heun
Method), find the temperature of the metal after 150 seconds. Assume a step size of h
= 50 seconds
Ө(0) = 1600 𝐾
−12 4 8 3 2
𝑓(𝑡, Ө) =− 0. 533 × 10 (1600 − 81 × 10 − 5. 211 × 10 (1600) )
Heun’s method:
1
Ө𝑖+1 = Ө𝑖 + 2
ℎ(𝑘1 + 𝑘2 )
𝑘1 = 𝑓(𝑡𝑖 , Ө𝑖 )
𝑘2 = 𝑓(𝑡𝑖 + ℎ , Ө𝑖 + 𝑘1 ℎ)
First iteration, i = 0:
𝑡 = 0, Ө0 = 1600
𝑘1 = 𝑓(𝑡0 , Ө0 )
𝑘1 = 𝑓(0, 1600)
−12 4 8 3 2
𝑓(0, 1600) =− 0. 533 × 10 (1600 − 81 × 10 − 5. 211 × 10 (1600) )
𝑘1 =− 3. 481641
𝑘2 = 𝑓(𝑡0 + ℎ , Ө0 + 𝑘1 ℎ)
𝑘2 =− 2. 193496
1
Ө1 = Ө0 + 2
ℎ(𝑘1 + 𝑘2 )
1
Ө1 = 1600 + 2
(50)(− 3. 481641 − 2. 193496)
Ө1 = 1458. 1216 𝐾
First iteration, i = 1:
𝑘1 = 𝑓(𝑡1 , Ө1 )
𝑘1 =− 2. 39914
𝑘2 = 𝑓(𝑡1 + ℎ , Ө1 + 𝑘1 ℎ)
𝑘2 =− 1. 69980
1
Ө2 = Ө1 + 2
ℎ(𝑘1 + 𝑘2 )
1
Ө2 = 1458. 1216 + 2
(50)(− 2. 39914 − 1. 69980 )
14
Ө2 = 1355. 6481 𝐾
First iteration, i = 2:
𝑘1 = 𝑓(𝑡2 , Ө2 )
𝑘1 =− 1. 79075
𝑘2 = 𝑓(𝑡2 + ℎ , Ө2 + 𝑘1 ℎ)
𝑘2 =− 1. 36089
1
Ө3 = Ө2 + 2
ℎ(𝑘1 + 𝑘2 )
1
Ө3 = 1355. 6481 + 2
(50)(− 1. 79075 − 1. 36089 )
Ө3 = 1276. 8571 𝐾
Ө3 = 1276. 8571 𝐾
Ө3 = Ө (150)
15
𝑡, (𝑠𝑒𝑐𝑜𝑛𝑑) θ, (𝐾𝑒𝑙𝑣𝑖𝑛)
0 1600
50 1458.1216
16
4.1 MANUAL CALCULATION
1 2
θ𝑖+1 = θ𝑖 + ( 3 𝑘1 + 3
𝑘2)ℎ
where:
𝑘1 = 𝑓(𝑡𝑖 , θ𝑖)
3 3
𝑘2 = 𝑓(𝑡𝑖 + 4
ℎ , θ𝑖 + 4
𝑘1ℎ)
i=1;
𝑘1 = 𝑓(0 , 1600)
−12 4 8 3 2
=− 0. 533 × 10 (1600 − 81 × 10 − 5. 211 × 10 (1600) )
=− 3. 481641
3 3
𝑘2 = 𝑓(𝑡1 + 4
ℎ , θ1 + 4
𝑘1ℎ)
3 3
= 𝑓(0 + 4
(50) , 1600 + 4
(− 3. 481641)(50))
=− 2. 474722
1 2
θ2 = θ1 + ( 3 𝑘1 + 3
𝑘2)ℎ
1 2
= 1600 + ( 3 (− 3. 481641) + 3
(− 2. 474722))(50)
= 1459. 481917𝐾
i=2;
𝑘1 = 𝑓(50 , 1459. 481917)
−12 4 8 3 2
=− 0. 533 × 10 (1459. 481917 − 81 × 10 − 5. 211 × 10 (1459. 481917) )
=− 2. 408133
17
3 3
𝑘2 = 𝑓(𝑡2 + 4
ℎ , θ2 + 4
𝑘1ℎ)
3 3
= 𝑓(50 + 4
(50) , 1459. 481917 + 4
(− 2. 408133)(50))
=− 1. 863596
1 2
θ3 = θ2 + ( 3 𝑘1 + 3
𝑘2)ℎ
1 2
= 1459. 481917 + ( 3 (− 2. 408133) + 3
(− 1. 863596))(50)
= 1357. 2265𝐾
i=3;
𝑘1 = 𝑓(100 , 1357. 2265)
−12 4 8 3 2
=− 0. 533 × 10 (1357. 2265 − 81 × 10 − 5. 211 × 10 (1357. 2265) )
=− 1. 799141
3 3
𝑘2 = 𝑓(𝑡3 + 4
ℎ , θ3 + 4
𝑘1ℎ)
3 3
= 𝑓(100 + 4
(50) , 1357. 2265 + 4
(− 1. 799141)(50))
=− 1. 465957
1 2
θ4 = θ3 + ( 3 𝑘1 + 3
𝑘2)ℎ
1 2
= 1357. 2265 + ( 3 (− 1. 799141) + 3
(− 1. 465957))(50)
= 1278. 375583𝐾
𝑡, (𝑠𝑒𝑐𝑜𝑛𝑑) θ, (𝐾𝑒𝑙𝑣𝑖𝑛)
0 1600
50 1459. 481917
18
4.2 COMPUTER CALCULATION
4.2.0 Application of Heun Method
Solution for Heun’s Method by using Matlab Software:
Coding:
f=input("Enter your function:");
t0= input ("Enter initial value of t0:");
tn= input ("Enter point at which you want to evaluate solution: value
of:");
y0= input ("Enter initial value of y0:");
h= input ("Enter step size:");
n=round((tn-t0)/h);
t(1)=t0;
y(1)=y0;
for i=1:n
p(i+1)=y(i)+h*f(t(i),y(i));
t(i+1)=t0+i*h;
y(i+1)= y(i)+(h/2)*(f(t(i),y(i))+f(t(i+1),p(i+1)));
fprintf ('y(%0.2f)=%0.4f\n', t(i+1),y(i+1))
end
Result:
19
4.2 COMPUTER CALCULATION
Coding:
Result:
20
5.0 RESULTS
Based on the results of every iteration for Heun’s method and Ralston’s method,
we find that the answer have a difference between ± 1 and 2 numerical values. The value
for both methods have been fit into the graph as a visual aid to see the difference in the
value for both methods.
Figure 1: Graph of every iteration for Heun’s method
21
Figure 3 : Graph of every iteration for Heun’s method and Ralston’s method
Based on the graph, the points for Heun’s method and Ralston’s Method are very
close to each other and seem to be stacked. The difference between the values of both
methods can be seen more clearly on the graph, as they are stacked with each other
because the values of every iteration are close.
In summary, Heun’s method and Ralston’s method can be used to solve the
question. The only difference between both methods is the accuracy of the results.
22
6.0 DISCUSSION
Heun’s method and Ralston's method are both numerical methods for solving
ordinary differential equations (ODE). Both methods are popular choices for solving ODE
due to their simplicity and moderate accuracy.
23
7.0 CONCLUSION
24
8.0 REFERENCES
1. Chapter 08.03 Runge-Kutta 2nd order method for ordinary differential ... (n.d.).
Retrieved December 20, 2022, from
https://nm.mathforcollege.com/strippedfiles/mws/mec/08ode/mws_mec_ode_t
xt_runge2nd_Examples.pdf
25
PEER REVIEW ASSESSMENT
Working with Rarely listens to, shares with, and Often listens to, shares with, and supports Almost always listens to, shares
Others supports the efforts of others. Often is the efforts of others, but sometimes is not with, and supports the efforts of
not a good team player. a good team member. others. Tries to keep people working
well together.
Attitude Often is publicly critical of the project Occasionally is publicly critical of the Never is publicly critical of the
or the work of other members of the project or the work of other members of project or the work of others. Always
group. Often has a negative attitude the group. Usually has a positive attitude has a positive attitude about the
about the task(s). about the task(s). task(s).
Time- Rarely gets things done by the Tends to procrastinate, but always gets Routinely uses time well throughout
management deadlines AND group has to adjust things done by the deadlines. Group does the project to ensure things get
deadlines or work responsibilities not have to adjust deadlines or work done on time. Group does not have
because of this person's inadequate responsibilities because of this person's to adjust deadlines or work
time management. procrastination. responsibilities because of this
person's procrastination.
Contributions Rarely provides useful ideas when Sometimes provides useful ideas when Usually provides useful ideas when
participating in the group and in participating in the group and in classroom participating in the group and in
classroom discussion. May refuse to discussion. A satisfactory group member classroom discussion. A strong group
participate. who does what is required. member who tries hard.
Criteria
Peer 1 Peer 2 Peer 3 Peer 4
(Peer Review)
Comment :
PEER REVIEW ASSESSMENT
Working with Rarely listens to, shares with, and Often listens to, shares with, and supports Almost always listens to, shares
Others supports the efforts of others. Often is the efforts of others, but sometimes is not with, and supports the efforts of
not a good team player. a good team member. others. Tries to keep people working
well together.
Attitude Often is publicly critical of the project Occasionally is publicly critical of the Never is publicly critical of the
or the work of other members of the project or the work of other members of project or the work of others. Always
group. Often has a negative attitude the group. Usually has a positive attitude has a positive attitude about the
about the task(s). about the task(s). task(s).
Time- Rarely gets things done by the Tends to procrastinate, but always gets Routinely uses time well throughout
management deadlines AND group has to adjust things done by the deadlines. Group does the project to ensure things get
deadlines or work responsibilities not have to adjust deadlines or work done on time. Group does not have
because of this person's inadequate responsibilities because of this person's to adjust deadlines or work
time management. procrastination. responsibilities because of this
person's procrastination.
Contributions Rarely provides useful ideas when Sometimes provides useful ideas when Usually provides useful ideas when
participating in the group and in participating in the group and in classroom participating in the group and in
classroom discussion. May refuse to discussion. A satisfactory group member classroom discussion. A strong group
participate. who does what is required. member who tries hard.
Criteria
Peer 1 Peer 2 Peer 3 Peer 4
(Peer Review)
Comment :
PEER REVIEW ASSESSMENT
Working with Rarely listens to, shares with, and Often listens to, shares with, and supports Almost always listens to, shares
Others supports the efforts of others. Often is the efforts of others, but sometimes is not with, and supports the efforts of
not a good team player. a good team member. others. Tries to keep people working
well together.
Attitude Often is publicly critical of the project Occasionally is publicly critical of the Never is publicly critical of the
or the work of other members of the project or the work of other members of project or the work of others. Always
group. Often has a negative attitude the group. Usually has a positive attitude has a positive attitude about the
about the task(s). about the task(s). task(s).
Time- Rarely gets things done by the Tends to procrastinate, but always gets Routinely uses time well throughout
management deadlines AND group has to adjust things done by the deadlines. Group does the project to ensure things get
deadlines or work responsibilities not have to adjust deadlines or work done on time. Group does not have
because of this person's inadequate responsibilities because of this person's to adjust deadlines or work
time management. procrastination. responsibilities because of this
person's procrastination.
Contributions Rarely provides useful ideas when Sometimes provides useful ideas when Usually provides useful ideas when
participating in the group and in participating in the group and in classroom participating in the group and in
classroom discussion. May refuse to discussion. A satisfactory group member classroom discussion. A strong group
participate. who does what is required. member who tries hard.
Criteria
Peer 1 Peer 2 Peer 3 Peer 4
(Peer Review)
Comment :
PEER REVIEW ASSESSMENT
Working with Rarely listens to, shares with, and Often listens to, shares with, and supports Almost always listens to, shares
Others supports the efforts of others. Often is the efforts of others, but sometimes is not with, and supports the efforts of
not a good team player. a good team member. others. Tries to keep people working
well together.
Attitude Often is publicly critical of the project Occasionally is publicly critical of the Never is publicly critical of the
or the work of other members of the project or the work of other members of project or the work of others. Always
group. Often has a negative attitude the group. Usually has a positive attitude has a positive attitude about the
about the task(s). about the task(s). task(s).
Time- Rarely gets things done by the Tends to procrastinate, but always gets Routinely uses time well throughout
management deadlines AND group has to adjust things done by the deadlines. Group does the project to ensure things get
deadlines or work responsibilities not have to adjust deadlines or work done on time. Group does not have
because of this person's inadequate responsibilities because of this person's to adjust deadlines or work
time management. procrastination. responsibilities because of this
person's procrastination.
Contributions Rarely provides useful ideas when Sometimes provides useful ideas when Usually provides useful ideas when
participating in the group and in participating in the group and in classroom participating in the group and in
classroom discussion. May refuse to discussion. A satisfactory group member classroom discussion. A strong group
participate. who does what is required. member who tries hard.
Criteria
Peer 1 Peer 2 Peer 3 Peer 4
(Peer Review)
Attitude 3 3 3 3
Time-management 3 3 3 3
Contributions 3 3 3 3
TOTAL 12 12 12 12
Comment :
PEER REVIEW ASSESSMENT
Working with Rarely listens to, shares with, and Often listens to, shares with, and supports Almost always listens to, shares
Others supports the efforts of others. Often is the efforts of others, but sometimes is not with, and supports the efforts of
not a good team player. a good team member. others. Tries to keep people working
well together.
Attitude Often is publicly critical of the project Occasionally is publicly critical of the Never is publicly critical of the
or the work of other members of the project or the work of other members of project or the work of others. Always
group. Often has a negative attitude the group. Usually has a positive attitude has a positive attitude about the
about the task(s). about the task(s). task(s).
Time- Rarely gets things done by the Tends to procrastinate, but always gets Routinely uses time well throughout
management deadlines AND group has to adjust things done by the deadlines. Group does the project to ensure things get
deadlines or work responsibilities not have to adjust deadlines or work done on time. Group does not have
because of this person's inadequate responsibilities because of this person's to adjust deadlines or work
time management. procrastination. responsibilities because of this
person's procrastination.
Contributions Rarely provides useful ideas when Sometimes provides useful ideas when Usually provides useful ideas when
participating in the group and in participating in the group and in classroom participating in the group and in
classroom discussion. May refuse to discussion. A satisfactory group member classroom discussion. A strong group
participate. who does what is required. member who tries hard.
Criteria
Peer 1 Peer 2 Peer 3 Peer 4
(Peer Review)
Attitude 3 3 3 3
Time-management 3 3 3 3
Contributions 3 3 3
3
TOTAL 12 12 12 12
Comment :