Ordinary Differential Equations II

Similar documents
Ordinary Differential Equations II

Ordinary Differential Equations I

Ordinary Differential Equations

Ordinary Differential Equations I

Ordinary Differential Equations I

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

Lecture IV: Time Discretization

Consistency and Convergence

Lecture V: The game-engine loop & Time Integration

Partial Differential Equations II

Ordinary Differential Equations

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Chap. 20: Initial-Value Problems

Ordinary Differential Equations (ODEs)

Ordinary differential equation II

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

You may not use your books, notes; calculators are highly recommended.

Euler s Method, cont d

Solving Ordinary Differential equations

Numerical Methods for the Solution of Differential Equations

Solution: (a) Before opening the parachute, the differential equation is given by: dv dt. = v. v(0) = 0

Numerical Methods - Initial Value Problems for ODEs

MTH 452/552 Homework 3

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Ordinary Differential Equations

TABLE OF CONTENTS INTRODUCTION, APPROXIMATION & ERRORS 1. Chapter Introduction to numerical methods 1 Multiple-choice test 7 Problem set 9

Lecture 4: Numerical solution of ordinary differential equations

NUMERICAL SOLUTION OF ODE IVPs. Overview

Scientific Computing: An Introductory Survey

CS205b/CME306. Lecture 4. x v. + t

Final Examination. CS 205A: Mathematical Methods for Robotics, Vision, and Graphics (Fall 2013), Stanford University

The family of Runge Kutta methods with two intermediate evaluations is defined by

Multistage Methods I: Runge-Kutta Methods

Solving scalar IVP s : Runge-Kutta Methods

CS 257: Numerical Methods

Differential Equations

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

Applied Math for Engineers

Differential Equations

AM205: Assignment 3 (due 5 PM, October 20)

Math Numerical Analysis Homework #4 Due End of term. y = 2y t 3y2 t 3, 1 t 2, y(1) = 1. n=(b-a)/h+1; % the number of steps we need to take

Chapter 6 - Ordinary Differential Equations

Scientific Computing II

Numerical Differential Equations: IVP

Numerical solution of ODEs

FDM for parabolic equations

Fourth Order RK-Method

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2.

DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science

Backward error analysis

Do not turn over until you are told to do so by the Invigilator.

2 Numerical Methods for Initial Value Problems

8.1 Introduction. Consider the initial value problem (IVP):

Numerical Methods for Initial Value Problems; Harmonic Oscillators

Initial value problems for ordinary differential equations

Numerical Methods for Initial Value Problems; Harmonic Oscillators

ODE Runge-Kutta methods

What we ll do: Lecture 21. Ordinary Differential Equations (ODEs) Differential Equations. Ordinary Differential Equations

Ph 22.1 Return of the ODEs: higher-order methods

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

Simple ODE Solvers - Derivation

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

Part IB Numerical Analysis

Cyber-Physical Systems Modeling and Simulation of Continuous Systems

Ordinary Differential Equations

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

Exam in TMA4215 December 7th 2012

Ordinary Differential Equations

CS520: numerical ODEs (Ch.2)

Numerical Methods for Differential Equations

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25.

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

Ordinary differential equations. Phys 420/580 Lecture 8

1 Error Analysis for Solving IVP

COSC 3361 Numerical Analysis I Ordinary Differential Equations (II) - Multistep methods

Fundamentals Physics

Object-oriented scientific computing

Course Information Course Overview Study Skills Background Material. Introduction. CS 205A: Mathematical Methods for Robotics, Vision, and Graphics

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods

Math 660 Lecture 4: FDM for evolutionary equations: ODE solvers

Numerical Solutions to Partial Differential Equations

Numerical Methods for Differential Equations

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

Lecture 17: Ordinary Differential Equation II. First Order (continued)

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1


Time scales. Notes. Mixed Implicit/Explicit. Newmark Methods [ ] [ ] "!t = O 1 %

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers

[ ] is a vector of size p.

1 Systems of First Order IVP

FIRST-ORDER ORDINARY DIFFERENTIAL EQUATIONS III: Numerical and More Analytic Methods David Levermore Department of Mathematics University of Maryland

Solving PDEs with PGI CUDA Fortran Part 4: Initial value problems for ordinary differential equations

Solution: (a) Before opening the parachute, the differential equation is given by: dv dt. = v. v(0) = 0

Evolution equations with spectral methods: the case of the wave equation

Introduction to the Numerical Solution of IVP for ODE

Mini project ODE, TANA22

Section 7.4 Runge-Kutta Methods

Transcription:

Ordinary Differential Equations II CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Ordinary Differential Equations II 1 / 29

Almost Done! No class next week! Homework 6: 11/18 (2 days late!) Homework 7: 12/2 Homework 8? (optional) Section: 11/22, 12/6 Final exam: 12/12, 12:15pm Go to office hours! CS 205A: Mathematical Methods Ordinary Differential Equations II 2 / 29

