fbpx
维基百科

欧拉方法

数学计算机科学中,欧拉方法(英語:Euler method[註 1]),是一种一阶数值方法,用以对给定初值的常微分方程[註 2]求解。

欧拉方法是常微分方程數值方法英语Numerical methods for ordinary differential equations中最基本的显式方法;也是一个一方法,意味着其局部截断误差[註 3]正比于步长的平方,并且其全局截断误差正比于步长。[註 4]

非正式的几何描述 编辑

 
欧拉方法的图示。待求的曲线为蓝色,它的折線近似为红色。

考虑计算這樣的一个未知曲線的形状:它具有给定的起点并且满足一个给定的微分方程。 这里,所谓“微分方程”可以看作能够通过曲线上任意点的位置而计算出这一点的切线斜率的公式。

思路是,一开始只知道曲線的起点(假设为 ),曲線其他部份是未知的,不過通过微分方程, 的斜率可以被计算出来,也就得到了切线。

顺着切线向前走一小步到点 。如果假设 是曲线上的一点(实际上通常不是),那么同样的道理就可以确定下一条切线,依此类推。在经过几步之后,一条折线英语Polygonal chain 就被计算出来了。一般情况下,这条折线与原先的未知曲线偏离不远,并且任意小的误差都可以通过减少步长来得到。

欧拉方法的推导 编辑

 
图示为方程 的数值积分。蓝色为欧拉法,绿色为中点法英语Midpoint method,红色为精确解 。所用步长為 
 
图示为同一个方程在步长 时的结果。可以看出中点法比欧拉法收敛更快。

以以下微分方程為例

 

希望用 y 在點 (t0,y(t0)) 附近的線性近似來得到其近似解(也就是 y泰勒展開式的前二項)。利用時間 tn 時的數值,若用單步的欧拉方法,可得到時間 tn+1 = tn + h 時的近似值如下:

 

欧拉方法是一種顯型方法,也就是說   的解是  ,   的顯函數。

欧拉方法可以求解一階的微分方程,而任何 階的微分方程都可以表示成一階的微分方程。

對於微分方程

 

可以通過新設輔助變量  ,得到以下的等價方程

 

這是一個以 為變量的一階系統,因此可以用歐拉法求解,也可以使用其他的一階數值方法。[1]

应用例题 编辑

设微分方程为   ,初始值为  ,试用欧拉方法求  的近似值,步长为  

欧拉法為:

 

首先求 (当 ), 的定義為 ,因此有

 

透過以上步驟,求得解曲線在点 的切线斜率。回顾直線斜率的定义: 变化量和 变化量的比值,亦記作 

接著是

 
 

重复以上步骤求出  的值。

 
 

由于欧拉法属于递归算法,把運算整理成表格也許有助於避免計算錯誤。

           
1 0 1 1 1 2
2 1 2 1 2 4
4 2 4 1 4 8

局部截尾误差 编辑

欧拉法的局部截尾误差(Local truncation error, LTE)是指在实施一次欧拉法所产生的误差,是指经过一步的数值解 与在 时精确解的误差。数值解 由以下给出:

 

对于精确解,使用泰勒级数展开给出:

 

欧拉法的局部截尾误差为:

 

 拥有三阶有界导数时,这个结果是成立的。[2]

结果显示:当步长 很小时,局部截尾误差近似与   成比例。也就是说,欧拉法没有其他的高阶方法如龙格-库塔法线性多步法英语Linear multistep method精确,这些方法的局部截尾误差与 p>2)成比例。

全局截尾误差 编辑

全局截尾误差(Global truncation error, GTE)是指在一个固定时间 时的误差,但是很多步之后该方法需要以从初始时间到达该时间来计算。全局截尾误差可以看做是一个每一步的局部截尾误差的累积效应。[3] 经过的步骤數為 ,而每步的误差则正比于 。因此,可以预期全局截尾误差是正比于 的。[4]

这个直观的推测可以被嚴謹地證明。如果解 存在二阶有界导数,并且 關於 利普希茨连续的,那么全局截尾误差是有界的:

 

其中   是在给定区间内 的二阶导数的上界,  的利普希茨常数。[5]

这种精确的形式其实是没有什么意义的,通常情况下这个上界都會嚴重高估了欧拉法所造成的实际误差。[6]重要的是,这顯示了全局截尾误差是近似正比于 的,所以欧拉法被稱为是一阶的。[7]

相關條目 编辑

  • 克兰克-尼科尔森方法
  • 梯度下降法,也是用有限步進行,計算函數的最小值。
  • 龍格-庫塔法列表英语List of Runge-Kutta methods
  • 線性多步法英语Linear multistep method
  • 數值積分(計算定積分)
  • 常微分方程數值方法英语Numerical methods for ordinary differential equations

