Endsem SolutionKey 2021
Endsem SolutionKey 2021
Part1.Q1 Find dimension and basis for the row space and the null space of the following matrix
2 3
1 0 2
6 2 1 4 7
6 7
A =6 7 (1)
4 0 1 0 5
4 0 8
Approach 2 (for …nding the row space): Using triangularization step of Gaussian
elimination, we have
2 3 2 3
1 2 0 4 1 2 0 4
6 7 6 7
AT = 4 0 1 1 0 5 ! U =4 0 1 1 0 5 (5)
2 4 0 8 0 0 0 0
2 3 2 3
1 0
6 7 6 7
R(AT ) R(U ) 4 0 5+ 4 1 5 (6)
0 0
1
Dimension of Row space = 2
Approach 1 (Finding Null space A): From examination of columns of A, it can
be seen that the …rst and last columns of A are linearly dependent and
2 3 2 3
1 0 2 2 3 0
6 2 1 4 7 2 6 0 7
6 76 7 6 7
6 74 0 5 = 6 7 (7)
4 0 1 0 5 4 0 5
1
4 0 8 0
2
Note: For Backward Gauss-Seidel method
" #" #
1 c b 0 0
S 1T = (14)
ac 0 a b 0
" #
1 b2 0
= (15)
ac ab 0
Eigenvalues of S 1 T " #
2
b =ac 0
det =0 (16)
b=c
( b2 =ac) = 0 (17)
b2
1 = 0 and 2 = (18)
ac
and Since A is a +ve de…nite matrix, we have
This implies
ac > b2 > 0
and
b2
0< <1 (20)
ac
Thus, spectral radius of S 1 T is
b2
S 1T = <1 (21)
ac
and the backward Gauss-Seidel will converge.
3
Note that the null space of matrix M is given as
2 3
1
6 7
N (M) = 4 1 5 (23)
1
on to the column space of M . Use the QR factorization method to compute the projec-
tion vector p that lies in the column space of M and the error vector e = b p which
is orthogonal to the column space of M. (10 marks)
Note: Projection a n 1 vector b 2 Rn on column space of matrix (n m) matrix A,
where n > m and rank of A is m, can be found as, p = Ax;where x is obtained by
solving the following system of linear equation
Rx = QT b (25)
4
z(2) = c(2) c(2) ; q(1) q(1) (28)
p
c(2) ; q(1) = 1= 2 (29)
2 3 2 3 2 3
1 0 1
6 7 p 7 6
(2) 6 70 p 6 6 1= 2 7 6 1=2 7
7
z = 6 7 ( 1= 2) 6 7=6 7 (30)
4 51 4 0 5 4 1 5
p
1 1= 2 1=2
2 3 2 p 3 2 3
1 2= 10 0:6325
6 7 6 p 7 6 7
2 6 1=2 7 6 1= 10 7 6 0:3162 7
q(2) = z(2) = z(2) 2 = p 6 7=6 p 7=6 7 (31)
10 4 1 5 4 2= 10 5 4 0:6325 5
p
1=2 1= 10 0:3162
2 p 3 2 3
0 2= 10 0 0:6325
6 1=p2 1=p10 7 6 0:7071 0:3162 7
6 p 7 =6
7 7
Q= 6 6 7 (32)
4 0 2= 10 5 4 0 0:6325 5
p p
1= 2 1= 10 0:7071 0:3162
" p p # " #
2 1= 2 1:4142 0:7071
R= p = (33)
0 5= 10 0 1:5811
2 3
" 1
p p #6 7 " #
1 0 5 0 5 6 1 7 1 0
QT b = p 6 7= p (34)
10 2 1 2 1 4 1 5 10 6
1
" p p #" # " # " #
2 1= 2 x1 1 0 6=10
p =p ) x= (35)
0 5= 10 x2 10 6 6=5
2 3 2 3
0 1 1:2
6 1 0 7 6 0:6 7
6 7 6 7
p = 6 7x =6 7 (36)
4 0 1 5 4 1:2 5
1 1 0:6
2 3
0:2
6 0:4 7
6 7
e= b p= 6 7 (37)
4 0:2 5
0:4
5
Note: It is possible that some students may have applied QR factorization to all
three columns of M without considering the linear dependence of the columns.
Only partial credit will be awarded for these calculations (3 marks for Q
matrix and 2 marks for R matrix).
Show that c1 (A); i.e. condition number of A based on the 1-norm, is a minimum
for b = 2=3. (8 marks)
6
Hint: Examine c1 (A) for the following scenarios: (i) jbj 2=3 and (ii) jbj > 2=3:
Note: Condition number based on in…nite norm is
1
c1 (A) = kAk1 A 1
where in…nite norm corresponds to the maximum over row sums of jaij j
" n #
M ax kAxk1 max X
jjAjj1 = = jaij j (38)
x 6= 0 kxk1 1 i m j=1
Soln.: " #
1 1 1 b
A =
b 1 2b
1 1 1
kAk1 = max f3 jbj ; 2g and A 1
= max + 1; +2
jbj jbj
Scenario jbj 2=3 :
1 1
kAk1 = max f3 jbj ; 2g = 2 and A 1
= +2
jbj
1
c1 (A) = 2 +2 =7
(2=3)
and for any jbj < 2=3; we have jbj = (2=3) " where 0 < " < 2=3 and
1
c1 (A) = 2 +2 >7
(2=3) "
Alternatively, for for any jbj < 2=3; we have 3 < 2=jbj and
2
c1 (A) = +4 >3+4=7
jbj
2
c1 (A) = +4
jbj
i.e. c1 (A) / 1=jbj and the smallest value of c1 (A) is achieved for the largest value jbj
can take over the interval.
7
Scenario jbj > 2=3 :
1 1
kAk1 = max f3 jbj ; 2g = 3 jbj and A 1
= +2
jbj
1
c1 (A) = 3 jbj +2 = 3 + 6 jbj
jbj
For any jbj > 2=3 we have jbj = (2=3) + " where " > 0 and
c1 (A) = 3 + 6 jbj
and c1 (A) / jbj: Thus, the smallest value of c1 (A) is achieved for the smallest value
of jbj in the interval.
Thus, the condition number of A based on the 1-norm, is a minimum for b = 2=3:
Common conceptual errors for which marks have been deducted:
(a) Forgot to use the mod operator while computing norm, i.e. the norms
were incorrectly computed as follows
1 1 1
kAk1 = max f3 b; 2g and A 1
= max + 1; + 2
b b
1 1 1
A 1
= max 1 ; +2
b b
Part 2.Q1 Consider the problem of Langmuir Hinselwood reaction occurring in a catalyst sphere
and modelled as ODE-BVP:
1 d du 2 u(E + u)
z2 = (0 < z < 1) (39)
z 2 dz dz (1 + Ku)2
8
du
B. C. at z = 0 : =0 (40)
dz z=0
B. C. at z = 1 : u(1) = 1 (41)
It is desired to use method of single shooting to solve the ODE-BVP. By suitably in-
troducing new state vector x, express them in standard form
dx=dz = f (x(z))
Further, Assuming that the resulting set of ODEs are solved using explicit Euler method
with step size of 0.1, develop an iteration scheme using the secant method for estimation
of the missing initial condition at z = 0. (State all the steps in the iteration scheme
including the FOR loop for explicit Euler integration). (7 marks)
Soln.:
d2 u 2 du 2 u(E + u)
+ = (0 < z < 1) (42)
dz 2 z dz (1 + Ku)2
Now, de…ning new state variables
du
x1 = u and x2 = (43)
dz
we can transform the above ODE as
" # 2 3
x2
d x1
= 4 2 x1 (E + x1 ) 5 f (x) (44)
dz x2 x2 + 2
z (1 + Kx1 )2
z = 0 : x2 (0) = 0 (45)
z = 1 : x1 (1) = 1 (46)
The single shooting method solves this problem by converting it into a sequence of
ODE-IVP problems as follows:
Step 1: Guess x1 (0) = " #
x(0) = (47)
0
Step 2: Integrate the two ODEs simultaneously using explicit Euler from z = 0 to z
= 1. Since z = 0:1; we
FOR k = 0 To 9
x(k + 1) = x(k) + 0:1 f (x(k))
END FOR
9
Step 3: Examine whether the given boundary condition, g( ) = x1 (z = 1) 1 =
x1 (10) 1 = 0; is satis…ed, i.e., stop iterations if jx1 (1) 1j < "; else go to Step 1.
De…ning
g( ) = x1 (1) 1 (48)
the value of can be changed from iteration to iteration by the secant method as
follows
(k) (k 1)
(k+1) (k) (k)
= g[ ] (k) ] (k 1) ]
(49)
g[ g[
Part 2.Q2 Consider a CSTR where a feed with unknown pH is ‡owing into the reactor. The
system dynamics is modelled using the following set of DAEs:
dX
= A BX 2 (50)
dt
Y 3 + CY 2 + ( X + )Y + D = 0
where X represents the concentration of the cation of the base in the CSTR, Y repre-
sents the hydrogen ion concentration and (A,B,C,D, ; ) represent model parameters.
It is desired to use the implicit Euler method to integrate this set of DAEs over in-
terval [tn ; tn + h] starting from initial condition ( X(n); Y (n)). Here, h represents the
integration interval. Derive two nonlinear algebraic equations that need to be solved
simultaneously to obtain ( X(n + 1); Y (n + 1)) using the implicit Euler method. Sub-
sequently, formulate a Gauss-Seidel based successive substitution type derivative free
iteration scheme for solving the resulting set of coupled nonlinear equations starting
from initial guess X (0) (n + 1); Y (0) (n + 1) (7 marks)
Soln.: Using implicit Euler, we have
10
One way to formulate G-S like iteration scheme is as follows:
Part 2.Q3 Consider the following PDE representing the unsteady state one dimensional heat trans-
fer across an in…nite slab with no heat generation and with thermal conductivity being
linear function of temperature
2
@u @2u @u
= (1 + au) 2 + a (0 z 1) (57)
@t @z @z
11
state the set of appropriate nonlinear algebraic equations that need to be solved simul-
taneously for …nding u2 (n + 1) i.e. u2 ( = 1). (8 marks)
Note: The S and T matrices for one internal collocation point at z2 = 0:5 are as
follows 2 3 2 3
3 4 1 4 8 4
6 7 6 7
S=4 1 0 1 5 ; T=4 4 8 4 5
1 4 3 4 8 4
Initial condition
u2 (0) = 0:5
The initial condition u2 (n) for the ODE-IVP is known. This gives one equation
12
Eliminating u21 from the last two equations, we get 2 equations in two unknowns
u2 (n + 1) = u2 ( = 1) = u23 (71)
k1 = B f (x(n))
k2 = B f (x(n) + bk1 )
where n = 0; 1; :::and
1
B = h (I ahJn )
@f
Jn =
@x x=x(n)
A student intends to use the solver following solving an ODE-IVP of the form
dx
= f (x(t)) = Ax(t)
dt
where A is an n n matrix. Assume that (a) matrix A is diagonalizable, i.e. D D 1
where is a diagonal matrix with eigenvalues of A appearing on the main diagonal,
(b) columns of D are eigenvectors of A and D is invertible, and (c) the eigenvalues
of A are strictly in the left half plane. Find conditions on the integration step size
’h’ (in terms of eigenvalues of matrix A) that must be satis…ed so that the norm of
the approximation error decays to zero and approximate solution approaches the true
solution. Note that the true solution evolves as follows
x (n + 1) = D exp(h )D 1 x (n)
13
(8 marks).
Soln.:
@f
f (t) = Ax(t) ) Jn = =A (72)
@x x=x(n)
1
k1 = Bf (n) = BAx(n) = h (I ahA) Ax(n)
Now, since A =D D 1 ;
1 1 1 1 1
(I ahA) A= DD ahD D D D = D [I ah ] D (80)
1 2 2 2 1
(I ahA) A = D [I ah ] D (81)
h 2
i
1 2 1
x(n + 1) = I + (c + d)h (I ahA) A+dbh (I ahA) A x(n) (82)
1 2
= D I + (c + d)h [I ah ] +dbh2 [I ah ] 2
D 1 x(n) (83)
The dynamics of the approximation error, e(n) = x(n) x (n); is governed by the
following matrix di¤erence equation
" # " #
e(n + 1) e(n)
= (85)
x (n + 1) x (n)
" #
M [exp(At) M]
= (86)
0 exp(At)
14
h 2
i
1 1
M = I + (c + d)h (I ahA) A+dbh2 (I ahA) A (87)
In order that ke(n)k ! 0 as n ! 1; then following condition should hold
where i is
2
h i i
i = 1 + (c + d) + dbh2 (89)
1 ah i 1 ah i
Thus, the convergence conditions for approximation errors can be stated as follows
2
h i i
1 + (c + d) + dbh2 < 1 for i = 1; 2; :::; n (90)
1 ah i 1 ah i
15