Initial Value Problems Find f(t) : R R n Satisfying F [t, f(t), f (t), f (t),..., f (k) (t)] = 0 Given f(0), f (0), f (0),..., f (k 1) (0) CS 205A: Mathematical Methods Ordinary Differential Equations II 3 / 29

Most Famous Example F = ma Newton s second law CS 205A: Mathematical Methods Ordinary Differential Equations II 4 / 29

Reasonable Assumption Explicit ODE An ODE is explicit if can be written in the form f (k) (t) = F [t, f(t), f (t), f (t),..., f (k 1) (t)]. CS 205A: Mathematical Methods Ordinary Differential Equations II 5 / 29

d y After Reduction dt = F [ y] CS 205A: Mathematical Methods Ordinary Differential Equations II 6 / 29

Forward Euler y k+1 = y k + hf [ y k ] Explicit method O(h 2 ) localized truncation error O(h) global truncation error; first order accurate CS 205A: Mathematical Methods Ordinary Differential Equations II 7 / 29

Backward Euler y k+1 = y k + hf [ y k+1 ] Implicit method O(h 2 ) localized truncation error O(h) global truncation error; first order accurate CS 205A: Mathematical Methods Ordinary Differential Equations II 8 / 29

Trapezoid Method y k+1 = y k + h F [ y k] + F [ y k+1 ] 2 Implicit method O(h 3 ) localized truncation error O(h 2 ) global truncation error; second order accurate CS 205A: Mathematical Methods Ordinary Differential Equations II 9 / 29

Model Equation y = ay, a < 0 y k+1 = 1 2 ha(y k+1 + y k ) CS 205A: Mathematical Methods Ordinary Differential Equations II 10 / 29

Model Equation y = ay, a < 0 y k+1 = 1 2 ha(y k+1 + y k ) Unconditionally stable! CS 205A: Mathematical Methods Ordinary Differential Equations II 10 / 29

Model Equation y = ay, a < 0 y k+1 = 1 2 ha(y k+1 + y k ) Unconditionally stable! But this has nothing to do with accuracy. CS 205A: Mathematical Methods Ordinary Differential Equations II 10 / 29

Is Stability Useful Here? R = y k+1 y k CS 205A: Mathematical Methods Ordinary Differential Equations II 11 / 29

Is Stability Useful Here? R = y k+1 y k Oscillatory behavior! CS 205A: Mathematical Methods Ordinary Differential Equations II 11 / 29

Pattern Convergence as h 0 is not the whole story nor is stability. Often should consider behavior for fixed h > 0. CS 205A: Mathematical Methods Ordinary Differential Equations II 12 / 29

Pattern Convergence as h 0 is not the whole story nor is stability. Often should consider behavior for fixed h > 0. Qualitative and quantitative analysis needed! CS 205A: Mathematical Methods Ordinary Differential Equations II 12 / 29

Observation y k+1 = y k + tk+1 t k F [ y(t)] dt CS 205A: Mathematical Methods Ordinary Differential Equations II 13 / 29

Alternative Derivation of Trapezoid Method y k+1 = y k + h 2 (F [ y k] + F [ y k+1 ]) + O(h 3 ) Implicit method CS 205A: Mathematical Methods Ordinary Differential Equations II 14 / 29

Heun s Method y k+1 = y k + h 2 (F [ y k] + F [ y k + hf [ y k ]]) + O(h 3 ) Replace implicit part with lower-order integrator! CS 205A: Mathematical Methods Ordinary Differential Equations II 15 / 29

Stability of Heun s Method y = ay, a < 0 ( y k+1 = 1 + ha + 1 ) 2 h2 a y k CS 205A: Mathematical Methods Ordinary Differential Equations II 16 / 29

Stability of Heun s Method y = ay, a < 0 ( y k+1 = 1 + ha + 1 ) 2 h2 a = h < 1 4 a 1 y k CS 205A: Mathematical Methods Ordinary Differential Equations II 16 / 29

Stability of Heun s Method y = ay, a < 0 ( y k+1 = 1 + ha + 1 ) 2 h2 a = h < 1 4 a 1 Forward Euler: h < 2 a y k CS 205A: Mathematical Methods Ordinary Differential Equations II 16 / 29

Runge-Kutta Methods Apply quadrature to: y k+1 = y k + tk+1 t k F [ y(t)] dt CS 205A: Mathematical Methods Ordinary Differential Equations II 17 / 29

Runge-Kutta Methods Apply quadrature to: y k+1 = y k + tk+1 t k Use low-order integrators F [ y(t)] dt CS 205A: Mathematical Methods Ordinary Differential Equations II 17 / 29

RK4: Simpson s Rule y k+1 = y k + h 6 ( k 1 + 2 k 2 + 2 k 3 + k 4 ) where k 1 = F [ y k ] k2 = F [ y k + 12 ] h k 1 k3 = F [ y k + 12 ] h k 2 k4 = F [ y k + h ] k 3 CS 205A: Mathematical Methods Ordinary Differential Equations II 18 / 29

