Finalspring 2022
Finalspring 2022
Finalspring 2022
8z + y = 9
10x − y + 1 = 0
−15y + x + z + 14 = 0
via the Gauss-Seidal method, with starting point x0 = 0, y0 = 0.7, z0 = 0.9, tolerance =
0.05, a11 = 10, a22 = 15 and a33 = 8.
[16 marks]
1
2. Evaluate the integral ∫ 3
ex ln x dx
2
using the Trapezoidal rule with n = 2. Improve the Trapeziodal solution using Richardson
Extrapolation.
[9 marks]
2
3. Consider the equation
ln(x) + x = 0 . (1)
Explain why there is a solution of Equation (1) between x = 0.5 and x = 0.6. Using
Bisection algorithm, solve Equation (1). Use your starting points a = 0.5 and b = 0.6
and tolerance tol = 0.01.
[7 marks]
3
4. Solve
y ′′ y + y ′2 = 1 , y(0) = 1 , y(1) = 2
using the Euler method with h = 0.25 and the shooting method with tolerance = 10−2 .
Use α0 = 0.7 and α1 = 1.2 as the initial two appoximations to the unknown slope y ′ (0).
[18 marks]
4
5. Find a series solution in powers of x+1 up to the term (x+1)4 of the differential equation
[21 marks]
5
6. Consider the wave equation
∂ 2W ∂ 2W
= 2 , 0≤x≤2
∂t2 ∂x2
with the initial and boundary conditions
W (0, t) = W (2, t) = 0 , ∀t ≥ 0 ,
∂W
(x, 0) = 0 , W (x, 0) = 1 .
∂t
A solution of the wave equation is of the form W (x, t) = X(x)T (t). Explain why
X ′′ T ′′
= =C,
X 2T
where C is a constant. Obtain the non-trivial solution of the wave equation with the
given boundary equation when C = −α2 , where α > 0. [21 marks]
6
**
7
Formula Sheet
Bisection algorithm:
For n = 0, 1, 2, . . . Do
an + bn
Set m =
2
if | f (m) |=≤ tol Stop. This is your approximate solution.
(or you can stop if | bn − m |≤ tol )
if f (an )f (m) < 0, set an+1 = an and bn+1 = m
Otherwise, set an+1 = m, bn+1 = bn
ENDDO.
Gauss-Seidal Method:
Select x0
For k = 0, 1, 2, . . .
(i) (i) 1 ∑
i−1
(j) ∑n
(j)
xk+1 = xk + [bi − aij xk+1 − aij xk ] (F1)
aii j=1 j=i
x0 = a , y0 = y(a) , z0 = y ′ (a) .
Do i = 1, n
yi = yi−1 + hzi−1
zi = zi−1 + hf (xi−1 , yi−1 , zi−1 )
xi = a + ih
1 Continue
1. Let αk be an approximation to the unknown initial slope y ′ (a) = αk (Choose the first two
α0 and α1 using physical intuition).
3. Obtain
yb − yn (αk−1 )
αk+1 = αk−1 + (αk − αk−1 )
yn (αk ) − yn (αk−1 )
8
Richardson Extrapolation:
h
2k A( ) − A(h)
A∗ ≈ 2 .
2k − 1
Fourier Sine Series: ∞
∑ nπ
f (x) = An sin( x) , 0 ≤ x ≤ L
n=1
L
∫ L
2 nπ
An = f (x)sin( x)dx
L 0 L