Lecture_25_E7_L25_ODE2

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

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

View Full Document Right Arrow Icon
E7 L25 1 E7: INTRODUCTION TO COMPUTER E7: INTRODUCTION TO COMPUTER PROGRAMMING FOR SCIENTISTS AND PROGRAMMING FOR SCIENTISTS AND ENGINEERS ENGINEERS Lecture Outline 1. Review of ordinary differential equations 2. Numerical integration algorithms: Euler Modified Euler (predictor-corrector) 3. Examples Copyright 2007, Horowitz, Packard. This work is licensed under the Creative Commons Attribution-Share Alike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Background image of page 1

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

View Full DocumentRight Arrow Icon
E7 L25 2 Review of Ordinary Differential Equations (ODEs) Review of Ordinary Differential Equations (ODEs) 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 f(t,y)  is a known function of its arguments
Background image of page 2
E7 L25 3 Solution of ODEs (Initial Value Problem) Solution of ODEs (Initial Value Problem) Given the ODE ( ) ( , ) dy t f t y dt = and an initial condition 0 0 ( ) y t y = find the function ( ) y t which satisfies: 0 0 ( ) y t y = ( ) ( , ( )) dy t f t y t dt = (slight abuse of notation) 0 t t for
Background image of page 3

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

View Full DocumentRight Arrow Icon
E7 L25 4 What is the difference between ode45 and quad? What is the difference between ode45 and quad? Quad is used to solve integrals. For example: ( ) ( ) dy t f t dt = Only a function of time t This can be solved by quadratures: ( ) ( ) ( ) o t o t y t f d y t τ = +
Background image of page 4
E7 L25 5 What is the difference between ode45 and quad? What is the difference between ode45 and quad? Quad is used to obtain definite integrals numerically (e.g. quadratures): ( ) b a q f t dt = Quad syntax: q = quad(@ f ,a,b) where f is only a function of time.
Background image of page 5

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

View Full DocumentRight Arrow Icon
E7 L25 6 What is the difference between ode45 and quad? What is the difference between ode45 and quad? ode45 is used to solve ODEs: ( ) ( , ) dy t f t y dt = a function of time AND  y This cannot cannot solved by quad , unless we can use separation of variables, e.g. ( ) ( ) ( ) f t g t h y =
Background image of page 6
E7 L24 7 ODE integration VS integration by quadratures ODE integration VS integration by quadratures Most ODEs cannot be integrated by quadratures dependent variable appears on the RHS unless we can use separation of variables: numerical integration, e.g. quad ( ) ( , ) dy t f t y dt = ( , ) ( ) ( ) f t y g t h y = ( ) ( ) dy g t dt h y = 1 1 0 0 ( ) ( ) y t y t dy g d h y τ = 0 0 ( ) y y t = 1 1 ( ) y y t =
Background image of page 7

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

View Full DocumentRight Arrow Icon
E7 L24 8 Higher order ODEs Higher order ODEs Remember the basic ODE: and can be vectors! where: t is the independent scalar variable (often time) y is the dependent variable f(t,y)  is a known function of its arguments then will also be a vector ( , ) y f t y = & y & y
Background image of page 8
E7 L24 9 Higher order ODEs Higher order ODEs System of n first-order coupled ODEs : ( , ) y f t y = & 1 n × 1 n × 1 n ×
Background image of page 9

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

View Full DocumentRight Arrow Icon
E7 L24 10 Higher order ODEs Higher order ODEs System of n first-order coupled ODEs : ( , ) y f t y = & ( 29 ( 29 ( 29 1 1 1 2 2 2 1 2 1 2 , , ,..., , , , , n n n n n y f t y y y y f t y y y y f t y y y = = = & & M &
Background image of page 10
E7 L24 11 Higher order ODEs Higher order ODEs System of n first-order coupled ODEs : ( , ) y f t y = & ( 29 ( 29 ( 29 1 1 1 2 2 2 1 2 1 2 , , ,..., , , , , n n n n n y f t y y y y f t y y y y f t y y y = = = & & M &
Background image of page 11

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

View Full DocumentRight Arrow Icon
Euler’s disk (ME170) – courtesy Prof. O’Reilly
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/17/2011 for the course ENGINEERIN 7 taught by Professor Patzek during the Spring '08 term at Berkeley.

Page1 / 75

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

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

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