Final - Solution
Final - Solution
Mathematics Department-FAS
MATH 251
Final Exam
Fall 2021
Closed Book - 2hours
STUDENT NAME
ID NUMBER
Section Prof. Nassif
2 30
3 30
4 20
TOTAL 100
1
Exercise 1 - (25 points)
A. (10 points). Consider the general initial value problem:
dy
(
= f (t, y(t)) ; t ∈ [t0 , T ]
(IV P ) dt
y(t0 ) = y0
1. ( 5 points) By integrating (IVP) from ti to ti+1 , one obtains the following iterative equation verified
by the exact solution, with local truncation error of O(h4 ):
h h h
(1) y(ti+1 ) = y(ti ) + 2f ti , y(ti ) + 3f ti + , y(ti ) + f ti , y(ti ) + .....
9 2 2
!
3 3 h h
...... + 4f ti + h, y(ti ) + hf ti + , y(ti ) + f (ti , y(ti )) + O(h4 )
4 4 2 2
a - Based on (1), write the corresponding discrete equation by replacing y(ti ) by yi :
(2) yi+1 = ..........................................................................................................
a - In a first step, solve (IVP) on [0, 0.25] using 1 step of the following 3rd order Runge Kutta:
k1 = f (ti , yi )
k2 = f (ti + h/2, yi + hk1 /2)
(RK3)
k3 = f (ti + 3h/4, yi + 3h/4k2 )
yi+1 = yi + (h/9)(2k1 + 3k2 + 4k3 )
- Write the formulae of the 3rd order Runge Kutta scheme for the given function f (t, y) in the
given (IVP) system:
k1 = ..............................................................................
k2 = ..............................................................................
(RK3)
k3 = ..............................................................................
yi+1 = yi + .......................................
2
- Fill the following table. Express your answer with precision p = 5 and rounding to the closest.
i ti yi k1 k2 k3
0 0 1
1 0.25 XXX XXX XXX
b - Solve then (IVP) on the interval [0.25, 0.5] using 1 step of the “popular” 4th order Runge Kutta
scheme:
k1 = f (ti , yi )
k2 = f (ti + h2 , yi + h2 k1 )
(RK4) k3 = f (ti + h2 , yi + h2 k2 )
k = f (ti + h, yi + hk3 )
4
yi+1 = yi + 61 h(k1 + 2k2 + 2k3 + k4 )
- Write the formulae of the 4th order Runge Kutta scheme for the given function f (t, y) in the
given (IVP) system. :
k1 = ..............................................................................
k2 = ..............................................................................
(RK4) k3 = ..............................................................................
k4 = ..............................................................................
y = y + .......................................
i+1 i
- Fill the following table. Express your results with a precision p=5 and rounding to the closest.
i ti yi k1 k2 k3 k4 ,
1 0.25 ......
2 0.5 XXX XXX XXX XXX
B. (10 points)
Consider the following 2nd order Initial value Problem:
1-(5 points)
Using the change of variables y1 (t) = w(t); y2 (t) = w0 (t) to change (IV P 2) into an Initial Value
system (IV P S) consisting of 2 first order equations.
0
y = ...................
10
y2 = ....................
(3) (IV P Sc)
y1 (0) = ..........
y2 (0) = .........
3
Write (IV P S) in Vector notation:
by specifying the row vectors Y~ (t), Y~0 and the row vector function F~ (t, Y~ (t)).
2 - (5 points)
~ 1 = F~ (........., ..........)
K
(5) (RK1S)
Y~i+1 = ..........
For h = 0.25, carry out one step of Euler’s method (RK1S) to obtain an approximation to
Y~ (0.25).
4
Exercise 2 - (30 points)
Consider the following set of data:
Dn = {(xi , yi ) for i = 0, ..., n|x0 < x1 < ... < xn and yi = f (xi )}
Let also
wi = S ”(xi ) and zi = S 0 (xi ), ∀ i = 0, 1, ..., n.
1. (10 points) Derive the general equations of the Cubic spline function S(x) that interpolates
Dn then write the general expression of Si (x) = S(x) on each of the intervals [xi , xi+1 ], for all
i = 0, 1, ..., (n − 1).
Exhibit the 2n − 2 equations that link the {wi , zi , yi | i = 0, 1, 2, ..., n}.
5
2. (5 points) As a result, derive the system of (n − 1) equations in (n + 1) unknowns verified by the
vector w = [w0 , w1 , ..., wn ]. Then, complete the following equation:
For all i = 1, ..., n − 1:
i=1
i=2
i=3
.....................................................................................
i=n-1
6
3. (15 points) Consider the following set of data
1
D3 = {(0, 1), ( , 2), (1, 0), (2, 1)}
2
The Divided Difference based on D3 is as follows:
0 0 1
1
1 2
2 2
2 1 0 −4 −6
3 2 1 1 10/3 14/3
Let S(x) be the Semi Natural-NonNatural Cubic Spline interpolating D3 , with the following
2 additional imposed conditions:
w0 = 2[x0 , x1 , x2 ] = −12
w3 = 0
In that specific case, and using the results obtained in (1) and (2):
(i) (5 points) Write the system of equations (S) verified by w1 , w2 , then write it in Matrix form.
( Express all coefficients as FRACTIONS)
(S) :
7
(ii) (10 points) The solution of the system (S) is:
i zi wi
0 . .
1 . .
2 . .
3 XX .
8
Exercise 3 (30 points)
A (25 points) Let
The objective of this exercise is to approximate I by the Composite Trapezoidal rule followed by Romberg
procedure. In that view:
I = T (h) + τ1 h2 + τ2 h4 + τ3 h6 + τ4 h8 .............
Derive the 1st and 2nd order Romberg operator R1 (h) and R2 (h).
• R1 (h) :
• R2 (h) :
Write only, the k th order Romberg formula and its order α in O(hα ).
• Rk (h) =
• Error = O(.............)
9
2. (5 points) Prove that Simpson’s Rule is equivalent to the first order Romberg operator, i.e.
S(h) = R1 (h)
i xi f (xi ) = yi
0 1.000 3
1 1.125 7/2
2 1.250 15 /4
3 1.375 4
4 1.500 5
10
R2 2
B (5 points) Let I = 1 e−x dx.
Determine the minimum number of partition points needed to approximate I by means of the Composite
Midpoint rule with an absolute error less than 10−6 .
11
Exercise 4 (25 points)
The objective of this exercise is to approximate the negative reciprocal of 7, i.e.
1
r = − ≈ −0.14286
7
using Newton’s-Root finding method.
1. (5 points) Determine a convenient Non-Polynomial function whose root is r = − 71 and plot its
graph. Show that the interval (−1, 0) locates the given root r.
2. (5 points) Write Newton’s formula. Is there any restriction needed on the choice of the initial
condition in the interval (−1, 0) ? Justify your answer.
12
3. (5 points) Let the Initial condition be r0 = −0.1 > r. Given that rn > r for all n ≥ 1, prove that
the sequence {rn }n≥1 is monotone decreasing on the interval (r0 , r). Deduce then that {rn }n≥0
converges to the root r.
4. (5 points) Prove that, in general, Newton’s method is quadratic (α = 2), then compute the constant
C - in the specific case of this exercise where x ∈ (r0 , r)- verifying:
13