E7_L28_ODE3_08_BW - 1 E7: INTRODUCTION TO COMPUTER E7:...

Info iconThis preview shows pages 1–4. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 E7: INTRODUCTION TO COMPUTER E7: INTRODUCTION TO COMPUTER ROGRAMMING FOR SCIENTISTS AND ROGRAMMING FOR SCIENTISTS AND PROGRAMMING FOR SCIENTISTS AND PROGRAMMING FOR SCIENTISTS AND ENGINEERS ENGINEERS Lecture Outline 1. Numerical integration of ODEs: Euler (review) Modified Euler Runge-Kutta (used in ode45) 2. More ODE examples verted pendulum E7 L28 Inverted pendulum 2 Review of Ordinary Differential Equations (ODEs) Review of Ordinary Differential Equations (ODEs) any problems in science and engineering lead to Many problems in science and engineering lead to Ordinary Differential Equations ( ODE s) of the form ( ) ( , ) dy t f t y dt where: t is the independent scalar variable (often time) y is the dependent variable, which can be a vector E7 L28 f(t,y) is a known function of its arguments 3 Solution of ODEs (Initial Value Problem) Solution of ODEs (Initial Value Problem) iven the ODE ) y t Given the ODE ( ) ( , ) dy t f t y dt and an initial condition ( ) y t y find the function ( ) y t (slight abuse of notation) ( ) y t y which atisfies: ) y t E7 L28 satisfies: ( ) ( , ( )) dy t f t y t dt t t ! for 4 onsider the ODE Numerical integration of ODEs Numerical integration of ODEs ) ( ) t f t Consider the ODE ( ) ( , ) y t f t y and the initial condition ( ) y t y e want to obtain the estimates where ) E t We want to obtain the estimates where ( ) k y t 1 2 k t t k h " # 0,1,2,.... k E7 L28 and is the integration step size integration step size . h 5 Numerical integration of ODEs Numerical integration of ODEs oday we will review Today we will review Eulers method Approximates a Taylor expansion up to its first order nd describe: and describe: Modified Eulers method (predictor-corrector) (p ) Approximates a Taylor expansion up to its second order Rungue-Kutta method (used in ode45, ode23) E7 L28 Approximates a Taylor expansion up to its fourth order 6 Approximating Approximating y(to+h)- Taylors series expansion Taylors series expansion ( ) ( ) y t y t h " # 2 1 ( ) 2 y t h " # ( ) y t h " $ Euler (n=1) modified Euler (n=2) E7 L25 h h 7 4 th th order Taylors series expansion order Taylors series expansion 1 2 1 ( ) ( ) ( ) ( ) 2 y t h y t y t h y t h " $ " # " # [3] 3 [4] 4 1 1 ( ) ( ) 3! 4! y t h y t h " # " # Runge-Kutta(n=4) E7 L25 h h h 8 Eulers method Eulers method Given : Initial condition: ) ( ) E t y t tegration step size t a co d t o ( ) ( ) y t y t Integration step size h 1 k k t t h " " 1 ( ) ( ) ( , ( ) ) E E E k k k k y t y t f t y t h " " # E7 L27 Graphical explanation of Eulers method Graphical explanation of Eulers method 9 ) ( ) t f t ) t ( ) y t ( ) ( , )...
View Full Document

This note was uploaded on 11/01/2009 for the course ENGLISH 7 taught by Professor Sengupta during the Spring '09 term at University of California, Berkeley.

Page1 / 9

E7_L28_ODE3_08_BW - 1 E7: INTRODUCTION TO COMPUTER E7:...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online