Upload
mohammad-tawfik
View
2.044
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
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
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Example Problem
dt
dvmmaF
cvmgFFF UD
cvmgvmdt
dvm
m
cvmgv
mcte
c
mgtv /1
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Exact Solution
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
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Approximate Solution
m
cvmgttvv 11212
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 ,
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
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
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
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
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
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
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
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
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
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
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