“Talk is cheap. Show me the code.”
― Linus Torvalds
老子第41章
上德若谷
大白若辱
大方無隅
大器晚成
大音希聲
大象無形
道隱無名
拳打千遍, 身法自然
“There’s no shortage of remarkable ideas, what’s missing is the will to execute them.” – Seth Godin
「很棒的點子永遠不會匱乏,然而缺少的是執行點子的意志力。」—賽斯.高汀
本系列文章之連結
-
用 Python+Numpy+scipy 執行 Matlab 的矩陣計算 1 Python科學計算第三方庫, 原生指令, 內建模組, 外部模組 link
-
用 Python+Numpy+scipy 執行 Matlab 的矩陣計算 2 產生 numpy 的 數組, 矩陣點乘 等 link
-
用 Python+Numpy+scipy 執行 Matlab 的矩陣計算 3 向量與矩陣運算 link
-
用 Python+Numpy+scipy 執行 Matlab 的矩陣計算 4 函數向量化 function vectorized
link
文章目录
求解線性聯立方程組之迭代法
迭代法起源於19世紀末, 在小尺度的求解線性聯立方程組, 較少用, 因為時間遠比直接法要久,
但是對於大型線性聯立方程組且要求高精度且帶有 0 的entry, 迭代法運用計算機的效能要遠高於直接法,
迭帶法意指透過同樣的演算程序一直迭帶, 得到越來越精確的解,
類似固定點定理的想法, 求解的步驟, 形如 一個迭代函數:
x
(
k
)
=
T
x
(
k
−
1
)
+
c
,
where
x
0
is some initial vector
.
x^{(k)}=T x^{(k-1)} + c , \text{where } x^0 \text{ is some initial vector}.
x(k)=Tx(k−1)+c,where x0 is some initial vector.
通過輸入一個任意或適當之起始向量
x
0
x^0
x0, 不斷進行迭代, 得到越來越精確的近似解.
直接法就不是逐步逼近, 而是透過一定計算步驟之後就得到精確解, 例如 中學熟知的 Gauss Elimination, 高斯消去法 等等.
References
-
R. L. Burden, J. D. Faires, Numerical analysis, Brooks/Cole, 7th ed., 2001.
-
Clever B Moler, Numerical computing with Matlab
Moler的書: Ch2 線性代數 -
Python Numpy全世界最長基礎教程最適合小白學習 還詳細很全速拿, https://twgreatdaily.com/AhWyTG8BMH2_cNUgWU4g.html link.
-
推薦: 這裡有很具體的指令用法, 用在線性代數課程上: 陳擎文教學網:python解線性代數, https://acupun.site/lecture/linearAlgebra/index.htm link
-
https://www.codesansar.com/numerical-methods/gauss-jordan-method-python-program-output.htm link
有現成的數值計算的Python codes -
河西朝雄