cell
INPUT
yes
screen
OUTPUT
lf
swiss13
on
~\n
1
nolist
fmt
\n\N\n\S\n
yes
test
1
yes
fixed
3
degrees
off
5.000
-5.000
5.000
-5.000
5
5
home,home
a00
5 |
a01
6 |
a02
-7 |
a03
8 |
a10
0.800 |
a11
-8.800 |
a12
22.600 |
a13
-3.400 |
a20
0.400 |
a21
-0.182 |
a22
15.909 |
a23
-5.818 |
a30
0.200 |
a31
-0.091 |
a32
0.406 |
a33
-3.549 |
b0
-0.134 |
b1
0.779 |
b2
-0.151 |
b3
-0.258 |
big
0.887 |
dum
0.887 |
home
This web solves a non-singular set of four linear equations in four unknowns:
a00*x0+a01*x1+a02*x2+a03*x3=b0
a10*x0+a11*x1+a12*x2+a13*x3=b1
a20*x0+a21*x1+a22*x2+a23*x3=b2
a30*x0+a31*x1+a32*x2+a33*x3=b3
using an LU decomposition algorithm.
To print solution values of x0,x1,x2,and x3, put the values of the aij elements in row/column order into the text field of the input cell. Put the four b's after that. Then return to home and choose execute from the special menu.
The algorithm for this example is described in the First edition of "Numerical Recipies in C", Section 2.3 LU Decomposition.
|
idex
0.000 |
ii
0 |
imax
3.000 |
indx0
1.000 |
indx1
2.000 |
indx2
3.000 |
indx3
3.000 |
input
1 2 3 - 4 #row1
5 6 -7 8 #row2
4 -4 17 3 #row3
2 4 9 -2 #row4
2 3 -7 2
0.00
|
ip
3.000 |
jdex
3.000 |
kdex
2.000 |
loop1
|
loop2
|
loop3
|
lubksb
|
ludcmp
|
matrixout
|
output
|
scale
|
solve
|
sum
-0.672 |
temp
2.000 |
tiny
0.0000000001
|
vv0
0.250 |
vv1
0.250 |
vv2
0.250 |
vv3
0.250 |