Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

Similar documents
Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

Initial value problems for ordinary differential equations

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

Initial Value Problems for. Ordinary Differential Equations

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

Fourth Order RK-Method

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

MA2264 -NUMERICAL METHODS UNIT V : INITIAL VALUE PROBLEMS FOR ORDINARY DIFFERENTIAL. By Dr.T.Kulandaivel Department of Applied Mathematics SVCE

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

Ordinary Differential Equations

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

Numerical Methods - Initial Value Problems for ODEs

Initial-Value Problems for ODEs. Introduction to Linear Multistep Methods

9.6 Predictor-Corrector Methods

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

multistep methods Last modified: November 28, 2017 Recall that we are interested in the numerical solution of the initial value problem (IVP):

Solving Ordinary Differential equations

Applied Math for Engineers

MTH 452/552 Homework 3

Numerical Methods for the Solution of Differential Equations

Solving Ordinary Differential Equations

Name of the Student: Unit I (Solution of Equations and Eigenvalue Problems)

Integration of Ordinary Differential Equations

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

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

5.6 Multistep Methods

Exact and Approximate Numbers:

HIGHER ORDER METHODS. There are two principal means to derive higher order methods. b j f(x n j,y n j )

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

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.

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

5.6. Differential equations

Multistep Methods for IVPs. t 0 < t < T

369 Nigerian Research Journal of Engineering and Environmental Sciences 2(2) 2017 pp

Ordinary differential equations - Initial value problems

Introduction to Differential Equations

Numerical Differential Equations: IVP

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

Math 128A Spring 2003 Week 11 Solutions Burden & Faires 5.6: 1b, 3b, 7, 9, 12 Burden & Faires 5.7: 1b, 3b, 5 Burden & Faires 5.

1 Error Analysis for Solving IVP

ODE Runge-Kutta methods

Module 4: Numerical Methods for ODE. Michael Bader. Winter 2007/2008

Initial value problems for ordinary differential equations

Ordinary Differential Equations n

Lecture IV: Time Discretization

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

ORDINARY DIFFERENTIAL EQUATIONS EULER S 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.

Applied Numerical Analysis

Math 128A Spring 2003 Week 12 Solutions

CS520: numerical ODEs (Ch.2)

Modeling & Simulation 2018 Lecture 12. Simulations

AN OVERVIEW. Numerical Methods for ODE Initial Value Problems. 1. One-step methods (Taylor series, Runge-Kutta)

Research Article Diagonally Implicit Block Backward Differentiation Formulas for Solving Ordinary Differential Equations

NUMERICAL SOLUTION OF ODE IVPs. Overview

Exact Differential Equations. The general solution of the equation is f x, y C. If f has continuous second partials, then M y 2 f

Lecture V: The game-engine loop & Time Integration

Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras

Engineering Mathematics I

Part IB Numerical Analysis

Unit I (Testing of Hypothesis)

Astrodynamics (AERO0024)

Chapter 2: Numerical Methods

Time-Frequency Analysis: Fourier Transforms and Wavelets


Lecture 10: Linear Multistep Methods (LMMs)

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations

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

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 2. Predictor-Corrector Methods

Scientific Computing: An Introductory Survey

Ordinary Differential Equations of First Order

Introduction to Differential Equations. National Chiao Tung University Chun-Jen Tsai 9/14/2011

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

Ordinary Differential Equations II

MATHEMATICAL METHODS INTERPOLATION

Ordinary Differential Equations II

Southern Methodist University.

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

Implicit Second Derivative Hybrid Linear Multistep Method with Nested Predictors for Ordinary Differential Equations

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

4.4 Computing π, ln 2 and e

Section 7.4 Runge-Kutta Methods

A New Block Method and Their Application to Numerical Solution of Ordinary Differential Equations

Numerical Methods for Differential Equations

Chap. 20: Initial-Value Problems

Math 411 Preliminaries

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

2 Numerical Methods for Initial Value Problems

Time-Frequency Analysis: Fourier Transforms and Wavelets

An Implicit Method for Numerical Solution of Second Order Singular Initial Value Problems

In particular, if the initial condition is positive, then the entropy solution should satisfy the following positivity-preserving property

SOLVING EQUATIONS OF ONE VARIABLE

Contents: V.1 Ordinary Differential Equations - Basics

Backward error analysis

Differential Equations

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

Transcription:

Computational Methods CMSC/AMSC/MAPL 460 Ordinar differential equations Ramani Duraiswami, Dept. of Computer Science Several slides adapted from Prof. ERIC SANDT, TAMU

ODE: Previous class Standard form Eamples of converting equations to standard form Volterra equation Euler Method (an eplicit method) Backward Euler Method (an implicit/nonlinear method) A predictor corrector method

