section 5.4 runge-kutta methods
TRANSCRIPT
![Page 1: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/1.jpg)
Section 5.4 Runge-KuttaMethods
![Page 2: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/2.jpg)
Motivation
β’ How to design a high-order accurate method without knowledge of derivatives of π π‘, π¦ , which are cumbersome to compute.
π€&'( = π€& + βπ - π‘&, π€& ,where
π - π‘&, π€& = π π‘&, π€& +β2
ππππ‘
π‘&, π€& +ππππ¦
π‘&, π€& π π‘&, π€&
β’ Recall Taylor method of order 2:
π€&'( = π€& + β π(π(π‘& + πΌ(, π€& + π½(),thendeterminethecoefficients π(, πΌ(, π½( suchthat
|π(π π‘ + πΌ(, π¦ + π½( -π - π‘, π¦ | = π(β-)
β’Main idea: design a method of the form
![Page 3: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/3.jpg)
Derivation of Runge-Kutta Method of Order Two
a) π - π‘, π¦ = π π‘, π¦ + H-IJIK
π‘, π¦ π‘ + H-IJIL
π‘, π¦ π‘ M π π‘, π¦ π‘ .
b) Using Talyor theorem of two variables (Thm 5.13 in textbook), π(π π‘ + πΌ(, π¦ + π½( = π(π π‘, π¦ + π(πΌ(
IJIK
π‘, π¦ + π(π½(IJIL
π‘, π¦
+π(π ( π‘ + πΌ(, π¦ + π½( <-- remainderβ’Matching coefficients in a) and b) βββ
π( = 1, πΌ( =β2, π½( =
β2π π‘, π¦ .
β’ The remainder term π(π ( π‘ + πΌ(, π¦ + π½( = π β- ---- >|π(π π‘ + πΌ(, π¦ + π½( β π - π‘, π¦ | = π(β-)
èèèThe new method is of order 2!!! (same order as Taylor 2)
![Page 4: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/4.jpg)
Midpoint Method
β’ The midpoint method:
π€&'( = π€& + βπ π‘& +β2, π€& +
β2π π‘&, π€& ,
for each π = 0, 1, 2,β― ,π β 1.
Remark: Local truncation error of Midpoint method is π β- .The method is second-order accurate.
![Page 5: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/5.jpg)
Two stage formula of Midpoint Method
Wπ( = π(π‘&, π€&)
π- = π π‘& +β2, π€& +
β2π(
π€&'( = π€& + βπ-for each π = 0, 1, 2,β― ,π β 1.
β’ Example 2. Use the Midpoint method with π = 2 to solve the IVPπ¦Y = π¦ β π‘- + 1, 0 β€ π‘ β€ 2, π¦ 0 = 0.5.
(MATLAB) Implement the method using β = 0.2. Record the maximum error.
![Page 6: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/6.jpg)
Midpoint
![Page 7: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/7.jpg)
Modified Euler Methodβ’ This is another Runge-Kutta method of order two:
The modified Euler method:
π€&'( = π€& +β2π π‘&, π€& + π π‘&'(, π€& + βπ π‘&, π€&
for each π = 0, 1, 2,β― ,π β 1.
Remark: Local truncation error of Modified Euler method is π β- .
![Page 8: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/8.jpg)
Two stage formula of Modified Euler Method
\π( = π(π‘&, π€&)
π- = π π‘& + β, π€& + βπ(π€&'( = π€& +
β2[π( + π-],
for each π = 0, 1, 2,β― ,π β 1.
Example 2. Use the modified Euler method with π = 2 to solve the IVP
π¦Y = π¦ β π‘- + 1, 0 β€ π‘ β€ 2, π¦ 0 = 0.5.(MATLAB) Implement the method using β = 0.2. Record the maximum error.
![Page 9: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/9.jpg)
![Page 10: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/10.jpg)
Runge-Kutta Order Four (RK4)π( = π π‘&, π€&
π- = π π‘& +β2 ,π€& +
β2 π(
π_ = π(π‘& +β2,π€& +
β2π-)
π` = π(π‘& + β,π€& + β π_)
,
π€&'( = π€& +β6 [π( + 2π- + 2π_ + π`],
for each π = 0, 1, 2,β― ,π β 1.
Remark: RK4 hasfour stages,andisthe mostwidelyusedRKmethod.Its local truncation error is π β` . , π. π., fourth order accurate.
![Page 11: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/11.jpg)
Example 3. Use RK4 with π = 2 to solve the IVPπ¦Y = π¦ β π‘- + 1, 0 β€ π‘ β€ 2, π¦ 0 = 0.5.
(MATLAB) Implement the method using β = 0.2. Record the maximum error.
![Page 12: Section 5.4 Runge-Kutta Methods](https://reader033.vdocuments.us/reader033/viewer/2022060902/629901d2a27516359740a7a6/html5/thumbnails/12.jpg)