註腳 编辑

  1. ^ 命名自它的发明者萊昂哈德·歐拉
  2. ^ 初值問題
  3. ^ 即每步误差
  4. ^ 欧拉方法经常应用于作为构建一些更复杂方法的基础,例如预估-校正方法

参考资料 编辑

  1. ^ Butcher 2003,第3頁;Hairer, Nørsett & Wanner 1993,第2頁
  2. ^ Butcher 2003,第60頁
  3. ^ Atkinson 1989,第344頁
  4. ^ Butcher 2003,第49頁
  5. ^ Atkinson 1989,第346頁;Lakoba 2012,公式 (1.16)
  6. ^ Iserles 1996,第7頁
  7. ^ Butcher 2003,第63頁

参考文献 编辑

  • Atkinson, Kendall A., An Introduction to Numerical Analysis 2nd, New York: John Wiley & Sons, 1989, ISBN 978-0-471-50023-0 .
  • Ascher, Uri M.; Petzold, Linda R., Computer Methods for Ordinary Differential Equations and Differential-Algebraic Equations, Philadelphia: Society for Industrial and Applied Mathematics, 1998, ISBN 978-0-89871-412-8 .
  • Butcher, John C., Numerical Methods for Ordinary Differential Equations, New York: John Wiley & Sons, 2003, ISBN 978-0-471-96758-3 .
  • Hairer, Ernst; Nørsett, Syvert Paul; Wanner, Gerhard, Solving ordinary differential equations I: Nonstiff problems, Berlin, New York: Springer-Verlag, 1993, ISBN 978-3-540-56670-0 .
  • Iserles, Arieh, A First Course in the Numerical Analysis of Differential Equations, Cambridge University Press, 1996, ISBN 978-0-521-55655-2 .
  • Lakoba, Taras I., Simple Euler method and its modifications (PDF) (Lecture notes for MATH334, University of Vermont), 2012 [2016-01-02], (原始内容 (PDF)于2012-07-12) .