Using the Model Equation y A y = y(t) e At y 0 CS 205A: Mathematical Methods Ordinary Differential Equations II 19 / 29

Exponential Integrators y = A y + G[ y] CS 205A: Mathematical Methods Ordinary Differential Equations II 20 / 29

Exponential Integrators y = A y + G[ y] First-order exponential integrator: y k+1 = e Ah y k A 1 (1 e Ah )G[ y k ] CS 205A: Mathematical Methods Ordinary Differential Equations II 20 / 29

Returning to Our Reduction y (t) = v(t) v (t) = a(t) a(t) = F [t, y(t), v(t)] CS 205A: Mathematical Methods Ordinary Differential Equations II 21 / 29

Returning to Our Reduction y (t) = v(t) v (t) = a(t) a(t) = F [t, y(t), v(t)] y(t k + h) = y(t k ) + h y (t k ) + h2 2 y (t k ) + O(h 3 ) Don t need high-order estimators for derivatives. CS 205A: Mathematical Methods Ordinary Differential Equations II 21 / 29

New Formulae v k+1 = v k + tk+1 t k a(t) dt CS 205A: Mathematical Methods Ordinary Differential Equations II 22 / 29

New Formulae v k+1 = v k + y k+1 = y k + h v k + tk+1 t k tk+1 t k a(t) dt (t k+1 t) a(t) dt CS 205A: Mathematical Methods Ordinary Differential Equations II 22 / 29

New Formulae v k+1 = v k + y k+1 = y k + h v k + tk+1 t k tk+1 t k a(t) dt (t k+1 t) a(t) dt a(τ) = (1 γ) a k + γ a k+1 + a (τ)(τ hγ t k ) + O(h 2 ) for τ [a, b] CS 205A: Mathematical Methods Ordinary Differential Equations II 22 / 29

Newmark Class y k+1 = y k + h v k + ( ) 1 2 β h 2 a k + βh 2 a k+1 v k+1 = v k + (1 γ)h a k + γh a k+1 a k = F [t k, y k, v k ] CS 205A: Mathematical Methods Ordinary Differential Equations II 23 / 29

Newmark Class y k+1 = y k + h v k + ( ) 1 2 β h 2 a k + βh 2 a k+1 v k+1 = v k + (1 γ)h a k + γh a k+1 a k = F [t k, y k, v k ] Parameters: β, γ (can be implicit or explicit!) CS 205A: Mathematical Methods Ordinary Differential Equations II 23 / 29

Constant Acceleration: β = γ = 0 y k+1 = y k + h v k + 1 2 h2 a k v k+1 = v k + h a k Explicit, exact for constant acceleration, linear accuracy CS 205A: Mathematical Methods Ordinary Differential Equations II 24 / 29

Constant Implicit Acceleration: β = 1 /2, γ = 1 y k+1 = y k + h v k + 1 2 h2 a k+1 v k+1 = v k + h a k+1 Backward Euler for velocity, midpoint for position; globally first-order accurate CS 205A: Mathematical Methods Ordinary Differential Equations II 25 / 29

Trapezoid: β = 1 /4, γ = 1 /2 x k+1 = x k + 1 2 h( v k + v k+1 ) v k+1 = v k + 1 2 h( a k + a k+1 ) Trapezoid for position and velocity; globally second-order accurate CS 205A: Mathematical Methods Ordinary Differential Equations II 26 / 29

Central Differencing: β = 0, γ = 1 /2 v k+1 = y k+2 y k 2h a k+1 = y k+1 2 y k+1 + y k h 2 Central difference for position and velocity; globally second-order accurate CS 205A: Mathematical Methods Ordinary Differential Equations II 27 / 29

Newmark Schemes Generalizes large class of integrators Second-order accuracy (exactly) when γ = 1 /2 Unconditional stability when 4β > 2γ > 1 (otherwise radius is function of β, γ) CS 205A: Mathematical Methods Ordinary Differential Equations II 28 / 29

Staggered Grid y k+1 = y k + h v k+ 1/2 v k+ 3/2 = v k+ 1/2 + h a k+1 [ a k+1 = F t k+1, x k+1, 1 ] 2 ( v k+1/2 + v k+ 3/2) CS 205A: Mathematical Methods Ordinary Differential Equations II 29 / 29

Staggered Grid y k+1 = y k + h v k+ 1/2 v k+ 3/2 = v k+ 1/2 + h a k+1 [ a k+1 = F t k+1, x k+1, 1 ] 2 ( v k+1/2 + v k+ 3/2) Leapfrog: a not a function of v; explicit CS 205A: Mathematical Methods Ordinary Differential Equations II 29 / 29

Staggered Grid y k+1 = y k + h v k+ 1/2 v k+ 3/2 = v k+ 1/2 + h a k+1 [ a k+1 = F t k+1, x k+1, 1 ] 2 ( v k+1/2 + v k+ 3/2) Leapfrog: a not a function of v; explicit Otherwise: Symmetry in v dependence Next CS 205A: Mathematical Methods Ordinary Differential Equations II 29 / 29