Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I)...

9
Dr. Jie Zou PHY 3320 1 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied Numerical Methods with MATLAB for Engineers and Scientists”, Steven Chapra, 2nd ed., Ch. 20 , McGraw Hill, 2008.

Transcript of Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I)...

Page 1: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 1

Chapter 9

Ordinary Differential Equations: Initial-Value

ProblemsLecture (I)11 Besides the main textbook, also see Ref.: “Applied Numerical

Methods with MATLAB for Engineers and Scientists”, Steven Chapra, 2nd ed., Ch. 20, McGraw Hill, 2008.

Page 2: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 2

Outline

Introduction: Some definitions Engineering and Scientific

Applications One-step Runge-Kutta (RK) Methods

(1) Euler’s Method The method (algorithm) Error analysis (next lecture) Stability (next lecture)

Page 3: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 3

Introduction: Some definitions

Differential equation: An equation involving the derivatives or differentials of the dependent variable.

Ordinary differential equation: A differential equation involving only one independent variable.

Example: For the bungee jumper,

Partial differential equation: A differential equation involving two or more independent variables (with partial derivatives).

Order of a differential equation: The order of the highest derivative in the equation.

Example: For an unforced mass-spring system with damping-a second-order equation:

2vcmgdt

dvm d

02

2

kxdt

dxc

dt

xdm

Page 4: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 4

Introduction: Some definitions (cont.)

For an nth-order differential equation, n conditions are required to obtain a unique solution.

Initial-value problem: All conditions are specified at the same value of the independent variable (e.g., at x or t = 0).

Example: For the bungee jumper,

Boundary-value problem: Conditions are specified at different values of the independent variable.

Example: Particle in an infinite square well

00 ,2 vvcmgdt

dvm d

Initial ConditionFig. PT6.3 (Ref. by

Chapra): Solutions for dy/dx = -2x3 + 12x2 – 20x + 8.5 with different constants of integration, C.

0 ,00 ,2

22

2

LψψmE

dx

d

Boundary Conditions

Page 5: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 5

Engineering and scientific applications

Fig. PT6.1 (Ref. by Chapra): The sequence of events in the development and solution of ODEs for engineering and science.

Page 6: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 6

Euler’s method Let’s look at the Bungee-Jumper’s

example: Solve an ODE-initial-value problem (1)

Step 1: Finite-difference approximation for dv/dt (2)

Step 2: Substitute Eq. (2) in Eq. (1) (3) Step 3: Notice that dv/dt at ti = g-

cdv(ti)2/m, (3) becomes

00 ,2 vvcmgdt

dvm d

ii

ii

tt

tvtv

dt

dv

1

1

iiid

ii tttvm

cgtvtv

1

21

tdt

dvvv

itii 1

Euler’s method (a one-step method)

Fig. 1.4 (Ref. by Chapra): Numerical solution by Euler’s method.

Page 7: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 7

Another look at Euler’s method

Solving ODE: dy/dt = f(t,y) All one-step methods (Runge-Kutta

methods) have the general form:

: an increment function for extrapolating from an old value yi to a new value yi+1.

One-step methods: use information from one pervious point i to extrapolate to a new value.

h: Step size = ti+1 – ti. Euler’s method:

= f(ti,yi), the 1st derivate of y at ti

yi+1 = yi + f(ti,yi)h

yi1 yi h

Fig. 20.1 (Ref. by Chapra): Euler’s method

Page 8: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 8

Example: Euler’s method

Example 20.1 (Ref.): Use Euler’s method to integrate y’ = 4e0.8t – 0.5y from t = 0 to t = 4 with a step size of 1. The initial condition at t = 0 is y = 2. Note that the exact solution can be determined analytically as y = (4/1.3)(e0.8t – e-

0.5t) + 2e-0.5t

Page 9: Dr. Jie Zou PHY 33201 Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.

Dr. Jie Zou PHY 3320 9

Resultst ytrue yEuler |t| (%)

0 2.00000 2.00000 ----

1 6.19463 5.00000 19.28

2 14.84392 11.40216 23.19

3 33.67717 25.51321 24.24

4 75.33896 56.84931 24.54

Fig. 20.2 (Ref. by Chapra)

Table 20.1 (Ref. by Chapra)