Numerical Analysis − Math306
Final Exam − Spring 2024 (Wednesday June 5, 2024)
Dr. Ahmed Abdelsamea, Applied Math
Name:
ID Number:
Attempt all Questions (Max: 80 marks) (Time: 120 min)
Question no. Grade Student Grade
Q1 15
Q2 15
Q3 15
Q4 15
Q5 15
Q6 20
Total 95
Good Luck
1. Error propagation.
The Stefan-Boltzmann law can be employed to estimate the rate of radiation of
energy 𝑯 from a surface, as in
𝑯 = 𝑨 𝒆 𝝈 𝑻𝟒
where 𝑯 is in watts, 𝑨 = the surface area (𝒎𝟐 ), 𝒆 = the emissivity that characterizes
the emitting properties of the surface (dimensionless), 𝝈 = 𝒂 universal constant
called the Stefan-Boltzmann constant (= 𝟓. 𝟔𝟕 × 𝟏𝟎−𝟖 𝑾𝒎−𝟐 𝑲−𝟒 ), and 𝑻 =
absolute temperature (𝑲).
a. Estimate the error of 𝑯 for a copper sphere with radius: 𝟎. 𝟏𝟓 ± 𝟎. 𝟎𝟐 𝒎,
𝒆 = 𝟎. 𝟗𝟎 ± 𝟎. 𝟎𝟒, and 𝑻 = 𝟓𝟓𝟎 ± 𝟏𝟕. 𝟓 𝑲. Verify the validity of your
estimate by comparing it with the extreme values of the variables. (10 marks)
b. Compute and interpret the condition number for each variable. Which one is
more sensitive to changes? (5 marks)
Continue your answer
2. Curve Fitting
Given the following data
𝒙 0 1.0 2.5 3.0
𝒇(𝒙) 2 5.4375 7.3516 7.5625
a. Calculate 𝒇(𝟐. 𝟎) using Newton’s interpolating polynomials of order 1 through 3.
Choose your base points to attain good accuracy. Collect your final answers in
the following table. (8 marks)
b. Repeat using Cubic Splines. (7 marks)
𝒊 𝒙𝒊 𝒇(𝒙𝒊 ) 𝒇[𝒙𝒊+𝟏 , 𝒙𝒊 ] 𝒇[𝒙𝒊+𝟐 , 𝒙𝒊+𝟏 , 𝒙𝒊 ] 𝒇[𝒙𝒊+𝟑 , 𝒙𝒊+𝟐 , 𝒙𝒊+𝟏 , 𝒙𝒊 ]
3
Continue your answer
3. Differential Equations
a. Derive the 2nd order RK method by comparing the RK general form with the
Taylor series expansion to the second-order term. Indicate appropriate values for
obtained parameters to have three versions of RK2 namely: Heun’s with a one
corrector method, Midpoint method and Ralston’s Method. (5 marks)
b. Consider the following IVP: (10 marks)
𝒅𝒚 𝟐𝒚
=− ; 𝒚(𝟎) = 𝟐.
𝒅𝒕 𝟏+𝒕
i. Get the exact solution.
ii. Use the RK2 method with step size 𝒉 = 𝟎. 𝟏 to get 𝒚(𝟎. 𝟐).
iii. Find the percentage error compared to the exact solution.
Continue your answer
4. Numerical Integration
a. Suppose that the temperature of a rectangular heated plate (8-m x-long and 6-
m y-wide) is described by the following function: (9 marks)
𝑻(𝒙, 𝒚) = 𝟐𝒙𝒚 + 𝟐𝒙 − 𝒙𝟐 − 𝟐𝒚𝟐 + 𝟕𝟐.
Compute the average temperature using:
i. Analytical method. (2 marks)
ii. Two-segment Simpson’s 1∕3 rule. (5 marks)
iii. Compare both results and comment. (2 marks)
b. Consider the following integral (6 marks)
𝟐
𝒆−𝒙 𝐜𝐨𝐬(𝒙)
∫ 𝒅𝒙
𝟎 𝟏 + 𝒙𝟐
Obtain an estimate of the integral using three-point Gauss-Legendre formula.
Continue your answer
5. Numerical PDE
a. Consider the Laplace Equation of a plate with an irregular boundary as shown in
the figure. Derive the difference equations near the irregular Dirichlet-type
boundary using the grid parameters, 𝜶𝟏 , 𝜶𝟐 , 𝜷𝟏 , 𝜷𝟐 , (5 marks)
b. Consider the temperature distribution of a long, thin rod with a length of 10 cm
and the following values: 𝒌 = 𝟎. 𝟒𝟗 𝐜𝐚𝐥/(𝐬𝐞𝐜. 𝐜𝐦. ℃), 𝚫𝒙 = 𝟐 𝐜𝐦 , and 𝚫 𝒕 =
𝟎. 𝟏 𝐬𝐞𝐜. At 𝒕 = 𝟎, the temperature of the rod is zero and the boundary
conditions are fixed for all times at 𝑻(𝟎) = 𝟏𝟎𝟎 ℃ and 𝑻(𝟏𝟎) = 𝟓𝟎 ℃.
Note that the rod is aluminum with 𝑪 = 𝟎. 𝟐𝟏𝟕𝟒 𝐜𝐚𝐥/(𝐠. ℃) and 𝝆 = 2.7
𝒌
g/cm3 (𝜷 = )
𝝆𝑪
i. Solve using the Crank-Nicolson method for only two-time steps. (7 marks)
ii. Discuss the disadvantages of the Explicit Method and how it has been
resolved by Implicit Methods. (3 marks)
Note: Record the answer of part b in the following table:
Temperature 𝒕 = 𝟎 sec 𝒕 = 𝟎. 𝟏 sec 𝒕 = 𝟎. 𝟐 sec
𝑻𝟎
𝑻𝟏
𝑻𝟐
𝑻𝟑
𝑻𝟒
𝑻𝟓
Continue your answer
6. Optimization
a. Consider the function: (10 marks)
𝒇(𝒙, 𝒚) = 𝟐𝒙𝒚 + 𝟐𝒙 − 𝒙𝟐 − 𝟐𝒚𝟐 .
Find:
i. The exact maximum point and corresponding function value analytically.
ii. An estimate to the maximum point using the steepest-ascent method. Perform
only one iteration using the initial guess (𝟏, 𝟏). Evaluate the function at the
new point showing the improvement percentage.
b. Solve the following LPP: (10 marks)
Maximize 𝒇 = 𝟑𝒙𝟏 + 𝟐𝒙𝟐
subject to 𝟒𝒙𝟏 + 𝟑𝒙𝟐 ≤ 𝟏𝟐
𝟒𝒙𝟏 + 𝒙𝟐 ≤ 𝟖
𝒙𝟏 , 𝒙𝟐 ≥ 𝟎
Using
i. Graphical method,
ii. Simplex method.
Continue your answer