Path: blob/master/material/linear-algebra-extra.ipynb
934 views
Kernel: Python 3 (ipykernel)
Extra material about Linear Algebra
In [6]:
Custom implementation of general gaussian method
In [7]:
In [8]:
Out[8]:
Augmented Matrix M:
[[0.5507979 0.70814782 0.29090474 0.51082761 0.89294695]
[0.89629309 0.12558531 0.20724288 0.0514672 0.44080984]
[0.02987621 0.45683322 0.64914405 0.27848728 0.6762549 ]
[0.59086282 0.02398188 0.55885409 0.25925245 0.4151012 ]]
Augmented Diagonal Matrix D:
[[ 5.50797903e-01 7.08147823e-01 2.90904739e-01 5.10827605e-01
8.92946954e-01]
[ 0.00000000e+00 -1.02675749e+00 -2.66135662e-01 -7.79783697e-01
-1.01224976e+00]
[ 0.00000000e+00 0.00000000e+00 5.24909828e-01 -6.69967089e-02
2.15310020e-01]
[ 0.00000000e+00 0.00000000e+00 -1.70372042e-16 1.00000000e+00
9.32073626e-03]]
Obtained solution:
[0.27395594 0.8721633 0.41137442 0.00932074]
Exact solution:
[[ 1.62118801 0.9962667 29.88822639 1.51125934]
[ 0.62248281 3.51004303 0.9649251 18.38095262]
[ 2.324661 3.26310322 1.041764 1.21007418]
[ 0.81260526 8.06535367 1.4905571 1.60114669]]
In [ ]: