Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 116
FreeSandal | 輕。鬆。學。部落客 | 第 200 頁

光的世界︰派生科學計算六‧上

過去我們曾經談過伽利略變換︰

如果從『伽利略變換』如何『觀察』這個『相對性』的意義的呢?假設以『□觀察者(x_{\Box}, t_{\Box}) 為『靜止』,『□觀察者』見『○觀察者(x_{\bigcirc}, t_{\bigcirc}) 以『速度v 向右運動,假使他們彼此能『交換資訊』,同意兩者的『原點』相同,那麼他們對『時空現象』或者說『事件』的『位置‧時間』描述滿足

\begin{bmatrix} x_{\bigcirc} \\ t_{\bigcirc} \end{bmatrix} = G_v \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix} = \begin{pmatrix} 1 & -v \\0 & 1 \end{pmatrix} \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix}

。『□觀察者』的『原點(0, t_{\Box}) 對『□觀察者』是『靜止』的,然而對『○觀察者』而言,是 x_{\bigcirc} = - v \cdot t_{\Box}t_{\bigcirc} = t_{\Box} ,它以『速度v等速向左』 運動。其次對於『□觀察者』而言,所發生的『同時兩事件(x_{\Box}^1, t_{\Box})  與 (x_{\Box}^2, t_{\Box}) ,對『○觀察者』而言,是 (x_{\Box}^1 - v \cdot t_{\Box}, t_{\Box})(x_{\Box}^2 - v \cdot t_{\Box}, t_{\Box}) 也是『同時的』。既然『運動是相對的』,假使我們以『○觀察者』為『靜止』,來作個『伽利略變換』的『物理檢驗』, 那麼 \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix} = G_{-v} \begin{bmatrix} x_{\bigcirc} \\ t_{\bigcirc} \end{bmatrix} 當是應該的了。也就是說 G_{-v} = {G_v}^{-1} = \begin{pmatrix} 1 & v \\0 & 1 \end{pmatrix},讀者自己可以『確證\begin{pmatrix} 1 & v \\0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & - v \\0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & - v \\0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & v \\0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\0 & 1 \end{pmatrix} 它的『正確性』。也可以說『物理之要求』不得不決定了『數學的表達式』的吧!,所謂的『自然律』並不『必須』要『滿足』這種或那種『數學』的耶!!如果說『○觀察者』觀測某一個『星辰(x_{\star}, t_{\star})w 的『速度』向右『直線運動』,那麼這一個『星辰』相對於『□觀察者』的『速度』是什麼的呢?『直覺上』我們認為既然『★ 對 ○ 是 w 向右,○ 對 □ 是 v 向右』,那麼『★ 對 ○ 該是 w + v 向右』的吧!我們可以用『伽利略變換』計算如下

\begin{bmatrix} x_{\bigcirc} \\ t_{\bigcirc} \end{bmatrix} = G_v \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix} = \begin{pmatrix} 1 & -v \\0 & 1 \end{pmatrix} \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix}

\begin{bmatrix} x_{\star} \\ t_{\star} \end{bmatrix} = G_w \begin{bmatrix} x_{\bigcirc} \\ t_{\bigcirc} \end{bmatrix} = \begin{pmatrix} 1 & -w \\0 & 1 \end{pmatrix} \begin{bmatrix} x_{\bigcirc} \\ t_{\bigcirc} \end{bmatrix}

=  \begin{pmatrix} 1 & -w \\0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & -v \\0 & 1 \end{pmatrix} \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix}

=  \begin{pmatrix} 1 & -(w+v) \\0 & 1 \end{pmatrix} \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix}

=  G_{(w+v)} \begin{bmatrix} x_{\Box} \\ t_{\Box} \end{bmatrix}

,果真是『符合直覺』的勒!!

─── 摘自《【Sonic π】電聲學之電路學《四》之《 !!!! 》下

 

現今如果使用符號運算作回顧︰

pi@raspberrypi:~ 
*** QuickLaTeX cannot compile formula:
ipython3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from sympy import *

In [2]: init_printing()

In [3]: xα, xβ, xγ, yα, yβ, yγ, v, w = symbols('xα, xβ, xγ, yα, yβ, yγ, v, w')

In [4]: 伽利略變換 = Matrix([[1, -v], [0, 1]])

In [5]: 伽利略變換
Out[5]: 
⎡1  -v⎤
⎢     ⎥
⎣0  1 ⎦

In [6]: 伽利略變換.inv()
Out[6]: 
⎡1  v⎤
⎢    ⎥
⎣0  1⎦

In [7]: 伽利略變換.det()
Out[7]: 1

In [8]: 伽利略變換.inv().det()
Out[8]: 1

In [9]: G = Matrix([[1, -w], [0, 1]])

In [10]: G
Out[10]: 
⎡1  -w⎤
⎢     ⎥
⎣0  1 ⎦

In [11]: G * 伽利略變換
Out[11]: 
⎡1  -v - w⎤
⎢         ⎥
⎣0    1   ⎦

In [12]: 伽利略變換 * G
Out[12]: 
⎡1  -v - w⎤
⎢         ⎥
⎣0    1   ⎦

In [13]: 
</pre>
 

<span style="color: #003300;">貌似簡單了!!卻也讓人懷疑論述『座標系』之選取,為什麼僅止於『平移』的呢??</span>
<h1 id="firstHeading" class="firstHeading" lang="zh-TW"><span style="color: #003300;"><a style="color: #003300;" href="https://zh.wikipedia.org/zh-tw/%E5%B9%B3%E7%A7%BB">平移</a></span></h1>
<span style="color: #808080;">在<a class="mw-redirect" style="color: #808080;" title="仿射幾何" href="https://zh.wikipedia.org/wiki/%E4%BB%BF%E5%B0%84%E5%87%A0%E4%BD%95">仿射幾何</a>,<b>平移</b>(translation)是將物件的每<a class="mw-redirect" style="color: #808080;" title="點" href="https://zh.wikipedia.org/wiki/%E9%BB%9E">點</a>向同一方向移動相同距離。</span>

<span style="color: #808080;">它是<a class="mw-redirect" style="color: #808080;" title="等距同構" href="https://zh.wikipedia.org/wiki/%E7%AD%89%E8%B7%9D%E5%90%8C%E6%A7%8B">等距同構</a>,是<a style="color: #808080;" title="仿射空間" href="https://zh.wikipedia.org/wiki/%E4%BB%BF%E5%B0%84%E7%A9%BA%E9%97%B4">仿射空間</a>中<a style="color: #808080;" title="仿射變換" href="https://zh.wikipedia.org/wiki/%E4%BB%BF%E5%B0%84%E5%8F%98%E6%8D%A2">仿射變換</a>的一種。它可以視為將同一個<a style="color: #808080;" title="向量" href="https://zh.wikipedia.org/wiki/%E5%90%91%E9%87%8F">向量</a>加到每點上,或將坐標系統的中心移動所得的結果。即是說,若<span class="mwe-math-mathml-inline mwe-math-mathml-a11y">  </span><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/35c1866e359fbfd2e0f606c725ba5cc37a5195d6" alt="\mathbf {v} " />是一個已知的向量,<span class="mwe-math-mathml-inline mwe-math-mathml-a11y">  </span><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/dd73e3862cb92b016721b8c492eadb4e8a577527" alt="\mathbf{p}" />是空間中一點,平移 <img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d2ef190970526b4786ba110e009049bb934d3015" alt="T_{{{\mathbf {v}}}}({\mathbf {p}})={\mathbf {p}}+{\mathbf {v}}" />。</span>

<span style="color: #808080;">將同一點平移兩次,結果可用一次平移表示,即 <img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/53b693a74c20fc4905434fc29332de3d33ab61ff" alt="T_{{{\mathbf {v}}}}(T_{{{\mathbf {u}}}}({\mathbf {p}}))=T_{{{\mathbf {v}}+{\mathbf {u}}}}({\mathbf {p}})" />,因此所有平移的集是一個<a style="color: #808080;" title="群" href="https://zh.wikipedia.org/wiki/%E7%BE%A4">群</a>,稱為<b>平移群</b>。這個群和空間同構,又是<a class="new" style="color: #808080;" title="歐幾里德群(頁面不存在)" href="https://zh.wikipedia.org/w/index.php?title=%E6%AD%90%E5%B9%BE%E9%87%8C%E5%BE%B7%E7%BE%A4&action=edit&redlink=1">歐幾里德群</a>E(n)的<a style="color: #808080;" title="正規子群" href="https://zh.wikipedia.org/wiki/%E6%AD%A3%E8%A7%84%E5%AD%90%E7%BE%A4">正規子群</a>。</span>

<span style="color: #808080;">T對E的<a style="color: #808080;" title="商群" href="https://zh.wikipedia.org/wiki/%E5%95%86%E7%BE%A4">商群</a>與<a style="color: #808080;" title="正交群" href="https://zh.wikipedia.org/wiki/%E6%AD%A3%E4%BA%A4%E7%BE%A4">正交群</a>O(n)同構:E(n) / T = O(n)。</span>

<img class="alignnone size-full wp-image-56644" src="http://www.freesandal.org/wp-content/uploads/220px-TraslazioneOK.png" alt="220px-TraslazioneOK" width="220" height="197" />

<span style="color: #808080;">平移將物件的每一點向同一方向移動相同距離。</span>

<span style="color: #808080;">………</span>

 

<span style="color: #003300;">難到『觀察者』之間的『座標系』不能『旋轉』的耶!!或許原因在於物理學比較專注於『相對性』原理。若是同時考慮『時間』之『平移』與『空間』之『旋轉』,恐怕難以簡明『表達』重要概念也??!!</span>
<h1 id="firstHeading" class="firstHeading" lang="zh-TW"><span style="color: #003300;"><a style="color: #003300;" href="https://zh.wikipedia.org/zh-tw/%E5%8F%98%E6%8D%A2%E7%9F%A9%E9%98%B5">變換矩陣</a></span></h1>
<span style="color: #808080;"><b>變換矩陣</b>是<a style="color: #808080;" title="數學" href="https://zh.wikipedia.org/wiki/%E6%95%B0%E5%AD%A6">數學</a><a style="color: #808080;" title="線性代數" href="https://zh.wikipedia.org/wiki/%E7%BA%BF%E6%80%A7%E4%BB%A3%E6%95%B0">線性代數</a>中的一個概念。</span>

<span style="color: #808080;">在<a style="color: #808080;" title="線性代數" href="https://zh.wikipedia.org/wiki/%E7%BA%BF%E6%80%A7%E4%BB%A3%E6%95%B0">線性代數</a>中,<a class="mw-redirect" style="color: #808080;" title="線性變換" href="https://zh.wikipedia.org/wiki/%E7%BA%BF%E6%80%A7%E5%8F%98%E6%8D%A2">線性變換</a>能夠用<a style="color: #808080;" title="矩陣" href="https://zh.wikipedia.org/wiki/%E7%9F%A9%E9%98%B5">矩陣</a>表示。如果<i>T</i>是一個把<b>R</b><sup><i>n</i></sup>映射到<b>R</b><sup><i>m</i></sup>的線性變換,且<i>x</i>是一個具有<i>n</i>個元素的<a style="color: #808080;" title="行向量" href="https://zh.wikipedia.org/wiki/%E8%A1%8C%E5%90%91%E9%87%8F">行向量</a>,那麼</span>

<dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ea38c119a0e701d009f7fc67b29f4064830d61b0" alt="T({\vec x})={\mathbf {A}}{\vec x}" /></span></dd></dl><span style="color: #808080;">我們把<i>m</i>×<i>n</i>的矩陣<b>A</b>,稱為<b><i>T</i>的變換矩陣</b>。</span>

<span style="color: #808080;">……</span>
<h2><span id=".E5.9C.A8.E4.BA.8C.E7.BB.B4.E5.9B.BE.E5.BD.A2.E4.B8.AD.E7.9A.84.E5.BA.94.E7.94.A8.E7.A4.BA.E4.BE.8B" class="mw-headline" style="color: #808080;">在二維圖形中的應用示例</span></h2>
<span style="color: #808080;">最為常用的幾何變換都是線性變換,這包括旋轉、縮放、切變、反射以及正投影。在二維空間中,線性變換可以用2×2的變換矩陣表示。</span>
<h3><span id=".E6.97.8B.E8.BD.AC" class="mw-headline" style="color: #ff9900;">旋轉</span></h3>
<span style="color: #808080;">繞原點逆時針<a style="color: #808080;" title="旋轉" href="https://zh.wikipedia.org/wiki/%E6%97%8B%E8%BD%AC">旋轉</a>θ度角的變換公式是 <img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ea2a2afb8c2c5d404999fe1d9be93838cba5dc4c" alt="x'=x\cos \theta -y\sin \theta " />與 <img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/76867df645419a8c64b041271ed4b4cfb968cd09" alt="y'=x\sin \theta +y\cos \theta " />,用矩陣表示為:</span>

<dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8bcb27df8481ac7603f4f914ad707c9ee1be7393" alt="{\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}\cos \theta &-\sin \theta \\\sin \theta &\ cos\theta \end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}" /></span></dd></dl>
<h3><span id=".E7.BC.A9.E6.94.BE" class="mw-headline" style="color: #ff9900;">縮放</span></h3>
<span style="color: #808080;"><a style="color: #808080;" title="縮放" href="https://zh.wikipedia.org/wiki/%E7%BC%A9%E6%94%BE">縮放</a>(反矩陣)公式為 <img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/96c5df9ada8e915668be98d23166db655aae37d1" alt="x'=s_{x}\cdot x" />與<span class="mwe-math-mathml-inline mwe-math-mathml-a11y">  </span><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/39654008a50b6a5670519b77a7534bcff57dea88" alt="y'=s_{y}\cdot y" />,用矩陣表示為:</span>

<dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/59986dd440056bdb15436fadfa7cba331970c3b5" alt="{\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}s_{x}&0\\0&s_{y}\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}" /></span></dd></dl>
<h3><span id=".E5.88.87.E5.8F.98" class="mw-headline" style="color: #ff9900;">切變</span></h3>
<span style="color: #808080;"><a class="mw-redirect" style="color: #808080;" title="切變" href="https://zh.wikipedia.org/wiki/%E5%88%87%E5%8F%98">切變</a>有兩種可能的形式,平行於<i>x</i>軸的切變為 <img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4e6308dc0c636bf11db1c7a9eb205fe7643c23fd" alt="x'=x+ky" />與<span class="mwe-math-mathml-inline mwe-math-mathml-a11y">  </span><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e6239f12a70a7f715303934acf9dbae208fceb80" alt="y'=y" />,矩陣表示為:</span>

<dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f624067705d7c2fd3fe7617b7cfefe8fdbb8fed6" alt="{\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}1&k\\0&1\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}" /></span></dd></dl><span style="color: #808080;">平行於<i>y</i>軸的切變為<span class="mwe-math-mathml-inline mwe-math-mathml-a11y">  </span><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/62cc09be3190c7464511712d6a1ba96481f83fa2" alt="x'=x" />與 <img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fe73a538387223e1fc7b740f25df55eaaff2b080" alt="y'=y+kx" />,矩陣表示為:</span>

<dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/900b7271f454574d08bcde375fc9332b702a10d0" alt="{\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}1&0\\k&1\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}" /></span></dd></dl>
<h3><span id=".E5.8F.8D.E5.B0.84" class="mw-headline" style="color: #ff9900;">反射</span></h3>
<span style="color: #808080;">為了沿經過原點的直線反射向量,假設(<i>u<sub>x</sub></i>, <i>u<sub>y</sub></i>)為直線方向的<a style="color: #808080;" title="單位向量" href="https://zh.wikipedia.org/wiki/%E5%8D%95%E4%BD%8D%E5%90%91%E9%87%8F">單位向量</a>。變換矩陣為:</span>

<dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2b68732b304cddf27e113ac8d5d4bbdfcad6bdc4" alt="{\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}2u_{x}^{2}-1&2u_{x}u_{y}\\2u_{x}u_{y}&2u_{y}^{2}-1\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}" /></span></dd></dl><span style="color: #808080;">不經過原點的直線的反射是仿射變換,而不是線性變換。</span>
<h3><span id=".E6.AD.A3.E6.8A.95.E5.BD.B1" class="mw-headline" style="color: #ff9900;">正投影</span></h3>
<span style="color: #808080;">為了將向量正投影到一條經過原點的直線,假設(<i>u<sub>x</sub></i>, <i>u<sub>y</sub></i>)是直線方向的<a style="color: #808080;" title="單位向量" href="https://zh.wikipedia.org/wiki/%E5%8D%95%E4%BD%8D%E5%90%91%E9%87%8F">單位向量</a>,變換矩陣為:</span>

<dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d9b12205261ce87af35f4f47843116cb4496bfeb" alt="{\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}u_{x}^{2}&u_{x}u_{y}\\u_{x}u_{y}&u_{y}^{2}\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}" /></span></dd></dl><span style="color: #808080;">同反射一樣,正投影到一條不經過原點的直線的變換是仿射變換,而不是線性變換。</span>

<span style="color: #808080;"><a class="new" style="color: #808080;" title="平行投影(頁面不存在)" href="https://zh.wikipedia.org/w/index.php?title=%E5%B9%B3%E8%A1%8C%E6%8A%95%E5%BD%B1&action=edit&redlink=1">平行投影</a>也是線性變換,也可以用矩陣表示。但是<a style="color: #808080;" title="透視投影" href="https://zh.wikipedia.org/wiki/%E9%80%8F%E8%A7%86%E6%8A%95%E5%BD%B1">透視投影</a>不是線性變換,必須用齊次坐標表示。</span>

<span style="color: #808080;">───</span>

 

<span style="color: #003300;">從『變換矩陣』看『旋轉』,總是有『零點』

*** Error message:
Missing $ inserted.
Missing $ inserted.
leading text: In [2]: init_
Missing $ inserted.
Unicode character α (U+03B1)
leading text: In [3]: xα
Unicode character β (U+03B2)
leading text: In [3]: xα, xβ
Unicode character γ (U+03B3)
leading text: In [3]: xα, xβ, xγ
Unicode character α (U+03B1)
leading text: In [3]: xα, xβ, xγ, yα
Unicode character β (U+03B2)
leading text: In [3]: xα, xβ, xγ, yα, yβ
Unicode character γ (U+03B3)
leading text: In [3]: xα, xβ, xγ, yα, yβ, yγ
Unicode character α (U+03B1)
leading text: ..., xγ, yα, yβ, yγ, v, w = symbols('xα
Unicode character β (U+03B2)
leading text: ..., yα, yβ, yγ, v, w = symbols('xα, xβ
Unicode character γ (U+03B3)
leading text: ..., yβ, yγ, v, w = symbols('xα, xβ, xγ

T \cdot \vec{0} = \vec{0}的,如是2 x 2$ 之矩陣豈足以兼顧『平移』和『旋轉』乎 !!??終究還是得進入『仿射空間』的矣︰

仿射空間,又稱線性流形,是數學中的幾何結構,這種結構是歐式空間仿射特性的推廣。在仿射空間中,點與點之間做差可以得到向量,點與向量做加法將得到另一個點,但是點與點之間不可以做加法。

非正式描述

下面的非正式描述可能比正式的定義容易理解一些:仿射空間是沒有起點只有方向大小的向量所構成的向量空間。假設有甲乙兩人,其中甲知道一個空間中真正的原點,但是乙認為另一個點p才是原點。現在求兩個向量ab的和。乙畫出papb的箭頭,然後用平行四邊形找到他認為的向量a + b。但是甲認為乙畫出的是向量p +(ap) +(bp)。同樣的,甲和乙可以計算向量ab線性組合,通常情況下他們會得到不同的結果。然而,請注意:

如果線性組合係數的和為1,那麼甲和乙將得到同樣的結果!

仿射空間就是這樣產生的:甲知道空間的「線性結構」。但是甲和乙都知道空間的「仿射結構」,即他們都知道空間中仿射組合的值,其中仿射組合的定義為係數和為1的線性組合。

如果乙:λa + (1 − λ)b 則甲為:p + λ(a − p) + (1 − λ)(b − p) = λa + (1 − λ)b.

那麼對於所有滿足λ + (1 − λ) = 1的係數,即使從不同的原點開始,甲乙將以同樣的線性組合描述同樣的點

具有仿射結構的集合就是一個仿射空間。

───

仿射變換

仿射變換,又稱仿射映射,是指在幾何中,一個向量空間進行一次線性變換並接上一個平移,變換為另一個向量空間。

一個對向量  {\vec {x}}平移 {\vec {b}},與旋轉放大縮小 A {\displaystyle A}  A的仿射映射為

{\vec {y}}=A{\vec {x}}+{\vec {b}}

上式在齊次座標上,等價於下面的式子

{\begin{bmatrix}{\vec {y}}\\1\end{bmatrix}}={\begin{bmatrix}A&{\vec {b}}\ \\0,\ldots ,0&1\end{bmatrix}}{\begin{bmatrix}{\vec {x}}\\1\end{bmatrix}}

碎形的研究裡,收縮平移仿射映射可以製造製具有自相似性碎形

200px-Fractal_fern_explained

一個使用仿射變換所製造有自相似性的碎形

……

表示

如上所示,仿射變換為兩函數的複合平移線性映射。普通向量代數用矩陣乘法呈現線性映射, 用向量加法表示平移。正式言之,於有限維度之例中,假如該線性映射被表示為一矩陣「A」,平移被表示為向量  \vec{b},一仿射映射 f可被表示為

{\vec {y}}=f({\vec {x}})=A{\vec {x}}+{\vec {b}}.

增廣矩陣

使用一 增廣矩陣 與一增廣向量, 用一矩陣乘法同時表示平移與線性映射是有可能的。此技術需要所有向量在其末端擴長 「1」且所有矩陣都於底部添加一排零,右邊擴長一列轉換向量,及右下角添加一個 「1」。

{\displaystyle {\begin{bmatrix}{\vec {y}}\\1\end{bmatrix}}=\left[{\begin{array}{ccc|c}\,&A&&{\vec {b}}\ \\0&\ldots &0&1\end{array}}\right]{\begin{bmatrix}{\vec {x}}\\1\end{bmatrix}}}

等價於y → = A x → + b → . {\displaystyle {\vec {y}}=A{\vec {x}}+{\vec {b}}.} {\vec {y}}=A{\vec {x}}+{\vec {b}}.

以上所言之擴長矩陣被稱為 「仿射變換矩陣」,又或稱為 「投射變換矩陣」 (其可應用於 投影轉換).

此表示法以 Kn半直積 與 GL(n, k)展示了 所有可逆 仿射變換的集合。 此為一個於眾函數集結下進行的一個 , 被稱為 仿射群

普通矩陣向量乘法總將原點映射至原點,因此無法呈現平移(原點必須映射至其他點)。藉由於所有向量上擴增一座標 「1」,我們將原空間映至更高維空間的一個子集合以進行變換。在該空間中,原本之空間佔有了擴長座標一的1的子集合。 因此原空間的原點可在(0,0, ... 0, 1). 原空間的平移可藉由更高維度空間的線性轉換來達成(即為錯切變換)。在高維度中的座標即為 齊次座標的一例。 假如原空間為歐幾里德, 則更高維空間為實射影空間.

使用齊次座標的優點為,藉由相對應矩陣之乘積,可將任意數目的仿射變換結合為一。此性質被大量運用於 計算機圖形, 計算機視覺機器人學

 

二維平面上的仿射變換可呈現於三維空間中。平移即為沿著z軸的錯切,旋轉則以z軸為軸心

 

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算五

《花非花》白居易

花非花,霧非霧,
夜半來,天明去,
來如春夢無多時,
去似朝雲無覓處。

 

香山居士這首詩別出心裁,令人想入非非。莫非

美人花,花非花,似花花解語。
彩雲霧,霧非霧,比霧霧生霞。
春夢恐醒,韶光將逝,如電亦如霧。
朝雲易散,彩霞難留,來去無覓處。

 

。引人『悟』悟吾心乎??感嘆人生幾何耶!!

幾人曾賞霧中花?
飄香方知花是花!
春夢朝雲花中霧!
何時才曉霧是霧?

 

暑中偶偶風雨突至,雷電交加,正是讚嘆自然現象之際,恰合說此萬花尺之時︰

萬花筒非筒?萬花尺非尺!
那位乘天光!千度百回!!
這位伴銀河!百媚千嬌!!
莫要問︰乾坤尺筒何時有??
無須答︰天地筒尺幾曾無!!

 

一八八零年代波蘭數學家 Bruno Abakanowicz 發明了『螺旋圖』Spirograph 。一九六四年英國工程師德尼斯‧費舍爾 Denys Fisher 發現使用多種『大小比值』不同的兩個內外『圓形齒輪』,當『內小圓形齒輪』上不同的『筆洞位置』在『外大圓形齒輪』上『循著圓周』轉動時,可以畫出各種美麗的『內旋輪線』 hypotrochoid 以及『外旋輪線 』epitrochoid。在經過一番齒輪『大小比值』與筆洞『位置比值』的研究後,費舍爾於隔年一九六五年的德國 Nuremberg 國際玩具展將之發表上市。由於它所繪出的『圖案』令人聯想到『萬花筒』 ,所以被我們叫做『萬花尺』。這是一個曾經『流行』過的『益智玩具』,其實它是了解『周期運動』組合的『複雜性』很好的『工具』。萬花尺內旋輪線的參數方程式可以表示為

\begin{array}{rcl} x(t)&=&R\left[(1-k)\cos t+lk\cos \frac{1-k}{k}t\right] ,\\[4pt] y(t)&=&R\left[(1-k)\sin t-lk\sin \frac{1-k}{k}t\right] .\\\end{array}

此處 R 是『外大齒輪』的半徑,k=\frac{r}{R} 是大小齒輪的『半徑比0\le k \le 1l=\frac{\rho}{r} 是筆洞所在位置到『內小齒輪』圓心的距離與『內小齒輪』半徑的比值 0\le l \le 1

網路上有一個『Spirograph Art』的網頁,假使讀者有興趣的話,不妨前去看看。

HypotrochoidOutThreeFifths

220px-Ellipse_as_hypotrochoid

200px-Spirograph

120px-Hypotrochoid2_2

120px-Epitrochoid_3

─── 摘自《萬花尺 Spirograph Art

 

自己圖繪數理之境,欣賞科學之美也!!??

雖說 IPython 的筆記本很好用,只因擷圖麻煩,字小恐或難讀,

 

利薩茹圖形

 

因此不易展示程式碼,故而每每以 Shell 為範。由於操作上大同小異﹐尚祈無礙矣。

 

【參考資料】

Plotting Module

Introduction

The plotting module allows you to make 2-dimensional and 3-dimensional plots. Presently the plots are rendered using matplotlib as a backend. It is also possible to plot 2-dimensional plots using a TextBackend if you don’t have matplotlib.

The plotting module has the following functions:

  • plot: Plots 2D line plots.
  • plot_parametric: Plots 2D parametric plots.
  • plot_implicit: Plots 2D implicit and region plots.
  • plot3d: Plots 3D plots of functions in two variables.
  • plot3d_parametric_line: Plots 3D line plots, defined by a parameter.
  • plot3d_parametric_surface: Plots 3D parametric surface plots.

The above functions are only for convenience and ease of use. It is possible to plot any plot by passing the corresponding Series class to Plot as argument.

 

【簡單範例】

pi@raspberrypi:~ $ ipython3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from sympy import *

In [2]: init_printing()

In [3]: R, r, ρ, t = symbols('R, r, ρ, t')

In [4]: x = R * ( (1 - r/R) * cos(t) + ρ/R * cos((R - r)/r * t) ) 

In [5]: y = R * ( (1 - r/R) * sin(t) - ρ/R * sin((R - r)/r * t) )

In [6]: x
Out[6]: 
  ⎛                      ⎛t⋅(R - r)⎞⎞
  ⎜                 ρ⋅cos⎜─────────⎟⎟
  ⎜⎛    r⎞               ⎝    r    ⎠⎟
R⋅⎜⎜1 - ─⎟⋅cos(t) + ────────────────⎟
  ⎝⎝    R⎠                 R        ⎠

In [7]: y
Out[7]: 
  ⎛                      ⎛t⋅(R - r)⎞⎞
  ⎜                 ρ⋅sin⎜─────────⎟⎟
  ⎜⎛    r⎞               ⎝    r    ⎠⎟
R⋅⎜⎜1 - ─⎟⋅sin(t) - ────────────────⎟
  ⎝⎝    R⎠                 R        ⎠

In [8]: x1 = x.subs([(R, 5), (r, 3), (ρ, 2)])

In [9]: y1 = y.subs([(R, 5), (r, 3), (ρ, 2)])

In [10]: x1
Out[10]: 
     ⎛2⋅t⎞           
2⋅cos⎜───⎟ + 2⋅cos(t)
     ⎝ 3 ⎠           

In [11]: y1
Out[11]: 
       ⎛2⋅t⎞           
- 2⋅sin⎜───⎟ + 2⋅sin(t)
       ⎝ 3 ⎠           

# Fig 1, Fig 2, Fig 3
In [12]: plotting.plot_parametric(x1, y1, (t, -5, 5))
Out[12]: <sympy.plotting.plot.Plot at 0x74b8cb10>

In [13]: plotting.plot_parametric(x1, y1, (t, -10, 10))
Out[13]: <sympy.plotting.plot.Plot at 0x72959d30>

In [14]: plotting.plot_parametric(x1, y1, (t, -100, 100))
Out[14]: <sympy.plotting.plot.Plot at 0x713cf990>

In [15]: 

 

【Fig 1, Fig 2, Fig 3】

五芒星_1

 

五芒星_2

 

五芒星_3

 

 

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算四

詩經‧國風‧豳風‧伐柯

伐柯如何?匪斧不克。

取妻如何?匪媒不得。

伐柯伐柯,其則不遠。

我覯之子,籩豆有踐。

 

伐『柯』柯即是製作斧柄,卻是非斧不行??將之比作娶『妻』

※《説文解字》: 柯,斧柄也。从木,可聲。

實在費疑猜??若思善用『工具』能夠創造更好的『工具』,那麼『伐柯伐柯,其則不遠。』果真『有理有則』的乎!?因此假借 SymPy 『符號矩陣』學習『矩陣』,也是『順理而行』的了?!

這裡僅以『基本矩陣』之法,求解一般 2x2 矩陣之『反矩陣』M 為例,演義這則『伐柯取妻』有趣之事︰

if

E \cdot M = (E_n \cdot \cdots E_2 \cdot E_1)  \cdot M = I

then

E = M^{-1}

M = {E_1}^{-1} \cdot {E_2}^{-1} \cdot \cdots {E_n}^{-1} = E^{-1}

 

望可消消暑氣也!!??

pi@raspberrypi:~ $ ipython3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from sympy import *

In [2]: init_printing()

In [3]: a11, a12, a21,a22 = symbols('a11, a12, a21,a22')

# 一般 2x2 矩陣 M
⎡a₁₁ a₁₂⎤
⎢       ⎥
⎣a₂₁ a₂₂⎦
In [4]: M = Matrix([[a11, a12], [a21,a22]])

# 試以『基本矩陣』求解其『反矩陣』
# 消去 a21
In [5]: E1 = Matrix([[1, 0], [-a21, a11]])

In [6]: E1
Out[6]: 
⎡ 1     0 ⎤
⎢         ⎥
⎣-a₂₁  a₁₁⎦

In [7]: E1 * M
Out[7]: 
⎡a₁₁         a₁₂       ⎤
⎢                      ⎥
⎣ 0   a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

# 消去 a12
In [8]: E2 = Matrix([[a11*a22 - a12*a21, -a12], [0, 1]])

In [9]: E2
Out[9]: 
⎡a₁₁⋅a₂₂ - a₁₂⋅a₂₁  -a₁₂⎤
⎢                       ⎥
⎣        0           1  ⎦

In [10]: E2 * E1 * M
Out[10]: 
⎡   2                                     ⎤
⎢a₁₁ ⋅a₂₂ - a₁₁⋅a₁₂⋅a₂₁          0        ⎥
⎢                                         ⎥
⎣          0             a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

# 歸一化
In [11]: E3 = Matrix([[1/(a11*(a11*a22 - a12*a21)), 0], [0, 1/(a11*a22 - a12*a21)]])

In [12]: E3
Out[12]: 
⎡           1                              ⎤
⎢───────────────────────          0        ⎥
⎢a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)                   ⎥
⎢                                          ⎥
⎢                                 1        ⎥
⎢           0             ─────────────────⎥
⎣                         a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

In [13]: E3 * E2 * E1 * M
Out[13]: 
⎡    ⎛        a₁₂⋅a₂₁            1 ⎞        a₁₂⋅a₂₁              a₁₂⋅a₂₂      
⎢a₁₁⋅⎜─────────────────────── + ───⎟ - ─────────────────  - ───────────────── 
⎢    ⎝a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)   a₁₁⎠   a₁₁⋅a₂₂ - a₁₂⋅a₂₁    a₁₁⋅a₂₂ - a₁₂⋅a₂₁ 
⎢                                                                             
⎢                                                                        a₁₁⋅a
⎢                           0                                       ──────────
⎣                                                                   a₁₁⋅a₂₂ - 

      ⎛        a₁₂⋅a₂₁            1 ⎞⎤
+ a₁₂⋅⎜─────────────────────── + ───⎟⎥
      ⎝a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)   a₁₁⎠⎥
                                     ⎥
₂₂             a₁₂⋅a₂₁               ⎥
─────── - ─────────────────          ⎥
a₁₂⋅a₂₁   a₁₁⋅a₂₂ - a₁₂⋅a₂₁          ⎦

# 驗證化作『單位矩陣』
In [14]: (E3 * E2 * E1 * M)[0,0]
Out[14]: 
    ⎛        a₁₂⋅a₂₁            1 ⎞        a₁₂⋅a₂₁     
a₁₁⋅⎜─────────────────────── + ───⎟ - ─────────────────
    ⎝a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)   a₁₁⎠   a₁₁⋅a₂₂ - a₁₂⋅a₂₁

In [15]: (E3 * E2 * E1 * M)[0,0].simplify()
Out[15]: 1

In [16]: (E3 * E2 * E1 * M)[1,1]
Out[16]: 
     a₁₁⋅a₂₂             a₁₂⋅a₂₁     
───────────────── - ─────────────────
a₁₁⋅a₂₂ - a₁₂⋅a₂₁   a₁₁⋅a₂₂ - a₁₂⋅a₂₁

In [17]: (E3 * E2 * E1 * M)[1,1].simplify()
Out[17]: 1

# 簡化『反矩陣』
In [18]: E3 * E2 * E1
Out[18]: 
⎡        a₁₂⋅a₂₁            1         -a₁₂       ⎤
⎢─────────────────────── + ───  ─────────────────⎥
⎢a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)   a₁₁  a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎥
⎢                                                ⎥
⎢            -a₂₁                      a₁₁       ⎥
⎢      ─────────────────        ─────────────────⎥
⎣      a₁₁⋅a₂₂ - a₁₂⋅a₂₁        a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

In [19]: (E3 * E2 * E1)[0,0].simplify()
Out[19]: 
       a₂₂       
─────────────────
a₁₁⋅a₂₂ - a₁₂⋅a₂₁

In [20]: (E3 * E2 * E1)[0,1].simplify()
Out[20]: 
      -a₁₂       
─────────────────
a₁₁⋅a₂₂ - a₁₂⋅a₂₁

In [21]: (E3 * E2 * E1)[1,0].simplify()
Out[21]: 
      -a₂₁       
─────────────────
a₁₁⋅a₂₂ - a₁₂⋅a₂₁

In [22]: (E3 * E2 * E1)[1,1].simplify()
Out[22]: 
       a₁₁       
─────────────────
a₁₁⋅a₂₂ - a₁₂⋅a₂₁

In [23]: E = Matrix([[a22/(a11*a22 -a12*a21), -a12/(a11*a22 -a12*a21)], [-a21/(a11*a22 -a12*a21), a11/(a11*a22 -a12*a21)]])

In [24]: E
Out[24]: 
⎡       a₂₂               -a₁₂       ⎤
⎢─────────────────  ─────────────────⎥
⎢a₁₁⋅a₂₂ - a₁₂⋅a₂₁  a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎥
⎢                                    ⎥
⎢      -a₂₁                a₁₁       ⎥
⎢─────────────────  ─────────────────⎥
⎣a₁₁⋅a₂₂ - a₁₂⋅a₂₁  a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

In [25]: E * M
Out[25]: 
⎡     a₁₁⋅a₂₂             a₁₂⋅a₂₁                                            ⎤
⎢───────────────── - ─────────────────                    0                  ⎥
⎢a₁₁⋅a₂₂ - a₁₂⋅a₂₁   a₁₁⋅a₂₂ - a₁₂⋅a₂₁                                       ⎥
⎢                                                                            ⎥
⎢                                            a₁₁⋅a₂₂             a₁₂⋅a₂₁     ⎥
⎢                  0                    ───────────────── - ─────────────────⎥
⎣                                       a₁₁⋅a₂₂ - a₁₂⋅a₂₁   a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

# 探索這些『基本矩陣』的性質
In [26]: E1
Out[26]: 
⎡ 1     0 ⎤
⎢         ⎥
⎣-a₂₁  a₁₁⎦

In [27]: E1.det()
Out[27]: a₁₁

In [28]: E1.inv()
Out[28]: 
⎡ 1    0 ⎤
⎢        ⎥
⎢a₂₁   1 ⎥
⎢───  ───⎥
⎣a₁₁  a₁₁⎦

In [29]: E2
Out[29]: 
⎡a₁₁⋅a₂₂ - a₁₂⋅a₂₁  -a₁₂⎤
⎢                       ⎥
⎣        0           1  ⎦

In [30]: E2.det()
Out[30]: a₁₁⋅a₂₂ - a₁₂⋅a₂₁

In [31]: E2.inv()
Out[31]: 
⎡        1                 a₁₂       ⎤
⎢─────────────────  ─────────────────⎥
⎢a₁₁⋅a₂₂ - a₁₂⋅a₂₁  a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎥
⎢                                    ⎥
⎣        0                  1        ⎦

In [32]: E3
Out[32]: 
⎡           1                              ⎤
⎢───────────────────────          0        ⎥
⎢a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)                   ⎥
⎢                                          ⎥
⎢                                 1        ⎥
⎢           0             ─────────────────⎥
⎣                         a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

In [33]: E3.det()
Out[33]: 
                      1                       
──────────────────────────────────────────────
   3    2        2                      2    2
a₁₁ ⋅a₂₂  - 2⋅a₁₁ ⋅a₁₂⋅a₂₁⋅a₂₂ + a₁₁⋅a₁₂ ⋅a₂₁ 

In [34]: E3.det().simplify()
Out[34]: 
                       1                       
───────────────────────────────────────────────
    ⎛   2    2                          2    2⎞
a₁₁⋅⎝a₁₁ ⋅a₂₂  - 2⋅a₁₁⋅a₁₂⋅a₂₁⋅a₂₂ + a₁₂ ⋅a₂₁ ⎠

In [35]: E3.det().simplify().factor()
Out[35]: 
           1            
────────────────────────
                       2
a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁) 

In [36]: E3.inv()
Out[36]: 
⎡a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)          0        ⎤
⎢                                          ⎥
⎣           0             a₁₁⋅a₂₂ - a₁₂⋅a₂₁⎦

In [37]: E1.det() * E2.det() * E3.det()
Out[37]: 
           a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)            
──────────────────────────────────────────────
   3    2        2                      2    2
a₁₁ ⋅a₂₂  - 2⋅a₁₁ ⋅a₁₂⋅a₂₁⋅a₂₂ + a₁₁⋅a₁₂ ⋅a₂₁ 

In [38]: (E1.det() * E2.det() * E3.det()).simplify()
Out[38]: 
        1        
─────────────────
a₁₁⋅a₂₂ - a₁₂⋅a₂₁

# 確定 M 可用『基本矩陣』作表達
In [39]: E1.inv() * E2.inv() * E3.inv()
Out[39]: 
⎡a₁₁                          a₁₂                        ⎤
⎢                                                        ⎥
⎢                         ⎛        a₁₂⋅a₂₁            1 ⎞⎥
⎢a₂₁  (a₁₁⋅a₂₂ - a₁₂⋅a₂₁)⋅⎜─────────────────────── + ───⎟⎥
⎣                         ⎝a₁₁⋅(a₁₁⋅a₂₂ - a₁₂⋅a₂₁)   a₁₁⎠⎦

In [40]: (E1.inv() * E2.inv() * E3.inv())[1,1].simplify()
Out[40]: a₂₂

 

 

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算三

從『聯立方程式』 Simultaneous equations 、『線性方程組』 System of linear equations 、『矩陣』 Matrix 、『行列式』 Determinant …… 觀之,『高斯消去法』 Gaussian Elimination 歷史

History

The method of Gaussian elimination appears in the Chinese mathematical text Chapter Eight Rectangular Arrays of The Nine Chapters on the Mathematical Art. Its use is illustrated in eighteen problems, with two to five equations. The first reference to the book by this title is dated to 179 CE, but parts of it were written as early as approximately 150 BCE.[1][2] It was commented on by Liu Hui in the 3rd century.

The method in Europe stems from the notes of Isaac Newton.[3][4] In 1670, he wrote that all the algebra books known to him lacked a lesson for solving simultaneous equations, which Newton then supplied. Cambridge University eventually published the notes as Arithmetica Universalis in 1707 long after Newton left academic life. The notes were widely imitated, which made (what is now called) Gaussian elimination a standard lesson in algebra textbooks by the end of the 18th century. Carl Friedrich Gauss in 1810 devised a notation for symmetric elimination that was adopted in the 19th century by professional hand computers to solve the normal equations of least-squares problems.[5] The algorithm that is taught in high school was named for Gauss only in the 1950s as a result of confusion over the history of the subject.[6]

Some authors use the term Gaussian elimination to refer only to the procedure until the matrix is in echelon form, and use the term Gauss-Jordan elimination to refer to the procedure which ends in reduced echelon form. The name is used because it is a variation of Gaussian elimination as described by Wilhelm Jordan in 1888. However, the method also appears in an article by Clasen published in the same year. Jordan and Clasen probably discovered Gauss–Jordan elimination independently.[7]

 

久遠矣。或許很多人不曉此法漢代《九章算術》中已有,甚或不知作注的『Liu Hui』劉徽是何許人也!!而後歷經數百代凝鑄成

線性代數

線性代數是關於向量空間線性映射的一個數學分支。它包括對線、面和子空間的研究,同時也涉及到所有的向量空間的一般性質。

坐標滿足滿足線性方程的點集形成 n 維空間中的一個超平面n 個超平面相交於一點的條件是線性代數研究的一個重要焦點。此項研究源於包含多個未知數的線性方程組。這樣的方程組可以很自然地表示為矩陣和向量的形式。[1][2]

線性代數既是純數學也是應用數學的核心。例如,放寬向量空間的公理就產生了抽象代數,也就出現了若干推廣。泛函分析研究無窮維情形的向量空間理論。線性代數與微積分結合,使得微分方程線性系統的求解更加便利。 線性代數的理論已被泛化為算子理論

線性代數的方法還用在解析幾何工程物理自然科學計算機科學計算機動畫社會科學(尤其是經濟學)中。由於線性代數是一套完善的理論,非線性數學模型通常可以被近似為線性模型。

250px-Linear_subspaces_with_shading.svg

三維歐氏空間R3是一個向量空間,而通過原點的線及平面是R3的向量子空間

歷史

線性代數的研究最初出現於對行列式的研究上。行列式當時被用來求解線性方程組。萊布尼茨在1693年使用了行列式。隨後,加布里爾·克拉默在1750年推導出求解線性方程組的克萊姆法則。然後,高斯利用高斯消元法發展出求解線性系統的理論。這也被列為大地測量學的一項進展。[3][4]

現代線性代數的歷史可以上溯到19世紀中期的英國。1843年,哈密頓發現了四元數。1844年,赫爾曼·格拉斯曼發表了他的著作《線性外代數》(Die lineare Ausdehnungslehre),包括了今日線性代數的一些主題。1848年,詹姆斯·西爾維斯特引入了矩陣(matrix),該詞是「子宮」的拉丁語。阿瑟·凱萊在研究線性變換時引入了矩陣乘法和轉置的概念。很重要的是,凱萊使用了一個字母來代表一個矩陣,因此將矩陣當做了聚合對象。他也意識到矩陣和行列式之間的聯繫。[3]

不過除了這些早期的文獻以外.線性代數主要是在二十世紀發展的。在抽象代數環論開發之前,矩陣只有模糊不清的定義。隨著狹義相對論的到來,很多開拓者發現了線性代數的微妙。進一步的,解偏微分方程克萊姆法則的例行應用導致了大學的標準教育中包括了線性代數。例如,E.T. Copson寫到:

當我在1922年到愛丁堡做年輕的講師的時候,我驚奇的發現了不同於牛津的課程。這裡包括了我根本就不知道的主題如勒貝格積分矩陣論數值分析黎曼幾何
——E.T. Copson,《偏微分方程》前言, 1973

1882年,Hüseyin Tevfik Pasha寫了一本書,名為《線性代數》。[5][6]第一次現代化精確定義向量空間是在1888年,由朱塞佩·皮亞諾提出。在1888年,弗蘭西斯·高爾頓還發起了相關係數的應用。經常有多於一個隨機變量出現並且它們可以互相關。在多變元隨機變量的統計分析中,相關矩陣是自然的工具。所以這種隨機向量的統計研究幫助了矩陣用途的開發。到1900年,一種有限維向量空間的線性變換理論被提出。在20世紀上半葉,許多前幾世紀的想法和方法被總結成抽象代數,線性代數第一次有了它的現代形式。矩陣在量子力學狹義相對論統計學上的應用幫助線性代數的主題超越了純數學的範疇。計算機的發展導致更多地研究致力於有關高斯消元法和矩陣分解的有效算法上。線性代數成為了數字模擬和模型的基本工具。[3]

 

其論述能不厚重乎?其內容能不範圍廣闊耶!系統符號混雜、概念層出不窮、各種分支頻起旁徵博引,豈不目不暇給望洋興嘆呀!!

此處藉著『高斯消去法』例子為範︰

Gaussian elimination

Example of the algorithm

Suppose the goal is to find and describe the set of solutions to the following system of linear equations:

{\begin{alignedat}{7}2x&&\;+\;&&y&&\;-\;&&z&&\;=\;&&8&\qquad (L_{1})\\-3x&&\;-\;&&y&&\;+\;&&2z&&\;=\;&&-11&\qquad (L_{2})\\-2x&&\;+\;&&y&&\;+\;&&2z&&\;=\;&&-3&\qquad (L_{3})\end{alignedat}}

The table below is the row reduction process applied simultaneously to the system of equations, and its associated augmented matrix. In practice, one does not usually deal with the systems in terms of equations but instead makes use of the augmented matrix, which is more suitable for computer manipulations. The row reduction procedure may be summarized as follows: eliminate x from all equations below  L_{1}, and then eliminate y from all equations below  L_{2}. This will put the system into triangular form. Then, using back-substitution, each unknown can be solved for.

System of equations Row operations Augmented matrix
{\begin{alignedat}{7}2x&&\;+\;&&y&&\;-\;&&z&&\;=\;&&8&\\-3x&&\;-\;&&y&&\;+\;&&2z&&\;=\;&&-11&\\-2x&&\;+\;&&y&&\;+\;&&2z&&\;=\;&&-3&\end{alignedat}}   \left[{\begin{array}{ccc|c}2&1&-1&8\\-3&-1&2&-11\\-2&1&2&-3\end{array}}\right]
{\begin{alignedat}{7}2x&&\;+&&y&&\;-&&\;z&&\;=\;&&8&\\&&&&{\frac {1}{2}}y&&\;+&&\;{\frac {1}{2}}z&&\;=\;&&1&\\&&&&2y&&\;+&&\;z&&\;=\;&&5&\end{alignedat}} L_{2}+{\frac {3}{2}}L_{1}\rightarrow L_{2}
L_{3}+L_{1}\rightarrow L_{3}
\left[{\begin{array}{ccc|c}2&1&-1&8\\0&1/2&1/2&1\\0&2&1&5\end{array}}\right]
{\begin{alignedat}{7}2x&&\;+&&y\;&&-&&\;z\;&&=\;&&8&\\&&&&{\frac {1}{2}}y\;&&+&&\;{\frac {1}{2}}z\;&&=\;&&1&\\&&&&&&&&\;-z\;&&\;=\;&&1&\end{alignedat}} L_{3}+-4L_{2}\rightarrow L_{3} \left[{\begin{array}{ccc|c}2&1&-1&8\\0&1/2&1/2&1\\0&0&-1&1\end{array}}\right]
The matrix is now in echelon form (also called triangular form)
{\begin{alignedat}{7}2x&&\;+&&y\;&&&&\;\;&&=\;&&7&\\&&&&{\frac {1}{2}}y\;&&&&\;\;&&=\;&&{\frac {3}{2}}&\\&&&&&&&&\;-z\;&&\;=\;&&1&\end{alignedat}} L_{2}+{\frac {1}{2}}L_{3}\rightarrow L_{2}
L_{1}-L_{3}\rightarrow L_{1}
\left[{\begin{array}{ccc|c}2&1&0&7\\0&1/2&0&3/2\\0&0&-1&1\end{array}}\right]
  {\begin{alignedat}{7}2x&&\;+&&y\;&&&&\;\;&&=\;&&7&\\&&&&y\;&&&&\;\;&&=\;&&3&\\&&&&&&&&\;z\;&&\;=\;&&-1&\end{alignedat}} 2L_{2}\rightarrow L_{2}
-L_{3}\rightarrow L_{3}
  \left[{\begin{array}{ccc|c}2&1&0&7\\0&1&0&3\\0&0&1&-1\end{array}}\right]
{\begin{alignedat}{7}x&&\;&&\;&&&&\;\;&&=\;&&2&\\&&&&y\;&&&&\;\;&&=\;&&3&\\&&&&&&&&\;z\;&&\;=\;&&-1&\end{alignedat}}   L_{1}-L_{2}\rightarrow L_{1}
{\frac {1}{2}}L_{1}\rightarrow L_{1}
  \left[{\begin{array}{ccc|c}1&0&0&2\\0&1&0&3\\0&0&1&-1\end{array}}\right]

The second column describes which row operations have just been performed. So for the first step, the x is eliminated from L_{2} by adding  {\begin{matrix}{\frac {3}{2}}\end{matrix}}L_{1} to  L_{2}. Next x is eliminated from  L_{3} by adding  L_{1} to  L_{3}. These row operations are labelled in the table as

L_{2}+{\frac {3}{2}}L_{1}\rightarrow L_{2}
L_{3}+L_{1}\rightarrow L_{3}.

Once y is also eliminated from the third row, the result is a system of linear equations in triangular form, and so the first part of the algorithm is complete. From a computational point of view, it is faster to solve the variables in reverse order, a process known as back-substitution. One sees the solution is z = -1, y = 3, and x = 2. So there is a unique solution to the original system of equations.

Instead of stopping once the matrix is in echelon form, one could continue until the matrix is in reduced row echelon form, as it is done in the table. The process of row reducing until the matrix is reduced is sometimes referred to as Gauss-Jordan elimination, to distinguish it from stopping after reaching echelon form.

 

翻古出新,談談如何用『SymPy』之

Matrices

Matrices (linear algebra)

模組為『工具』,操作

初等矩陣

線性代數中,初等矩陣(又稱為基本矩陣[1])是一個與單位矩陣只有微小區別的矩陣。具體來說,一個n階單位矩陣E經過一次初等行變換或一次初等列變換所得矩陣稱為n階初等矩陣。[2]

操作

初等矩陣分為3種類型,分別對應著3種不同的行/列變換。

兩行(列)互換:
  R_i \leftrightarrow R_j
把某行(列)乘以一非零常數:
kR_i \rightarrow R_i,\ 其中   k \neq 0
把第i行(列)加上第j行(列)的k倍:
R_i + kR_j \rightarrow R_i

初等矩陣即是將上述3種初等變換應用於一單位矩陣的結果。以下只討論對某行的變換,列變換可以類推。

行互換

這一變換Tij,將一單位矩陣的第i行的所有元素與第j行互換。

 T_{i,j} = \begin{bmatrix} 1 & & & & & & & \\ & \ddots & & & & & & \\ & & 0 & & 1 & & \\ & & & \ddots & & & & \\ & & 1 & & 0 & & \\ & & & & & & \ddots & \\ & & & & & & & 1\end{bmatrix}\quad

性質

  • 逆矩陣即自身: T_{ij}^{-1} = T_{ij}
  • 因為單位矩陣的行列式為1,故  |T_{ij}|=-1。與其他相同大小的方陣A亦有一下性質:  |T_{ij}A|=-|A|

把某行乘以一非零常數

這一變換Tim),將第i行的所有元素乘以一非零常數m

 T_i (m) = \begin{bmatrix} 1 & & & & & & \\ & \ddots & & & & & \\ & & 1 & & & & \\ & & & m & & & \\ & & & & 1 & & \\ & & & & & \ddots & \\ & & & & & & 1\end{bmatrix}\quad

