## 線性代數在數值分析的應用 (一)：兩點邊值問題

${x}''-x=t$

\begin{aligned}\displaystyle x(t_i+h)&=x(t_i)+x'(t_i)h+ \frac{h^2}{2!}x'' (t_i)+\frac{h^3}{3!}x''' (t_i)+\cdots\\ x(t_i-h)&=x(t_i)-x'(t_i)h+ \frac{h^2}{2!}x'' (t_i)-\frac{h^3}{3!}x''' (t_i)+\cdots\end{aligned}

\begin{aligned}\displaystyle x'(t_i)&=\frac{x(t_i+h)-x(t_i-h)}{2h}+O(h^2)\\ x''(t_i)&=\frac{x(t_i+h)-2x(t_i)+x(t_i-h)}{h^2}+O(h^2)\end{aligned}

\begin{aligned}\displaystyle x'(t_i)&\approx\frac{x_{i+1}-x_{i-1}}{2h}\\ x''(t_i)&\approx\frac{x_{i+1}-2x_i+x_{i-1}}{h^2}\end{aligned}

$\displaystyle \frac{x_{i+1}-2x_i+x_{i-1}}{h^2}-x_i=t_i$

$x_{i-1}-(2+h^2)x_i+x_{i+1}=h^2t_i=ih^3,~~i=1,2,\ldots,n$

\begin{aligned} &\begin{bmatrix} -2-h^2&1&0&\cdots&0&0&0\\ 1&-2-h^2&1&\cdots&0&0&0\\ 0&1&-2-h^2&\cdots&0&0&0\\ \vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\ 0&0&0&\cdots&-2-h^2&1&0\\ 0&0&0&\cdots&1&-2-h^2&1\\ 0&0&0&\cdots&0&1&-2-h^2 \end{bmatrix}\begin{bmatrix} x_1\\ x_2\\ x_3\\ \vdots\\ x_{n-2}\\ x_{n-1}\\ x_n \end{bmatrix}\\ &=\begin{bmatrix} h^3-2\\ 2h^3\\ 3h^3\\ \vdots\\ (n-2)h^3\\ (n-1)h^3\\ nh^3+1 \end{bmatrix}\end{aligned}

This entry was posted in 線性代數專欄, 應用之道 and tagged , , , , . Bookmark the permalink.