Upper-Triangular Matrix transform and solving Using Back-Substitution in c++

Posted By: Java Examples - 9:08 AM

Share

& Comment

Definition (Upper-Triangular Matrix).  

An [Graphics:Images/BackSubstitutionMod_gr_1.gif] matrix [Graphics:Images/BackSubstitutionMod_gr_2.gif] is called upper-triangular provided that the elements satisfy [Graphics:Images/BackSubstitutionMod_gr_3.gif] whenever [Graphics:Images/BackSubstitutionMod_gr_4.gif].  
    If A is an upper-triangular matrix, then [Graphics:Images/BackSubstitutionMod_gr_5.gif] is said to be an upper-triangular system of linear equations.  

(1)    [Graphics:Images/BackSubstitutionMod_gr_6.gif]    



Suppose that  [Graphics:Images/BackSubstitutionMod_gr_7.gif]  is an upper-triangular system with the form given above in (1).  If  [Graphics:Images/BackSubstitutionMod_gr_8.gif] for [Graphics:Images/BackSubstitutionMod_gr_9.gif] then there exists a unique solution.

The back substitution algorithm. 

To solve the upper-triangular system [Graphics:Images/BackSubstitutionMod_gr_10.gif] by the method of back-substitution. Proceed with the method only if all the diagonal elements are nonzero. First compute  

    [Graphics:Images/BackSubstitutionMod_gr_11.gif]  

and then use the rule  

    [Graphics:Images/BackSubstitutionMod_gr_12.gif]   for  [Graphics:Images/BackSubstitutionMod_gr_13.gif]
    
Or, use the "generalized rule"  

    [Graphics:Images/BackSubstitutionMod_gr_14.gif]   for  [Graphics:Images/BackSubstitutionMod_gr_15.gif]

where the "understood convention" is that [Graphics:Images/BackSubstitutionMod_gr_16.gif] is an "empty summation" because the lower index of summation is greater than the upper index of summation.

Remark. The loop control structure will permit us to use one formula.  

C++ programming Code :



Output of program :

Enter the size Of Matrix
3
Enter the matrix by rows
x[0][0]
1
x[0][1]
-2
x[0][2]
1
x[1][0]
0
x[1][1]
1
x[1][2]
6
x[2][0]
0
x[2][1]
0
x[2][2]
1
Enter the Element into b[0] =
4
Enter the Element into b[1] =
-1
Enter the Element into b[2] =
2
1       -2      1
0       1       6
0       0       1
Soluation of Ax=b is X[0] = -24
Soluation of Ax=b is X[1] = -13
Soluation of Ax=b is X[2] = 2
Press any key to continue . . .


About Java Examples

I’m passionate about Web Development and Programming and I go to extreme efforts to meet my passion. I’m a believer of learning the fundamentals first. I try to understand everything little bit more than the average.

0 comments :

Post a Comment

Copyright © 2016 C++ Examples ACHCHUTHAN.ORG. Designed by Templateism .