{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture38-39

# Lecture38-39 - Chapter 20 ODEs Initial-Value Problems...

This preview shows pages 1–16. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 20 ODEs: Initial-Value Problems Initial-Value & Boundary-Value Conditions F o r e x a m p le a t 0 , 0 & 0 . T h e tw o c o n d itio n s a re a ll g iv e n a t 0 . d x t x d t t = = = = The I-V Conditions All conditions are given at the same value of the independent variable. The numerical schemes for solving Initial-value and boundary-value are different . The B-V Conditions C onditions are given at the different values of the independent variable . . 5 . , 1 at & 1 , at example For = = = = x t x t Euler’s and Heun's methods Runge-Kutta methods Adaptive Runge-Kutta Multistep methods* Adams-Bashforth-Moulton methods* Ordinary Differential Equations I-V Problems Ordinary Differential Equations ❚ 1 st order Ordinary differential equations (ODEs) ❚ Initial value problems ❚ Numerical approximations ❚ New value = old value + slope × step size y t y ; y t f dt dy = = ) ( ) , ( h y y i 1 i φ + = + Runge Kutta methods (One Step Methods) Idea is that New value = old value + slope*step size Slope is generally a function of t , hence y ( t ) Different methods differ in how to estimate φ h y y i 1 i φ + = + Runge-Kutta Methods One-Step Method h y y i 1 i φ + = + All one-step methods can be expressed in this general form, the only difference being the manner in which the slope is estimated Initial Conditions Same ODE, but with different initial conditions The solution of ODE depends on the initial condition t Euler’s method ( First-order Taylor Series Method ) ) ❚ Approximate the derivative by finite difference ❚ Local truncation error ❚ or 1 1 1 ( , ) ( , ) i i i i i i i i i i y y dy f t y y hf t y t y d t t + + +- ≈ = ⇒ = +- 1 n 1 n n n n n i 2 i i i 1 i h 1 n y R R h n y h 2 y h y y y + + + + = + + ′ ′ + ′ + = )! ( ) ( ; ! ) ( ) ( ξ ) ( ! ) , ( ) , ( ) , ( ) ( 1 n n i i 1 n 2 i i i i i i 1 i h O h n y t f h 2 y t f h y t f y y +- + + + ′ + + = Euler’s Method Use the slope at t i to predict y i+1 x y(x) x n x n+1 h y y(x n+1 ) y n+1 hy n ′ { error Run: h Rise: hy n ′ Error: y n "h 2 /2 x y(x) x n x n+1 h y y(x n+1 ) y n+1 hy n ′ { error Run: h Rise: hy n ′ Error: y n "h 2 /2 Euler’s method y y(t y t f y dt dy = = ′ = ) ); , ( t t 1 t 2 t 3 y y h h h h h h Straight line approximation Example: Euler’s Method ❚ Analytic solution ❚ Euler method ❚ h = 0.50 1 t 1, y y t dt dy ≤ ≤ = = ) ( , 2 2 4 / t 1 y ) ( + = y t f hf y y i i 1 i = + = + , = + = + = = + = + = 25 1 1 5 5 1 1 5 hf 5 y 1 y 1 1 0.5) 1 0,1.0 hf y 0.5 y . ) . . )( . ( . ) . , . ( ) . ( ) . ( . ) ( ( ) ( ) ( ) ( Example: Euler’s Method ❚ h = 0.25 y t f hf y y i i 1 i = + = + , y(0.25) y(0) hf(0, 1.0) 1 ( )(0 1) 1.0 (0.5) (0.25) (0.25, 1.0) 1.0 ( )(0.25 1.0) 1.0625 (0.75) (0.5) (0.5, 1.0625) 1.062 0.25 0.25 0.25 5 ( )(0.5 1.0625) 1.191347 (1.0) (0.75) y y hf y y hf y y hf = + = + = = + = + = = + = + = = + (0.75, 1.191347) 1.191347 ( )(0.75 1.191347) 1.39600 0.25 = + = Euler’s method: 1 y y t y dt dy = = ′ = ) ( ; 0.5 0.75 1.0 1 0.25 h = 0.5 h = 0.25 t y Euler’s Method (modified M-file) Euler’s Method (modified M-file) >> tt=0:0.01*pi:pi;>> tt=0:0....
View Full Document

{[ snackBarMessage ]}

### Page1 / 47

Lecture38-39 - Chapter 20 ODEs Initial-Value Problems...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online