Question: In the back substitution, one solves for x from Ux = b, where the matrix U is upper triangular of size n by n. Now,
In the back substitution, one solves for x from Ux = b, where the matrix U is upper triangular of size n by n. Now, write a function performing the following kind of calculations (it is not for solving Ux = b, but is only a kind of matrix calculations). Given an upper triangular matrix U of size nn, a column vector b of length n, and a column vector g of length n. Calculate a column vector x of length n. To determine x_i , first perform a one-step back-substitution of Ux = b from row i, and obtain an intermediate solution denoted as t_i . Then, x_i is determined as follows:
x_i = { t_i , if t_i > g_i and g_i , otherwise.
Obtain the elements of x starting from the last element x_n to the first element x_1 using MATLAB. It is called a projected back solver.
x = pback(U,b,g).
U is the upper triangular coefficient matrix.
b is the right hand side vector.
g is the reference vector.
An example with n=3, where A is a 3x3 matrix, and b, g, and x are 3x1 matrices.
A= 1 2 3 b=5 g= 3 x =3
___0 4 5__6__ -2 _____-1
___0 0 6__ 6__ 2______2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
