1) a) Write a Matlab function program thomas(e.f.g.r.n) based on the pseudocode below which solves a tridiagonal system of n linear algebraic equations. Here e, f and g are vectors containing the tridiagonal elements of the coefficient matrix, r is the right hand side vector and x is the solution vector. €₂282 e3f 83 C-1 fn-1 B-1-1 e f. x₂ (a) Decomposition DOFOR K = 2, n ek = ex/fk-1. fk = fk - ek 9k-1 END DO (b) Forward substitution DOFOR K = 2, n rk = rk ek rk-l END DO (c) Back substitution Xn = rn /fn DOFOR k = n -1. 1, -1 Xx=(rk 9k Xx+1)/fk. END DO FIGURE 11.2 Pseudocode to implement the Thomas algorithm, an LU decomposition method for tridi- agonal systems, 7₂ 73 b) Write a Matlab main program which calls the function program developed in part (a) to solve the following tridiagonal system [X1 38-0 5 = 1 -2 3 -4 -6 c) Solve the tridiagonal system of equations in part (b) manually using the Thomas algorithm in part (a). Show the expression and the numerical value of each variable as it is computed. 2) After scaling the coefficient matrix given in problem (1b), calculate its (a) column-sum norm, (b) row-sum norm and (c) Euclidean (Frobeneus) norm.

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question

Please answer part(s) 1- (C) and 2

1) a) Write a Matlab function program thomas(e.f.g.r.n) based on the pseudocode below which
solves a tridiagonal system of n linear algebraic equations. Here e, fand g are vectors
containing the tridiagonal elements of the coefficient matrix, r is the right hand side vector and
x is the solution vector.
₁82
ef 83
C-1 fa-1 B-1-1
er
f. J x₂
(a) Decomposition
DOFOR K = 2, n
ek =
ex/fk-1.
fk = fk - ek 9k-1
END DO
(b) Forward substitution
DOFOR K = 2, n
rk = rk ek rk-I
END DO
(c) Back substitution
Xn = rn /fn
DOFOR k = n -1. 1, -1
Xx=(rk 9k Xx+1)/fk
END DO
FIGURE 11.2
Pseudocode to implement the
Thomas algorithm, an LU
decomposition method for tridi-
agonal systems.
7₂
73
b) Write a Matlab main program which calls the function program developed in part (a) to solve
the following tridiagonal system
1
3
[x1
5 x₂ =
-2
-4
-6 7
c) Solve the tridiagonal system of equations in part (b) manually using the Thomas algorithm in
part (a). Show the expression and the numerical value of each variable as it is computed.
2) After scaling the coefficient matrix given in problem (1b), calculate its (a) column-sum norm, (b)
row-sum norm and (c) Euclidean (Frobeneus) norm.
Transcribed Image Text:1) a) Write a Matlab function program thomas(e.f.g.r.n) based on the pseudocode below which solves a tridiagonal system of n linear algebraic equations. Here e, fand g are vectors containing the tridiagonal elements of the coefficient matrix, r is the right hand side vector and x is the solution vector. ₁82 ef 83 C-1 fa-1 B-1-1 er f. J x₂ (a) Decomposition DOFOR K = 2, n ek = ex/fk-1. fk = fk - ek 9k-1 END DO (b) Forward substitution DOFOR K = 2, n rk = rk ek rk-I END DO (c) Back substitution Xn = rn /fn DOFOR k = n -1. 1, -1 Xx=(rk 9k Xx+1)/fk END DO FIGURE 11.2 Pseudocode to implement the Thomas algorithm, an LU decomposition method for tridi- agonal systems. 7₂ 73 b) Write a Matlab main program which calls the function program developed in part (a) to solve the following tridiagonal system 1 3 [x1 5 x₂ = -2 -4 -6 7 c) Solve the tridiagonal system of equations in part (b) manually using the Thomas algorithm in part (a). Show the expression and the numerical value of each variable as it is computed. 2) After scaling the coefficient matrix given in problem (1b), calculate its (a) column-sum norm, (b) row-sum norm and (c) Euclidean (Frobeneus) norm.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,