Uploaded by duncanissawg9

Assignment 5

advertisement
McMaster University
Department of Engineering Physics
EP 3NM4 – Numerical Methods for Engineering
Assignment 5
(12 Marks – worth 4% of total grade)
Due on: Friday August 6, 2021 (before 11:59 PM)
Instructor:
Dr. Mohamed Abdelsalam
Summer 2021
Please submit your scanned answers of the assignment by the deadline stated above in
the corresponding drop box on A2L. Check the late submission protocol on A2L.
Computer-typed reports will not be accepted.
1. For the ordinary differential equation: (3 Marks)
𝒅𝒚
= 𝒚 𝒔𝒊𝒏𝟑 (𝒕)
𝒅𝒕
The initial condition is 𝑦(0) = 1.
a. Use MS Excel to apply Euler’s method and solve the ODE at t=1 s using step sizes
ℎ = 0.01, 0.2, 0.5 𝑠. Plot the results and discuss the effect of reducing the step size
on the solution.
b. Use Heun’s method with iterative corrector to solve for the first step, where the
step size is ℎ = 1 𝑠. (Limit your answer to only three iterations). Assuming that
the solution obtained from part (a) using ℎ = 0.01 𝑠 is the true solution, calculate
the percent relative error.
c. Use RK4 method to solve for the first step, where the step size is ℎ = 1 𝑠. Calculate
the percent relative error as in part (b).
2. Use the Euler’s method to solve: (3 Marks)
𝒅𝟐 𝒚
− 𝟎. 𝟓𝒕 + 𝒚 = 𝟎
𝒅𝒕𝟐
, where 𝑦(0) = 2 and 𝑦′(0) = 0. Solve from 𝑥 = 0 𝑡𝑜 1 using ℎ = 0.1. Show the first
step in detail and continue the rest of the steps on MS Excel, showing the final results
in a table.
3. Use Euler’s method to solve the following system of ODEs: (3 Marks)
𝒅𝒚
= −𝟐𝒚 + 𝟓𝒆−𝒕
𝒅𝒕
𝒅𝒛 −𝒚𝒛𝟐
=
𝒅𝒕
𝟐
, over the range 𝑡 = 0 𝑡𝑜 0.4 𝑠 using a step size of 0.1 with 𝑦(0) = 2 𝑎𝑛𝑑 𝑧(0) = 4. Show
the first step in detail and continue the rest of the steps on MS Excel, showing the final
results in a table.
4. A steady-state heat balance for a rod can be represented as: (3 Marks)
𝒅𝟐 𝑻
− 𝟎. 𝟏𝟓𝑻 = 𝟎
𝒅𝒙𝟐
Obtain
an
analytical
solution
for
a
10-m
rod
with
𝑇(0) = 240
and
𝑇(10) = 150. Solve the boundary-value ODE using
a. The shooting method.
b. The finite-difference approach with ∆𝑥 = 1. Use TDMA algorithm to solve the tridiagonal matrix.
Important Notes:
•
Group work is encouraged while solving the problems, however each student should submit his/her
own work.
•
Cheating and/or plagiarism are forms of academic dishonesty. Such cases will be spotted and a zero
mark will be given to all copies regardless of who copied whose. Everyone should be protective of
his/her own work, yet provide the appropriate help whenever asked. In the case of repeated incidents
from the same student, the case will be raised to the academic integrity officer of the university.
•
Computerized reports will not be accepted, except for the code part. You must solve the assignment
by hand and submit a scan of your solutions.
•
Students who wish to remark a question must a detailed email to the instructor (Dr. Abdelsalam) along
with the report with detailed explanation about the case (i.e. where do you deserve an extra mark and
why?). The instructor will refer the letter to the corresponding TA who will reply to the email
accordingly.
•
The marks will be posted on A2L.
Best Wishes!
Download