Toda Eplicit and Implicit methods Runge Kutta methods Matlab function RK45 Solve volterra equation Multistep methods: Adams Bashforth Implicit methods: Adams Moulton

Runge-Kutta Methods Eplicit methods: Use known values Derivation of the nd order RK method Look for a formula of the tpe ak bk + + + n n (, ) k hf n n (, ) k hf α h βk + + n n

Runge-Kutta Methods The initial conditions are: d d 0 f (, ) ( ) 0 The Talor series epansion including nd order terms is d, d, ( ) ( ) + + h + d! d ( ) h ( ) n n n n n n

Runge-Kutta Methods Epand the derivatives: d d d d d d [ f (, ) ] f + f f + f f The Talor series epansion becomes n+ n+ hf + h f+ ff ( ) Have epressed second derivative in terms of st derivatives of f

Runge-Kutta Methods From the Runge-Kutta n + n ahf + bhf + α n h, + β + n hf The definition of the function ( ) Epand the net step ( ) f + αh, + βhf f + αhf + βhf f n n [ ] ( α β ) + + ahf + bh f + hf + hf f n n + + + + n a b hf bαh f bβh f f

Runge-Kutta Methods From the Runge-Kutta [ ] + a + b hf + bαh f + bβ + h f f n n Compare with the Talor series [ a + b] αb βb 4 Unknowns

Runge-Kutta Methods The Talor series coefficients (3 equations/4 unknowns) [ a + b], αb, βb If ou select a as 3 3 a, b, α, β 3 3 If ou select a as a b, α β Note: These coefficient would result in a modified Euler or Midpoint Method

Runge-Kutta Method ( nd Order) Eample Consider Eact Solution d d The initial condition is: The step size is: h 0. ( 0 ) + Use the coefficients a b, α β

Runge-Kutta Method ( nd Order) Eample The values are (, ) k hf i i (, ) k hf + h + k i i + k + k [ ] i+ i

Runge-Kutta Method ( nd Order) Eample The values are similar to that of the Modified Euler also a second order method k Estimate Solution k Eact Error n n 'n h'n *n+ *' n+ h(*'n+ ) 0.00000 -.00000-0.0000 0.90000-0.8000-0.0800.000000 0.000000 0. 0.90950-0.879-0.087 0.8678-0.68357-0.06836 0.90909-0.000409 0. 0.83396-0.69549-0.06955 0.7644-0.58433-0.05843 0.833333-0.00069 0.3 0.76997-0.5986-0.0599 0.7069-0.50507-0.0505 0.7693-0.000740 0.4 0.7507-0.533-0.053 0.66394-0.4408-0.04408 0.7486-0.000789 0.5 0.66747-0.4455-0.04455 0.69-0.3880-0.03880 0.666667-0.00080 0.6 0.6579-0.396-0.0396 0.58663-0.3443-0.0344 0.65000-0.000790 0.7 0.58900-0.3469-0.03469 0.5543-0.3076-0.03073 0.58835-0.000768 0.8 0.5569-0.30946-0.03095 0.5535-0.7599-0.0760 0.555556-0.000738 0.9 0.570-0.7775-0.0778 0.4995-0.495-0.049 0.5636-0.000705 0.50067-0.5067-0.0507 0.47560-0.60-0.06 0.500000-0.00067

Runge-Kutta Method ( nd Order) Eample [b] The values are a 3, b, α, β 3 3 3 (, ) k hf i i ( α, β ) k hf + h + k i i + ak + bk i+ i

Runge-Kutta Method ( nd Order) Eample [b] The values are k Estimate Solution k Eact Error n n 'n h'n *n+ *' n+ h(*'n+ ) Eact 0.00000 -.00000-0.0000 0.85000-0.750-0.075.000000 0.000000 0. 0.9095-0.8674-0.0867 0.7854-0.6660-0.0666 0.90909-0.00059 0. 0.83358-0.69486-0.06949 0.7935-0.5395-0.0530 0.833333-0.00048 0.3 0.76953-0.597-0.059 0.68070-0.46335-0.04634 0.7693-0.00095 0.4 0.7460-0.5066-0.0507 0.63800-0.40705-0.04070 0.7486-0.00037 0.5 0.66699-0.44488-0.04449 0.6006-0.3603-0.03603 0.666667-0.00034 0.6 0.653-0.3903-0.0390 0.56667-0.3-0.03 0.65000-0.0003 0.7 0.58855-0.34639-0.03464 0.53659-0.8793-0.0879 0.58835-0.00034 0.8 0.55586-0.30898-0.03090 0.5095-0.5960-0.0596 0.555556-0.000303 0.9 0.566-0.773-0.0773 0.4850-0.353-0.035 0.5636-0.0009 0.5008-0.508-0.0503 0.4674-0.4-0.04 0.500000-0.00078

