Académique Documents
Professionnel Documents
Culture Documents
STUDENT NUMBER: . . . . . . . . . . . . . . . . . . . . . .
June 2009
MATH2089
Numerical Methods and Statistics
All answers must be written in ink. Except where they are expressly required pencils
may only be used for drawing, sketching or graphical work.
June 2009
Page 2
MATH2089
ii)
ans1 = 8 + 3*eps - 8
ans2 = exp(3.2e+120)
ans3 = 0*log(0)
A = [1 -3 0; 2 1 -4; 0 0 3]
x = A(:,2)
ans4 = norm(x, Inf)
ans5 = A >= 0
Is A symmetric?
Is A positive definite?
Calculate the 2-norm condition number 2 (A) of A.
When solving the linear system Ax = b, the elements of A and b are
known to 6 significant decimal digits.
.
A) Estimate the relative error in the computed solution x
B) What confidence do you have in your computed solution?
v) Given the Cholesky factorisation A = RT R, explain how to solve the
linear system Ax = b.
June 2009
2.
MATH2089
Page 3
June 2009
Page 4
MATH2089
b) Two chemicals are mixed in a stirred tank chemical reactor under controlled conditions to produce a certain product. The problem parameters
are
r = x1 x2
where > 0 is constant.
The concentrations of the the two reactants in the constant feed stream
is u(t) = (3.2, 4.8)T , the flow rate is q = 10 m3 /min, the volume of the
tank is V = 2 m3 and the reaction rate constant is = 2.6 m3 /mole-min.
Initially the mixture in the tank has 5 moles/m3 of chemical 1 and 3
moles/m3 of chemical 2, and no product is initially present.
We want to find the concentrations of chemical 1, chemical 2 and the
product over a period of 90 seconds.
i) Write this as an initial value problem (IVP) in the standard form
x = f(t, x) t [t0 , tmax ],
x(t0 ) = y0
June 2009
3.
Page 5
MATH2089
x (0, L),
t (0, T ].
(3.1)
10
12
nz = 58
14
16
18
20
June 2009
Page 6
MATH2089
(2 + j )u+1
u+1
j
j1 uj+1 = j ,
(3.2)
u(L, t) = 20 t (0, T )
give the equation (3.2) for a discretization with n = 20 at the grid points
xj for
i) j = 1;
ii) j = 14.
Leave your answer in terms of j , j but make sure you clearly identify
what values are known.
e) The linear equations (3.2) can be written in matrix form as Au+1 = b .
You are not required to derive the linear system.
i) Calculate the sparsity of A for the case n = 20.
ii) Briefly discuss the structure of A that could be exploited to efficiently
solve this linear system.
Please see over . . .