性質

  • 逆矩陣為 T_{i}(m)^{-1} = T_{i}(\frac{1}{m})
  • 此矩陣及其逆矩陣均為對角矩陣
  • 其行列式 |T_{i}(m)|=m。故對於一等大方陣A|T_{i}(m)A|=m|A|

把第i行加上第j行的m

這一變換Tijm),將第i行加上第j行的m倍。

 T_{i,j}(m) = \begin{bmatrix} 1 & & & & & & & \\ & \ddots & & & & & & \\ & & 1 & & & & & \\ & & & \ddots & & & & \\ & & m & & 1 & & \\ & & & & & & \ddots & \\ & & & & & & & 1\end{bmatrix}

性質

  • 逆矩陣具有性質  T_{ij}(m)^{-1}=T_{ij}(-m)
  • 此矩陣及其逆矩陣均為三角矩陣
  • |T_{ij}(m)|=1。故對於一等大方陣A有: |T_{ij}(m)A| = |A|

 

親自『實證』消去法的精神,體驗用『工具』來『學習』之樂趣吧! !

省思這個『初等』當真可『模擬』紙筆運算嗎??

pi@raspberrypi:~ $ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> from sympy import *
>>> init_printing()
>>> a, b, c, d, e, f, g, h, i, m = symbols('a, b, c, d, e, f, g, h, i, m')
>>> M = Matrix([[a, b, c], [d, e, f], [g, h, i]])
>>> M
⎡a  b  c⎤
⎢       ⎥
⎢d  e  f⎥
⎢       ⎥
⎣g  h  i⎦

>>> 二三列交換 = Matrix([[1, 0, 0], [0, 0, 1], [0, 1, 0]])
>>> 二三列交換
⎡1  0  0⎤
⎢       ⎥
⎢0  0  1⎥
⎢       ⎥
⎣0  1  0⎦
>>> 二三列交換 * M
⎡a  b  c⎤
⎢       ⎥
⎢g  h  i⎥
⎢       ⎥
⎣d  e  f⎦

>>> 第二列乘m = Matrix([[1, 0, 0], [0, m, 0], [0, 0, 1]])
>>> 第二列乘m
⎡1  0  0⎤
⎢       ⎥
⎢0  m  0⎥
⎢       ⎥
⎣0  0  1⎦
>>> 第二列乘m * M
⎡ a    b    c ⎤
⎢             ⎥
⎢d⋅m  e⋅m  f⋅m⎥
⎢             ⎥
⎣ g    h    i ⎦

>>> 第三列加第二列乘m = Matrix([[1, 0, 0], [0, 1, 0], [0, m, 1]])
>>> 第三列加第二列乘m
⎡1  0  0⎤
⎢       ⎥
⎢0  1  0⎥
⎢       ⎥
⎣0  m  1⎦
>>> 第三列加第二列乘m * M
⎡   a        b        c   ⎤
⎢                         ⎥
⎢   d        e        f   ⎥
⎢                         ⎥
⎣d⋅m + g  e⋅m + h  f⋅m + i⎦
>>> 

 

或可得『自學』之法哩!!??

>>> AM = Matrix([[2, 1, -1, 8], [-3, -1, 2, -11], [-2, 1, 2, -3]])
>>> AM
⎡2   1   -1   8 ⎤
⎢               ⎥
⎢-3  -1  2   -11⎥
⎢               ⎥
⎣-2  1   2   -3 ⎦

>>> L2加二分之三L1 = Matrix([[1, 0, 0], [3/2, 1, 0], [0, 0, 1]])
>>> L2加二分之三L1
⎡ 1   0  0⎤
⎢         ⎥
⎢1.5  1  0⎥
⎢         ⎥
⎣ 0   0  1⎦

>>> L2加二分之三L1 * AM
⎡2    1   -1    8 ⎤
⎢                 ⎥
⎢0   0.5  0.5  1.0⎥
⎢                 ⎥
⎣-2   1    2   -3 ⎦

>>> L3加上L1 = Matrix([[1, 0, 0], [0, 1, 0], [1, 0, 1]]) 
>>> L3加上L1
⎡1  0  0⎤
⎢       ⎥
⎢0  1  0⎥
⎢       ⎥
⎣1  0  1⎦

>>> L3加上L1 * AM
⎡2   1   -1   8 ⎤
⎢               ⎥
⎢-3  -1  2   -11⎥
⎢               ⎥
⎣0   2   1    5 ⎦

>>> L3加上L1 * L2加二分之三L1 * AM
⎡2   1   -1    8 ⎤
⎢                ⎥
⎢0  0.5  0.5  1.0⎥
⎢                ⎥
⎣0   2    1    5 ⎦

>>> L2加二分之三L1 * L3加上L1 * AM
⎡2   1   -1    8 ⎤
⎢                ⎥
⎢0  0.5  0.5  1.0⎥
⎢                ⎥
⎣0   2    1    5 ⎦
# ……

 

 

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算二‧下

如果我們藉著維基百科『三次函數』詞條,來個拉格朗日求解之旅 ,自會發現用『SymPy』作符號運算的好處︰

Cubic function

In algebra, a cubic function is a function of the form

f(x)=ax^{3}+bx^{2}+cx+d,\,

where a is nonzero.

Setting f(x) = 0 produces a cubic equation of the form:

ax^{3}+bx^{2}+cx+d=0.\,

The solutions of this equation are called roots of the polynomial f(x). If all of the coefficients a, b, c, and d of the cubic equation are real numbers then there will be at least one real root (this is true for all odd degree polynomials) and if the coefficients are complex numbers then there will be at least one complex root (this is true for all non-constant polynomials). All of the roots of the cubic equation can be found algebraically. (This is also true of a quadratic or quartic (fourth degree) equation, but no higher-degree equation, by the Abel–Ruffini theorem). The roots can also be found trigonometrically. Alternatively, numerical approximations of the roots can be found using root-finding algorithms like Newton’s method.

The coefficients do not need to be complex numbers. Much of what is covered below is valid for coefficients of any field with characteristic 0 or greater than 3. The solutions of the cubic equation do not necessarily belong to the same field as the coefficients. For example, some cubic equations with rational coefficients have roots that are non-rational (and even non-real) complex numbers.

Lagrange’s method

In his paper Réflexions sur la résolution algébrique des équations (“Thoughts on the algebraic solving of equations”),[35] Joseph Louis Lagrange introduced a new method to solve equations of low degree.

This method works well for cubic and quartic equations, but Lagrange did not succeed in applying it to a quintic equation, because it requires solving a resolvent polynomial of degree at least six.[36][37][38] This is explained by the Abel–Ruffini theorem, which proves that such polynomials cannot be solved by radicals. Nevertheless, the modern methods for solving solvable quintic equations are mainly based on Lagrange’s method.[38]

In the case of cubic equations, Lagrange’s method gives the same solution as Cardano’s. By drawing attention to a geometrical problem that involves two cubes of different size Cardano explains in his book Ars Magna how he arrived at the idea of considering the unknown of the cubic equation as a sum of two other quantities. Lagrange’s method may also be applied directly to the general cubic equation (1), ax3 + bx2 + cx + d = 0, without using the reduction to the depressed cubic equation (2), t3 + pt + q = 0. Nevertheless, the computation is much easier with this reduced equation.

Suppose that x0, x1 and x2 are the roots of equation (1) or (2), and define ξ = −1/2 + 1/2√3i (a complex cube root of 1, i.e. a primitive third root of unity) which satisfies the relation ξ2 + ξ + 1 = 0. We now set

s_{0}=x_{0}+x_{1}+x_{2},\,
s_{1}=x_{0}+\zeta x_{1}+\zeta ^{2}x_{2},\,
s_{2}=x_{0}+\zeta ^{2}x_{1}+\zeta x_{2}.\,

This is the discrete Fourier transform of the roots: observe that while the coefficients of the polynomial are symmetric in the roots, in this formula an order has been chosen on the roots, so these are not symmetric in the roots. The roots may then be recovered from the three si by inverting the above linear transformation via the inverse discrete Fourier transform, giving

  x_{0}={\tfrac {1}{3}}(s_{0}+s_{1}+s_{2}),\,
x_{1}={\tfrac {1}{3}}(s_{0}+\zeta ^{2}s_{1}+\zeta s_{2}),\,
x_{2}={\tfrac {1}{3}}(s_{0}+\zeta s_{1}+\zeta ^{2}s_{2}).\,

The polynomial s0 is equal, by Vieta’s formulas, to b/a in case of equation (1) and to 0 in case of equation (2), so we only need to seek values for the other two.

 

即使已知s_0, s_1,  s_2x_0, x_1, x_2 的線性關係,也知 {\xi}^2 + \xi +1 =0 ,將 x_0, x_1, x_2s_0, s_1,  s_2 來表示亦需要許多計算!因此人們往往不願從頭來過,只想知道結果就好!!不過這樣就少了許多探索的樂趣了。難道使用『SymPy』能有什麼不同的嗎?終究也只是得到『答案』而已乎??

