| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
13.15 Examples
The following program solves the linear system A x = b. The system to be solved is, and the solution is found using LU decomposition of the matrix A.
|
Here is the output from the program,
x = -4.05205 -12.6056 1.66091 8.69377 |
This can be verified by multiplying the solution x by the original matrix A using GNU OCTAVE,
octave> A = [ 0.18, 0.60, 0.57, 0.96;
0.41, 0.24, 0.99, 0.58;
0.14, 0.30, 0.97, 0.66;
0.51, 0.13, 0.19, 0.85 ];
octave> x = [ -4.05205; -12.6056; 1.66091; 8.69377];
octave> A * x
ans =
1.0000
2.0000
3.0000
4.0000
|
This reproduces the original right-hand side vector, b, in accordance with the equation A x = b.