欧拉方法, 此條目可参照英語維基百科相應條目来扩充, 2021年9月25日, 若您熟悉来源语言和主题, 请协助参考外语维基百科扩充条目, 请勿直接提交机械翻译, 也不要翻译不可靠, 低品质内容, 依版权协议, 译文需在编辑摘要注明来源, 或于讨论页顶部标记, href, template, translated, page, html, title, template, translated, page, translated, page, 标签, 在数学和计算机科学中, 英語, euler, method, 是一. 此條目可参照英語維基百科相應條目来扩充 2021年9月25日 若您熟悉来源语言和主题 请协助参考外语维基百科扩充条目 请勿直接提交机械翻译 也不要翻译不可靠 低品质内容 依版权协议 译文需在编辑摘要注明来源 或于讨论页顶部标记 a href Template Translated page html title Template Translated page Translated page a 标签 在数学和计算机科学中 欧拉方法 英語 Euler method 註 1 是一种一阶数值方法 用以对给定初值的常微分方程 註 2 求解 欧拉方法是常微分方程數值方法 英语 Numerical methods for ordinary differential equations 中最基本的显式方法 也是一个一阶方法 意味着其局部截断误差 註 3 正比于步长的平方 并且其全局截断误差正比于步长 註 4 目录 1 非正式的几何描述 2 欧拉方法的推导 3 应用例题 4 局部截尾误差 5 全局截尾误差 6 相關條目 7 註腳 8 参考资料 9 参考文献非正式的几何描述 编辑 nbsp 欧拉方法的图示 待求的曲线为蓝色 它的折線近似为红色 考虑计算這樣的一个未知曲線的形状 它具有给定的起点并且满足一个给定的微分方程 这里 所谓 微分方程 可以看作能够通过曲线上任意点的位置而计算出这一点的切线斜率的公式 思路是 一开始只知道曲線的起点 假设为A 0 displaystyle A 0 nbsp 曲線其他部份是未知的 不過通过微分方程 A 0 displaystyle A 0 nbsp 的斜率可以被计算出来 也就得到了切线 顺着切线向前走一小步到点A 1 displaystyle A 1 nbsp 如果假设A 1 displaystyle A 1 nbsp 是曲线上的一点 实际上通常不是 那么同样的道理就可以确定下一条切线 依此类推 在经过几步之后 一条折线 英语 Polygonal chain A 0 A 1 A 2 A 3 displaystyle A 0 A 1 A 2 A 3 dots nbsp 就被计算出来了 一般情况下 这条折线与原先的未知曲线偏离不远 并且任意小的误差都可以通过减少步长来得到 欧拉方法的推导 编辑 nbsp 图示为方程y y y 0 1 displaystyle y y y 0 1 nbsp 的数值积分 蓝色为欧拉法 绿色为中点法 英语 Midpoint method 红色为精确解y e t displaystyle y e t nbsp 所用步长為h 1 0 displaystyle h 1 0 nbsp nbsp 图示为同一个方程在步长h 0 25 displaystyle h 0 25 nbsp 时的结果 可以看出中点法比欧拉法收敛更快 以以下微分方程為例 y t f t y t y t 0 y 0 displaystyle y t f t y t qquad y t 0 y 0 nbsp 希望用 y 在點 t0 y t0 附近的線性近似來得到其近似解 也就是 y 的泰勒展開式的前二項 利用時間 tn 時的數值 若用單步的欧拉方法 可得到時間 tn 1 tn h 時的近似值如下 y n 1 y n h f t n y n displaystyle y n 1 y n hf t n y n qquad qquad nbsp 欧拉方法是一種顯型方法 也就是說 y n 1 displaystyle y n 1 nbsp 的解是 y i displaystyle y i nbsp i n displaystyle i leq n nbsp 的顯函數 欧拉方法可以求解一階的微分方程 而任何N displaystyle N nbsp 階的微分方程都可以表示成一階的微分方程 對於微分方程 y N t f t y t y t y N 1 t displaystyle y N t f t y t y t ldots y N 1 t nbsp 可以通過新設輔助變量 z 1 t y t z 2 t y t z N t y N 1 t displaystyle z 1 t y t z 2 t y t ldots z N t y N 1 t nbsp 得到以下的等價方程 z t z 1 t z N 1 t z N t y t y N 1 t y N t z 2 t z N t f t z 1 t z N t displaystyle mathbf z t begin pmatrix z 1 t vdots z N 1 t z N t end pmatrix begin pmatrix y t vdots y N 1 t y N t end pmatrix begin pmatrix z 2 t vdots z N t f t z 1 t ldots z N t end pmatrix nbsp 這是一個以z t displaystyle mathbf z t nbsp 為變量的一階系統 因此可以用歐拉法求解 也可以使用其他的一階數值方法 1 应用例题 编辑设微分方程为 y y displaystyle y y nbsp 初始值为 y 0 1 displaystyle y 0 1 nbsp 试用欧拉方法求 y 3 displaystyle y 3 nbsp 的近似值 步长为 h 1 displaystyle h 1 nbsp 欧拉法為 y n 1 y n h f t n y n displaystyle y n 1 y n hf t n y n nbsp 首先求f t 0 y 0 displaystyle f t 0 y 0 nbsp 当n 0 displaystyle n 0 nbsp f displaystyle f nbsp 的定義為f t y y displaystyle f t y y nbsp 因此有 f t 0 y 0 f 0 1 1 displaystyle f t 0 y 0 f 0 1 1 nbsp 透過以上步驟 求得解曲線在点 0 1 displaystyle 0 1 nbsp 的切线斜率 回顾直線斜率的定义 y displaystyle y nbsp 变化量和t displaystyle t nbsp 变化量的比值 亦記作D y D t displaystyle Delta y Delta t nbsp 接著是 h f y 0 1 1 1 displaystyle h cdot f y 0 1 cdot 1 1 nbsp y 0 h f y 0 y 1 1 1 1 2 displaystyle y 0 hf y 0 y 1 1 1 cdot 1 2 nbsp 重复以上步骤求出y 2 displaystyle y 2 nbsp 和 y 3 displaystyle y 3 nbsp 的值 y 2 y 1 h f y 1 2 1 2 4 displaystyle y 2 y 1 hf y 1 2 1 cdot 2 4 nbsp y 3 y 2 h f y 2 4 1 4 8 displaystyle y 3 y 2 hf y 2 4 1 cdot 4 8 nbsp 由于欧拉法属于递归算法 把運算整理成表格也許有助於避免計算錯誤 y n displaystyle y n nbsp t n displaystyle t n nbsp y t displaystyle y t nbsp h displaystyle h nbsp d y displaystyle dy nbsp y n 1 displaystyle y n 1 nbsp 1 0 1 1 1 22 1 2 1 2 44 2 4 1 4 8局部截尾误差 编辑欧拉法的局部截尾误差 Local truncation error LTE 是指在实施一次欧拉法所产生的误差 是指经过一步的数值解y 1 displaystyle y 1 nbsp 与在t 1 t 0 h displaystyle t 1 t 0 h nbsp 时精确解的误差 数值解y 1 displaystyle y 1 nbsp 由以下给出 y 1 y 0 h f t 0 y 0 displaystyle y 1 y 0 hf t 0 y 0 quad nbsp 对于精确解 使用泰勒级数展开给出 y t 0 h y t 0 h y t 0 1 2 h 2 y t 0 O h 3 displaystyle y t 0 h y t 0 hy t 0 frac 1 2 h 2 y t 0 O h 3 nbsp 欧拉法的局部截尾误差为 L T E y t 0 h y 1 1 2 h 2 y t 0 O h 3 displaystyle mathrm LTE y t 0 h y 1 frac 1 2 h 2 y t 0 O h 3 nbsp 当y displaystyle y nbsp 拥有三阶有界导数时 这个结果是成立的 2 结果显示 当步长h displaystyle h nbsp 很小时 局部截尾误差近似与 h 2 displaystyle h 2 nbsp 成比例 也就是说 欧拉法没有其他的高阶方法如龙格 库塔法和线性多步法 英语 Linear multistep method 精确 这些方法的局部截尾误差与h p displaystyle h p nbsp p gt 2 成比例 全局截尾误差 编辑全局截尾误差 Global truncation error GTE 是指在一个固定时间t displaystyle t nbsp 时的误差 但是很多步之后该方法需要以从初始时间到达该时间来计算 全局截尾误差可以看做是一个每一步的局部截尾误差的累积效应 3 经过的步骤數為 t t 0 h displaystyle t t 0 h nbsp 而每步的误差则正比于h 2 displaystyle h 2 nbsp 因此 可以预期全局截尾误差是正比于h displaystyle h nbsp 的 4 这个直观的推测可以被嚴謹地證明 如果解y displaystyle y nbsp 存在二阶有界导数 并且f displaystyle f nbsp 關於y displaystyle y nbsp 是利普希茨连续的 那么全局截尾误差是有界的 GTE h M 2 L e L t t 0 1 displaystyle text GTE leq frac hM 2L e L t t 0 1 qquad qquad nbsp 其中 M displaystyle M nbsp 是在给定区间内y displaystyle y nbsp 的二阶导数的上界 L displaystyle L nbsp 是f displaystyle f nbsp 的利普希茨常数 5 这种精确的形式其实是没有什么意义的 通常情况下这个上界都會嚴重高估了欧拉法所造成的实际误差 6 重要的是 这顯示了全局截尾误差是近似正比于h displaystyle h nbsp 的 所以欧拉法被稱为是一阶的 7 相關條目 编辑克兰克 尼科尔森方法 梯度下降法 也是用有限步進行 計算函數的最小值 龍格 庫塔法列表 英语 List of Runge Kutta methods 線性多步法 英语 Linear multistep method 數值積分 計算定積分 常微分方程數值方法 英语 Numerical methods for ordinary differential equations 註腳 编辑 命名自它的发明者萊昂哈德 歐拉 即初值問題 即每步误差 欧拉方法经常应用于作为构建一些更复杂方法的基础 例如预估 校正方法 参考资料 编辑 Butcher 2003 第3頁 Hairer Norsett amp Wanner 1993 第2頁 Butcher 2003 第60頁 Atkinson 1989 第344頁 Butcher 2003 第49頁 Atkinson 1989 第346頁 Lakoba 2012 公式 1 16 Iserles 1996 第7頁 Butcher 2003 第63頁参考文献 编辑Atkinson Kendall A An Introduction to Numerical Analysis 2nd New York John Wiley amp Sons 1989 ISBN 978 0 471 50023 0 Ascher Uri M Petzold Linda R Computer Methods for Ordinary Differential Equations and Differential Algebraic Equations Philadelphia Society for Industrial and Applied Mathematics 1998 ISBN 978 0 89871 412 8 Butcher John C Numerical Methods for Ordinary Differential Equations New York John Wiley amp Sons 2003 ISBN 978 0 471 96758 3 Hairer Ernst Norsett Syvert Paul Wanner Gerhard Solving ordinary differential equations I Nonstiff problems Berlin New York Springer Verlag 1993 ISBN 978 3 540 56670 0 Iserles Arieh A First Course in the Numerical Analysis of Differential Equations Cambridge University Press 1996 ISBN 978 0 521 55655 2 Lakoba Taras I Simple Euler method and its modifications PDF Lecture notes for MATH334 University of Vermont 2012 2016 01 02 原始内容存档 PDF 于2012 07 12 取自 https zh wikipedia org w index php title 欧拉方法 amp oldid 76673115, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。