pi@raspberrypi:~ python3 Python 3.4.2 (default, Oct 19 2014, 13:31:11)  [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from sympy import * >>> x0, x1, x2, s0, s1, s2, ζ = symbols('x0, x1, x2, s0, s1, s2, ζ') >>> init_printing() >>> R1 = Eq(s0, x0 + x1 + x2) >>> R2 = Eq(s1, x0 + ζ*x1 + ζ**2 * x2) >>> R3 = Eq(s2, x0 + ζ**2 * x1 + ζ*x2) >>> R1 s₀ = x₀ + x₁ + x₂ >>> R2                      2 s₁ = x₀ + x₁⋅ζ + x₂⋅ζ  >>> R3               2        s₂ = x₀ + x₁⋅ζ  + x₂⋅ζ >>> solve([R1,R2,R3],[x0,x1,x2]) ⎧        2                                                                     ⎪    s₀⋅ζ  + s₀⋅ζ - s₁ - s₂      -s₀⋅ζ - s₁ + s₂⋅ζ + s₂      -s₀⋅ζ + s₁⋅ζ + s₁ ⎨x₀: ──────────────────────, x₁: ──────────────────────, x₂: ───────────────── ⎪           2                          ⎛ 2        ⎞                ⎛ 2         ⎩          ζ  + ζ - 2                ζ⋅⎝ζ  + ζ - 2⎠              ζ⋅⎝ζ  + ζ - 2       ⎫  - s₂⎪ ─────⎬ ⎞    ⎪ ⎠    ⎭ >>>  </pre>    <span style="color: #003300;">概念之表達需要練習,由是才易掌握概念的內涵。不同的觀察點,或能設想前人所未想或尚未竟之處。假使嘗試卻為複雜運算所阻,恐是誤解了工具的發明及其使用之目的。因此『SymPy』無法代替你的『思考』也。事實上就算你告知『SymPy』{\xi}^2 + \xi +1 =0有這一關係式,它也不會『自動』幫你化簡成那一表達式矣。要是只想知道答案,幹嘛那麼麻煩耶??!!</span> <pre class="lang:python decode:true">>>> a, b, c, d, x = symbols('a, b, c, d, x') >>> solve(a*x**3 + b*x**2 + c*x + d , x)  [-(-3*c/a + b**2/a**2)/(3*(sqrt(-4*(-3*c/a + b**2/a**2)**3 + (27*d/a - 9*b*c/a**2 + 2*b**3/a**3)**2)/2 + 27*d/(2*a) - 9*b*c/(2*a**2) + b**3/a**3)**(1/3)) - (sqrt(-4*(-3*c/a + b**2/a**2)**3 + (27*d/a - 9*b*c/a**2 + 2*b**3/a**3)**2)/2 + 27*d/(2*a) - 9*b*c/(2*a**2) + b**3/a**3)**(1/3)/3 - b/(3*a), -(-3*c/a + b**2/a**2)/(3*(-1/2 - sqrt(3)*I/2)*(sqrt(-4*(-3*c/a + b**2/a**2)**3 + (27*d/a - 9*b*c/a**2 + 2*b**3/a**3)**2)/2 + 27*d/(2*a) - 9*b*c/(2*a**2) + b**3/a**3)**(1/3)) - (-1/2 - sqrt(3)*I/2)*(sqrt(-4*(-3*c/a + b**2/a**2)**3 + (27*d/a - 9*b*c/a**2 + 2*b**3/a**3)**2)/2 + 27*d/(2*a) - 9*b*c/(2*a**2) + b**3/a**3)**(1/3)/3 - b/(3*a), -(-3*c/a + b**2/a**2)/(3*(-1/2 + sqrt(3)*I/2)*(sqrt(-4*(-3*c/a + b**2/a**2)**3 + (27*d/a - 9*b*c/a**2 + 2*b**3/a**3)**2)/2 + 27*d/(2*a) - 9*b*c/(2*a**2) + b**3/a**3)**(1/3)) - (-1/2 + sqrt(3)*I/2)*(sqrt(-4*(-3*c/a + b**2/a**2)**3 + (27*d/a - 9*b*c/a**2 + 2*b**3/a**3)**2)/2 + 27*d/(2*a) - 9*b*c/(2*a**2) + b**3/a**3)**(1/3)/3 - b/(3*a)] </pre>    <span style="color: #003300;">所以打算跟隨詞條文本者</span>  <span style="color: #808080;">The polynomials <span class="texhtml"><i>s</i><sub>1</sub></span> and <span class="texhtml"><i>s</i><sub>2</sub></span> are not <a style="color: #808080;" title="Symmetric polynomial" href="https://en.wikipedia.org/wiki/Symmetric_polynomial">symmetric functions</a> of the roots: <span class="texhtml"><i>s</i><sub>0</sub></span> is invariant, while the two non-trivial <a style="color: #808080;" title="Cyclic permutation" href="https://en.wikipedia.org/wiki/Cyclic_permutation">cyclic permutations</a> of the roots send <span class="texhtml"><i>s</i><sub>1</sub></span> to <span class="texhtml"><i>ξ</i> <i>s</i><sub>1</sub></span> and <span class="texhtml"><i>s</i><sub>2</sub></span> to <span class="texhtml"><i>ξ</i><sup>2</sup><i>s</i><sub>2</sub></span>, or <span class="texhtml"><i>s</i><sub>1</sub></span> to <span class="texhtml"><i>ξ</i><sup>2</sup><i>s</i><sub>1</sub></span> and <span class="texhtml"><i>s</i><sub>2</sub></span> to <span class="texhtml"><i>ξ</i> <i>s</i><sub>2</sub></span> (depending on which permutation), while transposing <span class="texhtml"><i>x</i><sub>1</sub></span> and <span class="texhtml"><i>x</i><sub>2</sub></span> switches <span class="texhtml"><i>s</i><sub>1</sub></span> and <span class="texhtml"><i>s</i><sub>2</sub></span>; other transpositions switch these roots and multiply them by a power of <span class="texhtml"><i>ξ</i></span>.</span>  <span style="color: #808080;">Thus <span class="texhtml"><i>s</i><sub>1</sub><sup>3</sup></span>, <span class="texhtml"><i>s</i><sub>2</sub><sup>3</sup></span> and <span class="texhtml"><i>s</i><sub>1</sub><i>s</i><sub>2</sub></span> are left invariant by the cyclic permutations of the roots, which multiply them by <span class="texhtml"><i>ξ</i><sup>3</sup> = 1</span>. Also <span class="texhtml"><i>s</i><sub>1</sub><i>s</i><sub>2</sub></span> and <span class="texhtml"><i>s</i><sub>1</sub><sup>3</sup> + <i>s</i><sub>2</sub><sup>3</sup></span> are left invariant by the transposition of <span class="texhtml"><i>x</i><sub>1</sub></span> and <span class="texhtml"><i>x</i><sub>2</sub></span> which exchanges <span class="texhtml"><i>s</i><sub>1</sub></span> and <span class="texhtml"><i>s</i><sub>2</sub></span>. As the <a style="color: #808080;" title="Permutation group" href="https://en.wikipedia.org/wiki/Permutation_group">permutation group</a> <span class="texhtml"><i>S</i><sub>3</sub></span> of the roots is generated by these permutations, it follows that <span class="texhtml"><i>s</i><sub>1</sub><sup>3</sup> + <i>s</i><sub>2</sub><sup>3</sup></span> and <span class="texhtml"><i>s</i><sub>1</sub><i>s</i><sub>2</sub></span> are <a style="color: #808080;" title="Symmetric polynomial" href="https://en.wikipedia.org/wiki/Symmetric_polynomial">symmetric functions</a> of the roots and may thus be written as polynomials in the <a style="color: #808080;" title="Elementary symmetric polynomial" href="https://en.wikipedia.org/wiki/Elementary_symmetric_polynomial">elementary symmetric polynomials</a> and thus as <a style="color: #808080;" title="Rational function" href="https://en.wikipedia.org/wiki/Rational_function">rational functions</a> of the coefficients of the equation. Let <span class="texhtml"><i>s</i><sub>1</sub><sup>3</sup> + <i>s</i><sub>2</sub><sup>3</sup> = <i>A</i></span> and <span class="texhtml"><i>s</i><sub>1</sub><i>s</i><sub>2</sub> = <i>B</i></span> in these expressions, which will be explicitly computed below.</span>  <span style="color: #808080;">We have that <span class="texhtml"><i>s</i><sub>1</sub><sup>3</sup></span> and <span class="texhtml"><i>s</i><sub>2</sub><sup>3</sup></span> are the two roots of the quadratic equation <span class="texhtml"><i>z</i><sup>2</sup> − <i>Az</i> + <i>B</i><sup>3</sup> = 0</span>. Thus the resolution of the equation may be finished exactly as described for Cardano's method, with <span class="texhtml"><i>s</i><sub>1</sub></span> and <span class="texhtml"><i>s</i><sub>2</sub></span> in place of <span class="texhtml mvar">u</span> and <span class="texhtml mvar">v</span>.</span> <h4><span id="Computation_of_A_and_B" class="mw-headline" style="color: #808080;">Computation of <i>A</i> and <i>B</i></span></h4> <span style="color: #808080;">Setting <span class="texhtml"><i>E</i><sub>1</sub> = <i>x</i><sub>0</sub> + <i>x</i><sub>1</sub> + <i>x</i><sub>2</sub></span>, <span class="texhtml"><i>E</i><sub>2</sub> = <i>x</i><sub>0</sub> <i>x</i><sub>1</sub> + <i>x</i><sub>1</sub> <i>x</i><sub>2</sub> + <i>x</i><sub>2</sub> <i>x</i><sub>0</sub></span> and <span class="texhtml"><i>E</i><sub>3</sub> = <i>x</i><sub>0</sub> <i>x</i><sub>1</sub> <i>x</i><sub>2</sub></span>, the elementary symmetric polynomials, we have, using that <span class="texhtml"><i>ξ</i><sup>3</sup> = 1</span>:</span>  <dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d73a441c6318997f243434a988e09076a4680dcc" alt="{\displaystyle s_{1}^{3}=x_{0}^{3}+x_{1}^{3}+x_{2}^{3}+3\zeta (x_{0}^{2}x_{1}+x_{1}^{2}x_{2}+x_{2}^{2}x_{0})+3\zeta ^{2}(x_{0}x_{1}^{2}+x_{1}x_{2}^{2}+x_{2}x_{0}^{2})+6x_{0}x_{1}x_{2}\,.}" /></span></dd></dl><span style="color: #808080;">The expression for <span class="texhtml"><i>s</i><sub>2</sub><sup>3</sup></span> is the same with <span class="texhtml"><i>ξ</i></span> and <span class="texhtml"><i>ξ</i><sup>2</sup></span> exchanged. Thus, using <span class="texhtml"><i>ξ</i><sup>2</sup> + <i>ξ</i> = −1</span> we get</span>  <dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c0080e5f1ab617c00e45ef0f477487e2c2d192c0" alt="A=s_{1}^{3}+s_{2}^{3}=2(x_{0}^{3}+x_{1}^{3}+x_{2}^{3})-3(x_{0}^{2}x_{1}+x_{1}^{2}x_{2}+x_{2}^{2}x_{0}+x_{0}x_{1}^{2}+x_{1}x_{2}^{2}+x_{2}x_{0}^{2})+12x_{0}x_{1}x_{2}\,," /></span></dd></dl><span style="color: #808080;">and a straightforward computation gives</span>  <dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8c3992a40096a19b340bbb1d25cc640f7da45489" alt="A=s_{1}^{3}+s_{2}^{3}=2E_{1}^{3}-9E_{1}E_{2}+27E_{3}\,." /></span></dd></dl><span style="color: #808080;">Similarly we have</span>  <dl><dd><span style="color: #808080;"><img class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/872816595c1e986b7c91cf46fbb8cad5aea1c540" alt="B=s_{1}s_{2}=x_{0}^{2}+x_{1}^{2}+x_{2}^{2}+(\zeta +\zeta ^{2})(x_{0}x_{1}+x_{1}x_{2}+x_{2}x_{0})=E_{1}^{2}-3E_{2}\,." /></span></dd></dl><span style="color: #808080;">When solving equation <b>(</b><a style="color: #808080;" href="https://en.wikipedia.org/wiki/Cubic_function#math_1">1</a><b>)</b> we have <span class="texhtml"><i>E</i><sub>1</sub> = −<span class="sfrac nowrap"><i>b</i><span class="visualhide">/</span><i>a</i></span></span>, <span class="texhtml"><i>E</i><sub>2</sub> = <span class="sfrac nowrap"><i>c</i><span class="visualhide">/</span><i>a</i></span></span> and <span class="texhtml"><i>E</i><sub>3</sub> = −<span class="sfrac nowrap"><i>d</i><span class="visualhide">/</span><i>a</i></span></span>. With equation <b>(</b><a style="color: #808080;" href="https://en.wikipedia.org/wiki/Cubic_function#math_2">2</a><b>)</b>, we have <span class="texhtml"><i>E</i><sub>1</sub> = 0</span>, <span class="texhtml"><i>E</i><sub>2</sub> = <i>p</i></span> and <span class="texhtml"><i>E</i><sub>3</sub> = −<i>q</i></span> and thus <span class="texhtml"><i>A</i> = −27<i>q</i></span> and <span class="texhtml"><i>B</i> = −3<i>p</i></span>.</span>  <span style="color: #808080;">Note that with equation <b>(</b><a style="color: #808080;" href="https://en.wikipedia.org/wiki/Cubic_function#math_2">2</a><b>)</b>, we have <span class="texhtml"><i>x</i><sub>0</sub> = <span class="sfrac nowrap">1<span class="visualhide">/</span>3</span>(<i>s</i><sub>1</sub> + <i>s</i><sub>2</sub>)</span> and <span class="texhtml"><i>s</i><sub>1</sub><i>s</i><sub>2</sub> = −3<i>p</i></span>, while in Cardano's method we have set <span class="texhtml"><i>x</i><sub>0</sub> = <i>u</i> + <i>v</i></span> and <span class="texhtml"><i>uv</i> = −<span class="sfrac nowrap">1<span class="visualhide">/</span>3</span><i>p</i></span>. Thus we have, up to the exchange of <span class="texhtml mvar">u</span> and <span class="texhtml mvar">v</span>, <span class="texhtml"><i>s</i><sub>1</sub> = 3<i>u</i></span> and <span class="texhtml"><i>s</i><sub>2</sub> = 3<i>v</i></span> . In other words, in this case, Cardano's method and Lagrange's method compute exactly the same things, up to a factor of three in the auxiliary variables, the main difference being that Lagrange's method explains why these auxiliary variables appear in the problem.</span>     <span style="color: #003300;">還是得自己動動手呢!!??</span> <pre class="lang:python decode:true">pi@raspberrypi:~ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
>>> x0, x1, x2, ζ = symbols('x0, x1, x2, ζ')
>>> s0 = x0 + x1 + x2
>>> s1 = x0 + ζ*x1 + ζ**2 * x2
>>> s2 = x0 + ζ**2 * x1 + ζ*x2

>>> (s1**2).expand()
x0**2 + 2*x0*x1*ζ + 2*x0*x2*ζ**2 + x1**2*ζ**2 + 2*x1*x2*ζ**3 + x2**2*ζ**4

>>> collect(x0**2 + 2*x0*x1*ζ + 2*x0*x2*ζ**2 + x1**2*ζ**2 + 2*x1*x2 + x2**2*ζ, ζ)

x0**2 + 2*x1*x2 + ζ**2*(2*x0*x2 + x1**2) + ζ*(2*x0*x1 + x2**2)

>>> (s1**3).expand()
x0**3 + 3*x0**2*x1*ζ + 3*x0**2*x2*ζ**2 + 3*x0*x1**2*ζ**2 + 6*x0*x1*x2*ζ**3 + 3*x0*x2**2*ζ**4 + x1**3*ζ**3 + 3*x1**2*x2*ζ**4 + 3*x1*x2**2*ζ**5 + x2**3*ζ**6

>>> collect(x0**3 + 3*x0**2*x1*ζ + 3*x0**2*x2*ζ**2 + 3*x0*x1**2*ζ**2 + 6*x0*x1*x2 + 3*x0*x2**2*ζ + x1**3 + 3*x1**2*x2*ζ + 3*x1*x2**2*ζ**2 + x2**3, ζ)

x0**3 + 6*x0*x1*x2 + x1**3 + x2**3 + ζ**2*(3*x0**2*x2 + 3*x0*x1**2 + 3*x1*x2**2) + ζ*(3*x0**2*x1 + 3*x0*x2**2 + 3*x1**2*x2)

>>> (s1*s2).expand()
x0**2 + x0*x1*ζ**2 + x0*x1*ζ + x0*x2*ζ**2 + x0*x2*ζ + x1**2*ζ**3 + x1*x2*ζ**4 + x1*x2*ζ**2 + x2**2*ζ**3

>>> collect(x0**2 + x0*x1*ζ**2 + x0*x1*ζ + x0*x2*ζ**2 + x0*x2*ζ + x1**2 + x1*x2*ζ + x1*x2*ζ**2 + x2**2, ζ)

x0**2 + x1**2 + x2**2 + ζ**2*(x0*x1 + x0*x2 + x1*x2) + ζ*(x0*x1 + x0*x2 + x1*x2)
>>> 

 

如是在清楚通熟『四次函數』

Quartic function

In algebra, a quartic function is a function of the form

f(x)=ax^{4}+bx^{3}+cx^{2}+dx+e,

where a is nonzero, which is defined by a polynomial of degree four, called quartic polynomial.

Sometimes the term biquadratic is used instead of quartic, but, usually, biquadratic function refers to a quadratic function of a square (or, equivalently, to the function defined by a quartic polynomial without terms of odd degree), having the form

f(x)=ax^{4}+cx^{2}+e.

A quartic equation, or equation of the fourth degree, is an equation that equates a quartic polynomial to zero, of the form

ax^{4}+bx^{3}+cx^{2}+dx+e=0,

where a ≠ 0.

The derivative of a quartic function is a cubic function.

Since a quartic function is defined by a polynomial of even degree, it has the same infinite limit when the argument goes to positive or negative infinity. If a is positive, then the function increases to positive infinity at both ends; and thus the function has a global minimum. Likewise, if a is negative, it decreases to negative infinity and has a global maximum. In both cases it may or may not have another local maximum and another local minimum.

The degree four (quartic case) is the highest degree such that every polynomial equation can be solved by radicals.

Solving by Lagrange resolvent

The symmetric group S4 on four elements has the Klein four-group as a normal subgroup. This suggests using a resolvent cubic whose roots may be variously described as a discrete Fourier transform or a Hadamard matrix transform of the roots; see Lagrange resolvents for the general method. Denote by xi, for i from 0 to 3, the four roots of x4 + bx3 + cx2 + dx + e. If we set

{\begin{aligned}s_{0}&={\tfrac {1}{2}}(x_{0}+x_{1}+x_{2}+x_{3}),\\s_{1}&={\tfrac {1}{2}}(x_{0}-x_{1}+x_{2}-x_{3}),\\s_{2}&={\tfrac {1}{2}}(x_{0}+x_{1}-x_{2}-x_{3}),\\s_{3}&={\tfrac {1}{2}}(x_{0}-x_{1}-x_{2}+x_{3}),\end{aligned}}

then since the transformation is an involution we may express the roots in terms of the four si in exactly the same way. Since we know the value s0 = −b/2, we only need the values for s1, s2 and s3. These are the roots of the polynomial

{\displaystyle (s^{2}-{s_{1}}^{2})(s^{2}-{s_{2}}^{2})(s^{2}-{s_{3}}^{2}).}

Substituting the si by their values in term of the xi, this polynomial may be expanded in a polynomial in s whose coefficients are symmetric polynomials in the xi. By the fundamental theorem of symmetric polynomials, these coefficients may be expressed as polynomials in the coefficients of the monic quartic. If, for simplification, we suppose that the quartic is depressed, that is b = 0, this results in the polynomial

{\displaystyle {s}^{6}+2c\,{s}^{4}+({c}^{2}-4e)\,{s}^{2}-{d}^{2}}
     
 
(3)

This polynomial is of degree six, but only of degree three in s2, and so the corresponding equation is solvable by the method described in the article about cubic function. By substituting the roots in the expression of the xi in terms of the si, we obtain expression for the roots. In fact we obtain, apparently, several expressions, depending on the numbering of the roots of the cubic polynomial and of the signs given to their square roots. All these different expressions may be deduced from one of them by simply changing the numbering of the xi.

These expressions are unnecessarily complicated, involving the cubic roots of unity, which can be avoided as follows. If s is any non-zero root of (3), and if we set

{\displaystyle {\begin{aligned}F_{1}(x)&={x}^{2}+sx+{\frac {c}{2}}+{\frac {s^{2}}{2}}-{\frac {d}{2s}}\\F_{2}(x)&={x}^{2}-sx+{\frac {c}{2}}+{\frac {s^{2}}{2}}+{\frac {d}{2s}}\end{aligned}}}

then

{\displaystyle F_{1}(x)\times F_{2}(x)=x^{4}+cx^{2}+dx+e.}

We therefore can solve the quartic by solving for s and then solving for the roots of the two factors using the quadratic formula.

Note that this gives exactly the same formula for the roots as the one provided by Descartes’ method.

 

之後,或能欣賞阿貝爾和伽羅瓦優美的

可解群

數學的歷史中,群論原本起源於對五次方程及更高次方程無一般的公式解之證明的找尋,最終隨著伽羅瓦理論的提出而確立。可解群的概念產生於描述其根可以只用根式(平方根、立方根等等及其和與積)表示的多項式所對應的自同構群所擁有的性質。

一個群被稱為可解的,若它擁有一個其商群皆為阿貝爾群正規列。或者等價地說,若其降正規列

G ▹ G ( 1 ) ▹ G ( 2 ) ▹ ⋯ , G\triangleright G^{{(1)}}\triangleright G^{{(2)}}\triangleright \cdots ,

之中,每一個子群都會是前一個的導群,且最後一個為G的當然子群{1}。上述兩個定義是等價的,對一個群HH正規子群N,其商群H/N為可交換的若且唯若N包含著H(1)

對於有限群,有一個等價的定義為:一可解群為一有著其商群皆為質數循環群合成列的群。此一定義會等價是因為每一個簡單阿貝爾群都是有質數階的循環群。若爾當-赫爾德定理表示若一個合成列有此性質,則其循環群即會對應到某個體上的n個根。但此一定義的等價性並不必然於無限群中亦會成立:例如,因為每一個在加法下的整數群Z的非當然子群皆同構Z本身,它不會有合成列,但是其有著唯一同構於Z的商群之正規列{0,Z},證明了其確實是可解的。

喬治·波里亞的格言「若有一個你無法算出的問題,則會有的你可以算出的較簡單的問題」相一致的,可解群通常在簡化有關一複雜的群的推測至一系列有著簡單結構-阿貝爾群的群的推測有著很有用的功用。

 

理論吧!!!

 

 

 

 

 

 

 

 

 

 

 

 

 

輕。鬆。學。部落客