Upload
armand
View
30
Download
0
Embed Size (px)
DESCRIPTION
P lasma A pplication M odeling, POSTECH. Solve ODEs by the Euler method using Frotran (9-3). J.H. Kang and J.K. Lee. 2005. 10. 04. Solve the following set of first-order ODEs by the forward Euler method with and :. P lasma A pplication - PowerPoint PPT Presentation
Citation preview
Solve ODEs by the Euler methodusing Frotran (9-3)
J.H. Kang and J.K. Lee
2005. 10. 04
Plasma Application Modeling, POSTECH
Plasma Application Modeling, POSTECH
9-39-3
Solve the following set of first-order ODEs by the forward Euler method with and :005.0h 0005.0h
,'
,'
yz
zy
0)0(
1)0(
z
y
Plasma Application Modeling, POSTECH
Exact SolutionExact Solution
,'
,'
yz
zy
0)0(
1)0(
z
y
)sin(
)cos(
tz
ty
Exact solution
)( 0 2 4 6 8
-1.0
-0.5
0.0
0.5
1.0
y(t
),z(t
)
t
y(t)=cos(t) z(t)=-sin(t)
Plasma Application Modeling, POSTECH
CodeCode
subroutine ode(y0,z0,y,z)real y0,z0real y(1600),z(1600)real dxinteger Ncommon /a/ N,dx
y(1) = y0z(1) = z0
do 130 i=2,N y(i) = y(i-1) + dx*z(i-1) z(i) = z(i-1) - dx*y(i-1)
130 continueend
Plasma Application Modeling, POSTECH
Result (1) -Result (1) -
Solution
Error
)(ty
0 2 4 6 8
0.00
0.05
0.10
0.15
0.20
0.25
0 2 4 6 8
0.00
0.05
0.10
0.15
0.20
0.25
err
or
t
err
or
t
005.0h0005.0h
)(
0 2 4 6 8
-1.0
-0.5
0.0
0.5
1.0
0 2 4 6 8
-1.0
-0.5
0.0
0.5
1.0
y(t
)
t
y(t
)
t
005.0h 0005.0h
)(
Plasma Application Modeling, POSTECH
Result (2) -Result (2) - )(tz
Error
Solution
0 2 4 6 8
-1.0
-0.5
0.0
0.5
1.0
0 2 4 6 8
-1.0
-0.5
0.0
0.5
1.0
z(t
)
t
z(t
)
t
005.0h 0005.0h
)(
0 2 4 6 8
0.00
0.05
0.10
0.15
0.20
0 2 4 6 8
0.00
0.05
0.10
0.15
0.20
err
or
t
err
or
t
005.0h0005.0h
)(