查看“︁中点法”︁的源代码
←
中点法
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[File:Midpoint method illustration.png|right|thumb|中點法的圖示說明,假設<math>y_n</math>等於<math>y(t_n)</math>的實際值。中點法計算<math>y_{n+1}</math>讓紅色的弦近似平行於中點處的切線(綠色)]] [[数值分析]]裡的'''中点法'''(midpoint method)是求解[[常微分方程]]的一種[[常微分方程数值方法|数值方法]],屬於單步法。 :<math> y'(t) = f(t, y(t)), \quad y(t_0) = y_0 .</math> 上式的顯式中點法為 {{NumBlk|:|<math> y_{n+1} = y_n + hf\left(t_n+\frac{h}{2},y_n+\frac{h}{2}f(t_n, y_n)\right), </math>|{{EquationRef|1e}}}} 隱式中點法為 {{NumBlk|:|<math> y_{n+1} = y_n + hf\left(t_n+\frac{h}{2},\frac12 (y_n+y_{n+1})\right), </math>|{{EquationRef|1i}}}} <math>n=0, 1, 2, \dots</math>。此處<math>h</math>是步階長度,是一個小的正數,<math>t_n=t_0 + n h,</math>,而<math>y_n</math>是計算<math>y(t_n)</math>的近似值。顯式中點法也稱為是'''改良的歐拉方法'''(modified Euler method)<ref>{{harvnb|Süli|Mayers|2003|p=328}}</ref>,隱式中點式是最簡單的{{link-en|配置法|collocation method}}(Collocation method),可用在哈密頓力學,也就是{{link-en|辛積分器|symplectic integrator}}。 此方法的名稱是因為上述公式會用到函數在<math>t = t_n + h/2= \tfrac{t_n+t_{n+1}}{2}</math>位置的值,也就是在<math>t_n</math>以及<math>t_{n+1}</math>中點時的值,前者的值已知,後者的值未知,在計算中點的值時,也需要有一些假設,才能進行計算。 配合圖示(見右圖)會比較容易理解此一方法。在原始的[[欧拉方法]]裡,會用<math>f(t_n, y_n)</math>,計算曲線在<math>(t_n, y_n)</math>處的切線。此切線和垂直線<math>t=t_{n+1}</math>的交點即為下一個點<math> y_{n+1}</math>的值。不過,若此函數的二階導數在時間<math>t_n</math>和<math>t_{n+1}</math>的區間均為正, 或是均為負(如圖中的例子),隨著<math>h</math>加大,曲線和切線的距離會越來越遠,導致大誤差。圖中所畫的中點的切線(上方,綠線)比較可以近似這段曲線。不過因為要求解的就是此一曲線,時間<math>t_n</math>的資訊已知,其他資訊不足,可能無法精準的畫出中點處的切線。 因此,會先用原始的歐拉方法估計在中點的<math>y(t)</math>值,再用<math>f()</math>以及估計的中點資訊,計算切線斜率。用改善後的切線從<math>y_n</math>計算<math>y_{n+1}</math>的值。最後一步即為圖的紅色弦線。因為紅色弦線是估計值,用的是<math>y(t)</math>在中點處的估計值,不一定真的會和綠線(真正的中點切線)平行,仍會有誤差。 中點法每一步的局部誤差是<math>O\left(h^3\right)</math>,全域誤差是<math>O\left(h^2\right)</math>。其運算比歐拉方法要大,但在<math>h \to 0</math>的過程中,中點法的誤差會比歐拉方法降低的更快。 此法也是高階方法(如[[龙格-库塔法]])的範例之一。 ==中點法的推導== [[File:Numerical integration illustration, step=1.svg|right|thumb|微分方程<math>y'=y,\ y(0)=1</math>的数值积分求解图。 {{legend|#0000F0|蓝:欧拉法}} {{legend|#00D000|绿:[[中点法]]}} {{legend|#F00000|红:精确解:<math>y=e^t</math>}} 步长<math>h=1.0</math>。]] [[File:Numerical integration illustration step=0.25.svg|right|thumb|同一個方程的數值方法求解,步长縮減為<math>h=0.25.</math>,可以看出中點法的收斂比歐拉法要快]] 中點法可以視為是改良版的[[欧拉方法]] :<math> y_{n+1} = y_n + hf(t_n,y_n),\, </math> 因此用類似的方式推導。 推導欧拉法的關鍵是以下的近似等式 {{NumBlk|:|<math> y(t+h) \approx y(t) + hf(t,y(t)) </math>|{{EquationRef|2}}}} 是源自以下的斜率公式 {{NumBlk|:|<math> y'(t) \approx \frac{y(t+h) - y(t)}{h} </math>|{{EquationRef|3}}}} ,其中<math> y' = f(t, y).</math> 在中點法中,將(3)改為更準確的式子 :<math> y'\left(t+\frac{h}{2}\right) \approx \frac{y(t+h) - y(t)}{h} </math> 因此可以得到以下類似(3)式,計算<math> y(t+h)</math>的式子 {{NumBlk|:|<math> y(t+h) \approx y(t) + hf\left(t+\frac{h}{2},y\left(t+\frac{h}{2}\right)\right). </math>|{{EquationRef|4}}}} 在上式中,因為還不知道<math>y</math>在<math>t+h/2</math>的值,無法用上式直接計算<math> y(t+h)</math>。解法是用[[欧拉方法]]來求解<math>y(t+h/2)</math>: :<math>y\left(t + \frac{h}{2}\right) \approx y(t) + \frac{h}{2}y'(t)=y(t) + \frac{h}{2}f(t, y(t)),</math> 代入(4)式中,可得 :<math>y(t + h) \approx y(t) + hf\left(t + \frac{h}{2}, y(t) + \frac{h}{2}f(t, y(t))\right)</math> 以上則是顯式的中點法(1e)。 隱式中點法(1i)可以將此時間內的波形假設為直線,中間步數<math>t+h/2</math>的值用<math>y(t)</math>和<math>y(t+h)</math>的平均值來表示 :<math>y\left(t+\frac h2\right)\approx \frac12\bigl(y(t)+y(t+h)\bigr)</math> 因此 :<math>\frac{y(t+h)-y(t)}{h}\approx y'\left(t+\frac h2\right)\approx k=f\left(t+\frac h2,\frac12\bigl(y(t)+y(t+h)\bigr)\right)</math> 因為隱式方法的時間對稱性,局部誤差中<math>h</math>的偶次項都消去了,局部誤差的階數是\<math>\mathcal O(h^3)</math>。 ==相關條目== * [[黎曼和]] * [[Heun方法]] * [[蛙跳积分法]]和[[韦尔莱积分法]] ==腳註== {{reflist}} ==參考資料== * {{cite book |author1=Griffiths, D. V. |author2=Smith, I. M. |title=Numerical methods for engineers: a programming approach |publisher=CRC Press |location=Boca Raton |year=1991 |isbn=0-8493-8610-1 |oclc= |doi= |page=218 }} * {{Citation | last1=Süli | first1=Endre | last2=Mayers | first2=David | title=An Introduction to Numerical Analysis | publisher=Cambridge University Press | isbn=0-521-00794-1 | year=2003}}. * {{cite book |last1=Burden | first1=Richard | last2=Faires | first2=John |title=Numerical Analysis |publisher=Richard Stratton|year=2010|isbn=978-0-538-73351-9|page=286}} {{常微分方程数值方法}} [[Category:数值微分方程]] <!-- [[Category:Runge–Kutta methods]] -->
该页面使用的模板:
Template:Citation
(
查看源代码
)
Template:Cite book
(
查看源代码
)
Template:Harvnb
(
查看源代码
)
Template:Legend
(
查看源代码
)
Template:Link-en
(
查看源代码
)
Template:NumBlk
(
查看源代码
)
Template:Reflist
(
查看源代码
)
Template:常微分方程数值方法
(
查看源代码
)
返回
中点法
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息