0% found this document useful (0 votes)
18 views

Final - Solution

This document contains the instructions for a mathematics final exam consisting of 4 problems worth a total of 100 points. Problem 1 involves initial value problems and numerical integration methods like Runge-Kutta. It asks students to derive discrete equations, identify parameters of Runge-Kutta schemes, and apply 3rd and 4th order Runge-Kutta methods to solve sample initial value problems. Problem 2 considers a 2nd order initial value problem, asks students to convert it into a system of first order equations, write the system in vector form, and take one step of Euler's method to approximate the solution at t=0.25.

Uploaded by

Karim K Mazloum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Final - Solution

This document contains the instructions for a mathematics final exam consisting of 4 problems worth a total of 100 points. Problem 1 involves initial value problems and numerical integration methods like Runge-Kutta. It asks students to derive discrete equations, identify parameters of Runge-Kutta schemes, and apply 3rd and 4th order Runge-Kutta methods to solve sample initial value problems. Problem 2 considers a 2nd order initial value problem, asks students to convert it into a system of first order equations, write the system in vector form, and take one step of Euler's method to approximate the solution at t=0.25.

Uploaded by

Karim K Mazloum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

AMERICAN UNIVERSITY OF BEIRUT

Mathematics Department-FAS

MATH 251
Final Exam
Fall 2021
Closed Book - 2hours

STUDENT NAME

ID NUMBER
Section Prof. Nassif

Problem Out of Grade


1 20

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

b - Write the corresponding 3rd order discrete scheme:




 k1 = f (ti , yi )
k2 = f (ti + α1 h, yi + β1 hk1 )

(RK3)

 k3 = f (ti + α2 h, yi + β2 hk1 + β3 hk2 )
yi+1 = yi + h(ω1 k1 + ω2 k2 + ω3 k3 )

by identifying the values of α1 , β1 , α2 , β2 , β3 and ω1 , ω2 , ω3 .


α1 = .........; β1 = .........; α2 = .........; β2 = .........; β3 = .........; ω1 = .........; ω2 = .........; ω3 = .........

2. (5 points) Consider the following initial value problem:


dy
(
= f (t, y(t)) = 2t + y ; x ∈ [0, 0.5]
(IV P ) dt
y(0) = 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:

2w”(t) + w0 (t) − w(t) = 2 t;



0 ≤ t ≤ 0.5
(IV P 2)
w(0) = 1; w0 (0) = 0;

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:

Y~ 0 (t) = F~ (t, Y~ (t))



(4) (IV P S)
Y~ (0) = Y~0

by specifying the row vectors Y~ (t), Y~0 and the row vector function F~ (t, Y~ (t)).

2 - (5 points)

ˆ Write in vector form Euler’s method to solve the system (5).

~ 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).

i ti Y~i ~ 1 = F~ (ti , Y~i )


K
0 0 [ , ] [ , ]
1 0.25 [ , ] XXXX

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 )}

where the nodes are not necessarily equally spaced, with:

hi+1 = xi+1 − xi , ∀i = 0, 1, ..., n − 1

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:

........................................................................................................ = (hi + hi+1 )[xi−1 , xi , xi+1 ]

Write this equation for the following values of i :

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:

i xi yi = [xi ] [., .] [., ., .] [., ., ., .]

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:

w1 = −420/23 and w2 = 300/23

Fill in the following table. Express all computed values as FRACTIONS

i zi wi

0 . .

1 . .

2 . .

3 XX .

8
Exercise 3 (30 points)
A (25 points) Let

Dn = {(xi , yi ) | yi = f (xi )) ; = 0, 1, 2, ..., n ; f ∈ C ∞ , i.e. f is infinitely differentiable.}

with h = xi+1 − xi , for all i = 1, 2, ..., n and 0 < h ≤ 1


Let also Z b=xn
I= f (x)dx
a=x0

The objective of this exercise is to approximate I by the Composite Trapezoidal rule followed by Romberg
procedure. In that view:

1. (10 points) Given that

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)

where S(h) = 32 M (h) + 13 T (2h)

3. (10 points) Consider the following set of data D4

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

In order to approximate Z 1.5


I= f (x)dx
1
based on D4 , fill in the table below adequately by applying the Trapezoidal rule followed by
Romberg procedure as many times as possible. Express your answers as fractions.
Show ALL details of your calculations for T (h) below.

h T (h) R1 (h) ..............................


.... ..... ..... .......
.... ..... ..... .......
.... ..... ..... .......
.

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:

|rn+1 − r| ≤ C|rn − r|2

13

You might also like