Runge-Kutta Methods Fourth order Runge-Kutta method n+ +/6(k n +k +k 3 +k 4 ) k hf(,) k h(f(+h/, +/ k ) k 3 h(f(+h/, +/ k ) k 4 h(f(+h,+k 3 ))

4th -order Runge-Kutta Method f f 4 f 3 f f f 3 + 6 ( f + f + f f ) 4 i i + h/ i + h

Volterra eample Write a function in standard form function f rabfo(t,) % Computes for the Volterra model. % () is the number of rabbits at time t. % () is the number of foes at time t. global alpha % interaction constant t % a print statement, just so we can see how fast % the progress is, and what stepsize is being used f(,) *() - alpha*()*(); f(,) -() + alpha*()*();

Stud its solution for various values of encounter % Run the rabbit-fo model for various values of % the encounter parameter alpha, plotting each % solution. global alpha for i:-:0, alpha 0^(-i) [t,] ode45('rabfo',[0:.:], [0,0]); plot(t,(:,),'r',t,(:,),'b'); legend('rabbits','foes') title(sprintf('alpha %f',alpha)); pause end

Runge-Kutta Method (4 th Order) Eample Consider Eact Solution d d The initial condition is: The step size is: h 0. + + e ( 0 )

The 4 th Order Runge-Kutta The eample of a single step: k k k k 3 4 h h f h f h (, ) [ ] ( ) ( f 0.f 0, 0. 0 ) ( 0.05,.05) ( 0.05,. + k / ) [ f ( + h, + k )] 0.f ( 0.,.04988) 6 + + h, h, 0. [ k + k + k + ]. 0489 n+ n + 3 k4 + + 3 k k 0.f 0. f 0.0475 0.09499 0.04988

Runge-Kutta Method (4 th Order) Eample The values for the 4 th order Runge-Kutta method f(,) k f k f 3 k 3 f 4 k 4 Change Eact 0 0..0475 0.0475.049875 0.04988.094988 0.09499 0.68974 0..0489.09489 0.09483.3707 0.3707.398 0.398.78747 0.7875 0.68608.0489 0..8597.78597 0.786.507 0.503.6848 0.685.508 0.508 0.7963.8597 0.3.3404.504 0.504.8048 0.805.8648 0.865.308306 0.3083 0.76804.3404 0.4.46875.30875 0.3087.33084 0.3308.339 0.333.35398 0.354 0.7986.46875 0.5.6078.3578 0.358.36634 0.36634.367095 0.367.377988 0.37799 0.8964.6079 0.6.73788.37788 0.37788.38474 0.3847.384594 0.38459.38634 0.38634 0.83096.73788 0.7.87646.38646 0.3865.383059 0.38306.38899 0.389.374536 0.37454 0.897.87647 0.8.04458.374458 0.37446.36068 0.36068.35999 0.35999.340457 0.34046 0.8566.04459 0.9.50396.340396 0.3404.3495 0.349.3364 0.3364.876 0.876 0.78797.50397.877.877 0.87.43303 0.433.438 0.438.95855 0.9586 0.744694.878

The 4 th Order Runge-Kutta The step sizes are: [ ] [ ] 4 3 3 3 3 k k k k h k k k + + + + + ( ) ( ) ( ) ( ) ( ) h h h + + + + + The net step would be:

Eplicit Methods Up until this point we have dealt with: Euler Method Modified Euler/Midpoint Runge-Kutta Methods These methods are called eplicit methods, because the use onl the information from previous steps. Moreover these are one-step methods

One Step Method The techniques are defined as: These methods allow us to var the step size. Use onl one initial value. After each step is completed the past step is forgotten: We do not use this information.

Multi-Step Methods The principle behind a multi-step method is to use past values, and/or d/d to construct a polnomial that approimate the derivative function.

Multi-Step Methods Similar to quadrature d d d f f ( ) ( ) d i + + + i i i f ( ) d d i+ i i+ i f ( ) d

Multi-Step Methods The integral can be represented. i + i h f Two Point i i f ( ) d [ 3 f ] Three Point Adam Bashforth h + [ 3 f 6 f 5 f ] i i i

Multi-Step Methods The integral can be represented. i + i f ( ) d Four Point Adam Bashforth h + 4 [ 55 f 59 f 37 f 9 f ] i i i i 3

Multi-Step Methods These methods are known as eplicit schemes because the use of current and past values are used to obtain the future step. The method is initiated b using either a set of known results or from the results of a Runge-Kutta to start the initial value problem.

Adam Bashforth Method (4 Point) Eample Consider Eact Solution d d The initial condition is: The step size is: h 0. + + e ( 0 )

4 Point Adam Bashforth From the 4th order Runge Kutta f 0,.0000 ( ) ( 0.,.0489) ( 0.,.8597) ( 0.3,.3404). 504 The 4 Point Adam Bashforth is: f f f.09489.78597 0. 4 [ 55 f 59 f + 37 f f ] 9 0.3 0. 0. 0

4 Point Adam Bashforth The results are: Upgrade the values f ( 0.4).3404+ ( 0.4,.46879). 30879 ( ) 59(.78597) 0. 55.504 4 + 37.09489 0.8038 ( ) 9( ) 0.8038.46879

4 Point Adam Bashforth Method - Eample The values for the Adam Bashforth Adam Bashforth f(,) sum 4th order Runge-Kutta Eact 0 0..0488958.09489.0488958.0489 0..859699.78597.859699.8597 0.3.340408.504 30.799.340408.3404 0.4.468796.30879 3.9467.46874786.46875 0.5.608865.3588 3.786.6078076.6079 0.6.73789699.377897 33.0969.737880409.73788 0.7.876707.3867 33.730.87646365.87647 0.8.044964.37449 3.6766.04458009.04459 0.9.5044005.34044 3.505.50395695.50397.87746.8774 9.7936.87685.878

4 Point Adam Bashforth Method - Eample The eplicit Adam Bashforth method gave solution gives good results without having to go through large number of calculations. Y Value 4 0 - -4-6 -8 4 Point Adam Bashforth Eample 0 3 4 Adam Bashforth 4th order Runge-Kutta Eact -0 X Value

Implicit Methods There are second set of multi-step methods, which are known as implicit methods. The implicit methods use the future steps to modif the future steps. Since future data is used an iterative method must be used iterate an initial guess until convergence Could use Runge-Kutta or Adams Bashforth to start the initial value problem.

Implicit Multi-Step Methods The main method is Adams Moulton Method Three Point Adams-Moulton Method h 5 + 8 [ f f f ] i+ i i Four Point Adams-Moulton Method h 9 + 9 5 + 4 [ f f f f ] i+ i i i

Implicit Multi-Step Methods The method uses what is known as a Predictor-Corrector technique. eplicit scheme to estimate the initial guess uses the value to guess the future * and d/d f*(,*) Using these results, appl Adam Moulton method

Implicit Multi-Step Methods Adams third order Predictor-Corrector scheme. Use the Adam Bashforth three point eplicit scheme for the initial guess. h * [ ] i+ i + 3 fi 6 fi + 5 fi Use the Adam Moulton three point implicit scheme to take a second step. h [ ] * i+ i + 5 fi+ + 8 fi fi

Adam Moulton Method (3 point) Eample Consider Eact Solution d d The initial condition is: The step size is: h 0. + + e ( 0 )

4 Point Adam Bashforth From the 4th order Runge Kutta f f f ( 0,).0000 ( 0.,.0489).09489 ( 0.,.8597). 78597 The 3 Point Adam Bashforth is: 0. + [ 3 f 6 f f ] 5 0. 0. 0.0

3 Point Adam Moulton Predictor-Corrector Method The results of eplicit scheme is: 0. 3.78597 0.587 The functional values are: f * * ( 0.3) ( 0.3,.34084). 5084 [ ( ) 6(.09489) + 5( ) ].8597 + 0.587.34084

3 Point Adam Moulton Predictor-Corrector Method The results of implicit scheme is: 0. 5.5084 0.54 The functional values are: f ( 0.3) ( 0.3,.34084). 5038 [ ( ) + 8(.78597).09489 ( )].8597 + 0.54.34038

3 Point Adam Moulton Predictor-Corrector Method The values for the Adam Moulton Adam Moulton Three Point Predictor-Corrector Scheme f sum * f* sum 0 0..0489.09489 0..8597.78597 0.587.34084.5084 0.54 0.3.34038.5038 0.808.4689.3089 0.803 0.4.46868.30868 0.3355.6033.3533 0.33098 0.5.6066.3566 0.36659.73795.37795 0.36597 0.6.737863.377863 0.3849.8769.3869 0.38359 0.7.876.386 0.388.0450.37450 0.3804 0.8.0445.37445 0.3603.50438.340438 0.3598 0.9.50353.340353 0.3404.8757.8757 0.33.8663.8663 0.406.405869.95869 0.40

3 Point Adam Moulton Predictor-Corrector Method The implicit Adam Moulton method gave solution gives good results without using more than a three points. Y Value 4 0 - -4-6 Adam Moulton 3 Point Implicit Scheme 0 3 4 4th order Runge-Kutta Eact Adam Moulton -8 Adam Bashforth -0 X Value