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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
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 Eulers 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 Eulers 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 +- + + + + + = Eulers 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 Eulers 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: Eulers 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: Eulers 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 = + = Eulers 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 Eulers Method (modified M-file) Eulers Method (modified M-file) >> tt=0:0.01*pi:pi;>> tt=0:0....
View Full Document

This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

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 Right Arrow Icon
Ask a homework question - tutors are online