18
ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Initial Value Problems

10 initial value problems

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Initial Value Problems

Page 2: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Objectives

• Understand the applications of initial-value problems

• Be able to apply the Euler method for solving initial value problems

• Be able to apply the Runge-Kutta method for solving initial value problem

Page 3: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Example Problem

dt

dvmmaF

cvmgFFF UD

cvmgvmdt

dvm

m

cvmgv

mcte

c

mgtv /1

Page 4: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Exact Solution

Page 5: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Approximate Solution

12

12

tt

vv

t

v

dt

dv

m

cvmg

tt

vv

12

12

m

cvmg

tt

vv 1

12

12

Page 6: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Approximate Solution

m

cvmgttvv 11212

Page 7: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Euler Method

• Given the differential equation:

• We may write:

• Giving:

tyfdt

dy,

tyft

yy

t

y

dt

dy ttt ,

tytfyy ttt ,

Page 8: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Example

• Given the differential equation:

• The exact solution is:

• At t=0, y=2• Find y(4) using Euler

method with step t=1

yedt

dy t 5.04 8.0

tt eety 5.08.0 08.108.3

Page 9: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Solution

yedt

dy t 5.04 8.0 yetyy ttttt 5.04 8.0

5142

5.04 00

01

yeyy

4.115.245

5.048.0

18.0

12

e

yeyy

5.254.11*5.044.11

5.046.1

22*8.0

23

e

yeyy

8.565.25*5.045.25

5.044.2

33*8.0

34

e

yeyy

Page 10: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Convergence!

0

10

20

30

40

50

60

70

80

0 0.5 1 1.5 2 2.5 3 3.5 4

Time

y(t)

Exact

Dt=1.0

Dt=0.5

Dt=0.1

Page 11: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Runge-Kutta Methods

• The Runge-Kutta methods achieves the Taylor series accuracy

• Many forms of the method are available; we will use 2nd order and 3rd order methods only

Page 12: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

2nd Order Runge-Kutta method

• For the DE:

• The 2nd order R.K. solution is:

• Where:

• Note: in the textbook there are 3 different methods, we are using the first!

tyfdt

dy,

212kk

tyy ttt

tyfk t ,1

tttkyfk t ,12

Page 13: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Example

• Given the differential equation:

• The exact solution is:

• At t=0, y=2• Find y(4) using 2nd

order R.K. method with step t=1

yedt

dy t 5.04 8.0

tt eety 5.08.0 08.108.3

Page 14: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Solution

• At t=0

32*5.04 01 ek

4.61*325.04 108.02 ek

7.62 2101

kkt

yy

• Repeat for all t

Page 15: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Solution

tk1k2y

0  2

136.4021646.701082

25.55162313.6857816.31978

311.6522430.106737.19925

425.4930866.7839683.33777

tk1k2y

0  2

0.534.2172993.804325

14.0651365.9837176.316538

1.55.7438958.6862259.924068

28.31843412.7704915.1963

2.512.2139818.9045822.97594

318.0682628.0876734.51492

3.526.8352541.8123251.67681

439.9401862.3066777.23852

Page 16: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Convergence

0

10

20

30

40

50

60

70

80

90

0 0.5 1 1.5 2 2.5 3 3.5 4

Time

y(t)

Exact

Dt=1.0

Dt=0.5

Dt=0.1

Page 17: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

3rd Order Runge-Kutta method

• For the DE:

• The 3rd order R.K. solution is:

• Where:

tyfdt

dy,

321 46

kkkt

yy ttt

tyfk t ,1

2

,21

2

tt

tkyfk t

tttktkyfk t ,2 213

Page 18: 10 initial value problems

ENEM602 Spring 2007

Dr. Eng. Mohammad Tawfik

Homework #9

• Solve:• Given y(0)=1

1. Analytically2. Using Euler method until t=2, with t=0.53. Repeat part 2 using 2nd order RK method4. Repeat part 2 using 3rd order RK method5. Repeat parts 2 through 4 using t=0.256. Compare results of all parts above

• Due date: Week 12-17 November 2005

yytdt

dy2.12