VIII. Ordinary Differential Equationsocw.snu.ac.kr/sites/default/files/NOTE/4179.pdf4. Multipoint...
Transcript of VIII. Ordinary Differential Equationsocw.snu.ac.kr/sites/default/files/NOTE/4179.pdf4. Multipoint...
수치해석기초 (Elementary Numerical Analysis)
VIII. Ordinary Differential Equations
2008. 11
담당교수: 주 한 규
[email protected], x9241, Rm [email protected], x9241, Rm 32 205원자핵공학과
SNURPL1
VIII. Ordinary Differential Equations
1. Introduction- Classification of ODE, First order vs. Higher Order ODE- Model Problems
2. Euler MethodO d f E- Order of Error
- Explicit Euler Method and Stability- Implicit Euler Methodp
3. Predictor-Corrector Method4. Multipoint Methodsp
- Adams-Bashforth and Adams-Bashforth-Moulton Methods5. Runge-Kutta Methods
- Second Order Method and Fourth Order Method 6. System of First Order Differential Equations
SNURPL2
1. Introductiono Higher Order Ordinary Differential Equation (ODE)
))(,),(),(,()( :Form Normal )1()( xyxyxyxfxy mm −′′′= L
o Classification of ODE1
)1(10 )0(,,)0(,)0( :BCor IC −
− ==′= mm yyyyyy L
Propagation Problem (Initial Value Problem)- Known information (initial values) is propagated forward in time or space
Spring-Mass System, Current in an Electric Circuit, Blackbody Radiation, etcp g y , , y ,Curve or Field Line Equation
Equilibrium Problem (Boundary Value Problem) - Known information is specified at two different values of x which closes p
the problem domain1-D Heat Conduction
Eigenvalue Problem (Boundary Value Problem)- Special equilibrium problem in which the solution exists only for a special
values of a parameterHelmholtz Equation, 1-D Particle Diffusion Equation
SNURPL3
1. Introduction
o Numerical Solution of ODEFinite Difference Approximation of Derivates
- Forward, Backward, Central DifferenceMarching at Each Step for Propagation Problem
- Numerical solution error can propagate over the domainNumerical solution error can propagate over the domain Solution of Linear System for Boundary Value Problems
- Single Solution for Equilibrium ProblemsM lti l S l ti f Ei l P bl P i l C d- Multiple Solutions of Eigenvalue Problems Previously Covered
o Higher Order ODE vs. 1-st Order ODEOne higher order ODE can be converted a system of 1 st orderOne higher order ODE can be converted a system of 1-st order ODEs
;)(;)(
;)(
23
12
1
duuxyduuxy
uxy
L=≡′′=≡′
≡
→′′′= − ))()()(()( )1()( xyxyxyxfxy mm L
)(
;)( ;)(
1)1(
32
mm
m
dxduuxy
dxuxy
dxuxy
=≡ −−
→= ))(,),(),(,()( xyxyxyxfxy
Solution of 1-st Order ODE by Marching is of Prime Importance!
SNURPL4),,,()( 21
)(m
mm uuuxfdx
duxy L==
a c g s o e po ta ce
1. Introduction
o Model ProblemsStephan Boltzmann Law of Radiation Cooling
)( 44aTT
dtdT
−−= α
Point Kinetic Equations
)()()(
)()()()(
ttpt
ttpttp
λζβζ
ζλβρ
−=Λ
+Λ−
=&
&
Function)(DrivingReactivity:)(ionConcentratPrecursor Delayed :)(
Power Reactor :)(
)()()(
tttp
ttpt
ρζ
λζβζ
Function)(DrivingReactivity :)(tρ
SNURPL5
2. Euler Methods
o Normal Form of First Order ODEy)(x,point aat variationof slope ),( ←=′ yxfy
At any point on the x-y plane, direction of motion is determined when moving along a curve (for solution curve G(x,y)=0)
E li it E l M th do Explicit Euler Method
h ′
Point Initial )( 00 ←= xyy
)(f′h
yh ′
),(
1 nnn
nnn
yhyyyxfy
′+==′
+
o Local Error of Euler Method (Single Step)
.and suppose andsolution true thebe )(Let
yyyyxy
′=′=•
1 ofError Local 1yn• +
. and nnnn yyyy
)(1)(
Solution True ofExpansion Taylor
321 hOhyhyyhxyy nnnnn +′′+′+=+≡
•
+)(
)(21
2
32111
hO
hOhyyye nnnn
→
+′′=−= +++
SNURPL6
)(2
)(1 yyyyy nnnnn+
2. Euler Methods
o Global Error of Euler MethodError at the end of the problem domain• Ne
2
1 1
p1 ( ( )) 2
h ( )
N N
N n n nn n
e e y x hξ
ξ
= =
′′= =∑ ∑NLh =
1 where ( )
n n nx x xξ− < < nx Nx L=
⎛ ⎞1 1
1 1 ( ( )) ( ) ( )2 2
where
N N
N n n n nn n
e y x h h g x h g L y hL
x x
ξ τ
τ
= =
⎛ ⎞′′ ′′= = = ⋅ =⎜ ⎟⎝ ⎠
< <
∑ ∑)(τgg =
0
First Order Acc
where
( ) :
ura
te
N
N
x x
e O h
τ< <
⇒ =
)(gg
τ
SNURPL7
2. Euler Methods
o Stability of Explicit Euler Method• ODEfollowing theSuppose
teytyydtdy αα −=→−= 0)(
• SchemeEuler Explicit
hy
yyhhyyyn
nnnnn ααα −=→−=−= +
+ 1)1(
Sc e eu ep c
11
Stable :101G 1)
SizeStepTimes.Behavior vSolution
hh <→>−=
•
αα
2
UnstableOvershoot, :21011 2) hh <<→<−<−αα
α
α
Stability condition limits the time step size
Divergent :2113) hh <→−<−α
α
SNURPL8
2. Euler Methods
),( 111 +++ =′ nnn yxfy
o Implicit Euler Method
11 ++ ′+= nnn yhyy
Decay lExponentia for the Example•
Stablelly Uncontiona:11
1)1( 1111 <
+=→=+→−= +
+++ hyyyyhhyyy
n
nnnnnn α
αα
CoolingRadiativefor theExample•
( ) EquationNonlinear :0 CoolingRadiative for the Example
41
41
4411 =−−+→−−=
•
++++ annnannn hTTThTTThTT ααα
Unconditionally stable, but might lead to a nonlinear equationThe order of accuracy remains first order.
SNURPL9
3. Predictor Corrector Method
o Predictor Step employinglocation candidatenew theDetermine •
hyh ′
~),(
methodEuler explicit the
nnn
yhyyyxfy
′+==′
1 nnn yhyy +=+
),( )~,( ~ point timenew at the slope theDetermine
111 nnnnnn yhyhxfyxfy ′++==′•
+++
o Corrector Step slopepoint end and beginning theusing slope average interval theDetermine •
( ) ~ 21ˆ 1+′+′=′ nnn yyy
slopeaveragetheusinglocation final Obtain the •
( )hyhyhxfyy
yhyy
nnnnn
nnn
),(21
ˆ pgg
1
′+++′+=
′+=+
SNURPL10
( )yyfyy nnnnn )(2
3. Predictor Corrector Method
o Error of Predictor-Corrector Method1 ( , )n n n ny f x h y hy+′ ′= + +%
2 ( , ) ( )n n nf ff x y h hy O hx y
f f∂ ∂
∂ ∂ ′= + + +∂ ∂
⎛ ⎞ df f f d d ′∂ ∂2 ( , ) ( )n nnf f f yx y
x y h O h∂ ∂ ′+⎛ ⎞
= + +⎜ ⎟⎝ ⎠∂ ∂
df f f dy dy ydx x y dx dx
′∂ ∂ ′′⇐ = + = =∂ ∂
2( )n ny y h O h′ ′′= + +
( )1
2
2
3
1 2
1(
( )
)n n n n ny y y h
h h O
y O h
h
y h+ ′= + +
′ ′′
′ ′′+ +)(
61
21
Solution TrueofExpansion Taylor
4321 hOhyhyhyyy nnnnn +′′′+′′+′+=
•
+
( )n ny y
2 31 ( )2n nny y h y h O h′ ′′= + + + 621 nnnnn+
nn xy• then ,at exact is that Assume 1
3 3 4
Error at 1 ( ) ( )
nx
h O h O h
+•
′′′
nnnn
nnnn
yyyf
xfy
yf
xfy
yyxfy
′′=′∂∂
+∂∂
=′∂∂
+∂∂
≡′′
′==′
),( 3 3 4
1 1 1
3
( ) ( )6
( ) Third Order Accurate Local ErrorGl b l E S d O d
n n n ne y y y h O h O h
O h
+ + + ′′′= − = − + −
= ←
SNURPL11
yxyx ∂∂∂∂ Global Error Second Ord r e → =
4. Multipoint Methods
o Single Point vs. Multipoint MethodsSingle Point Method : Only one previous data point is used to determine the next point value Multi Point Method
- Several previous points are used to determine a higher order p p gpolynomial (usually 3-rd order) of the derivative (y′)
- The polynomial is applied to the next interval to represent the variation of the slope over the intervalof the slope over the interval
- The polynomial is integrated over the interval to determine the average slope
o Single Step vs. Multistep MethodSingle Step Method : The slope is evaluated only onceMultistep Method: The slope is evaluated several times atMultistep Method: The slope is evaluated several times at multiple locations within the next interval; predictor-corrector
SNURPL12
4. Multipoint Methods
o Explicit (Open) Multipoint MethodOnly previous data are used to determine the higher order polynomial Adams-Bashforth Method
- Use previous 4 derivative data to determine a third order polynomialp p y
1 2 3
Let be the step size and be the origin of the coordinate0, , 2 , 3
n
n n n n
h xx x h x h x h− − −
•
→ = = − = − = −
00
33 3
Lagrange Polynomial for using 4 points( )
(
( )
) ( )(
( )
)
( , )
n jn i
i j
x xy x P x f
x
y x f x y x
x+
+
•−
′
′ =
= =−∑ ∏
- Integrate the polynomial over the next interval [0,h] to define avg. slope
( )93759551)(1′ ∫h
ffffdP
3 3 ( )i j n i n jj i
x x=− =− + +≠
( )3210 3 937595524
)( −−− −+−=>=′< ∫ nnnnn ffffdxxPh
y
- Use the average slope to update the function value
( )h
SNURPL13
( )3211 937595524 −−−+ −+−+= nnnnnn ffffhyy
4. Multipoint Methods
o Implicit (Closed) Multipoint MethodNext data point is also included to improve stabilityAdams-Bashforth-Moulton Method
- Use previous 3 derivative data and the next data point to determine a third order polynomialp y
1 21
Let be the step size and be the origin of the coordinate, 0, , 2
n
n n nnx hh x
x x h x h− −+ =
•
→ = = − = −
L P l i l f ( ) ( ( )) i 4 i tf′1
2
1
32
Lagrange Polynomial for ( ) ( , ( )) using 4 points( )
( ) ( )( )
n jn i
j n j n ji
y x f x y xx x
y x P x fx x
++
=− =− + +
′• =−
′ = =−∑ ∏
- Integrate the polynomial over the next interval [0,h]
( )51991)(1′ ∫h
ffffdP
( )j n j n jj i
+ +≠
( )2110 3 519924
)( −−+ +−+=>=′< ∫ nnnnn ffffdxxPh
y
1 1Since is undetermined, use Adams-Bashforth to estimate .n nf f+ +•
abovedeterminedslopeaveragetheusingpointnexttheUpdate•
SNURPL14
abovedeterminedslope averagetheusingpoint next theUpdate•
4. Multipoint Methodso Characteristics of Adams-Bashforth and Bashforth-
Moulton Multipoint MethodsN d 4 i i t lNeed 4 previous points alwaysThus at the beginning the single point method should be usedThe global error is order 4
- Local Error = 5-thCubic polynomial fourth order error h times for integration 5-th order
D i ti d t b l t d l ti i t fDerivative needs to be evaluated only once per time point for Adams-Bashforth
- Less computational work compared to the multistep method which requires multiple evaluations of derivative
But the accuracy is inferior compared to the multistep method of same order since the extrapolation is mostly based
i d ton previous data- Adams-Bashforth-Moulton is obviously better because it involves the
next points as well as four previous points
SNURPL15
5. Runge-Kutta Method
o Multistep MethodEvaluate the slope at several points in the interval and determine the slope as the weighted average of them
o Second Order Method ( ) ( , )y x f x y′ =
1 1 1
First Slope ( , )y f x y k hy•
′ ′= → =
S d Sl i i
1k2k
1kβ W i h d A f Sl
2 1 2 2
Secod Slope at an Interior Point ( , )y f x h y k k hyα β•
′ ′= + + → =
hhα
1kβ
1 2
Weighted Average of Slopes (1 )y y yω ω•
′ ′ ′< >= + −
New Function Value•
( )1 2
1
(1 )New Function
( ,
Value
( , ) ( )1 )h y y h y y
k k
f x hy yh kf x yω
ωω
ω α β
′= + < >= +
= +
+ −
+ ++ −
SNURPL16
5. Runge-Kutta Method
o Choice of Interior PointsTaylor Expansion
12
1( , ) ( , ) ( )f ff x h y k f x y h k O hx y
α β α β∂ ∂+ + = + + +
∂ ∂or
1k y h fh′← = =
f f⎛ ⎞∂ ∂
( )2(1 ) ( ) ( )h x yy y h f f f f f h O hω ω α β⎡ ⎤→ = + + − + + +⎣ ⎦43;
31
=== βαω
or2( )f ff h O h
x yfα β
⎛ ⎞∂ ∂= + + +⎜ ⎟∂ ∂⎝ ⎠
( )2 3 (1 )( ) ( )
h x y
x yy hf f f f h O hω α β⎣ ⎦
= + + − + +
On the other hand, ( )y y x• =
1(1 )21(1 )
α ω
β ω
− =
=2 3
, ( )
( ) ( )2h
y yyy y x h y y h h O h′′
′= + = + + +
(1 )2
Three UnknownsTwo Equations
β ω− =
df f f dy∂ ∂′ ′′ ′ Two Equations
( ) 2 3
;
1( ) ( )2h x y
x yf fdf f f dyy f ydx x y dx
y y x h y fh f f y h
y
O h
∂ ∂′ ′′= = = + =∂ ∂
′= + = + + + +
′+1 ; 12
P di C
ω α β= = =
SNURPL17
( )( ) ( )2h x yy y y f f f y
Predictor Corrector→
5. Runge-Kutta Method
o Fourth Order Runge-Kutta MethodTake 4 interior points to evaluate the slopeThen use the weighted average of the four slopes
)(SlopesFour
hkf ′→′• Average Weighted
ywywywywy ′+′+′+′>=′<•
332223
221112
111
),( ),(
),(
yhkkyhxfyyhkkyhxfy
yhkyxfy
′=→++=′′=→++=′
=→=
βαβα
44332211 ywywywywy +++>=<
•
441334 ),( yhkkyhxfy ′=→++=′ βα
New Function Value•1k
2k
4k3k
•
••
1 1 2 2 3 3 4 4
hy y y hy k k k kω ω ω ω
′= + < >= + + + +
h
Determine 's, 's, 's such that the Taylor expansion be exact upto the 4-th order α β ω•
SNURPL18
5. Runge-Kutta Method
o Taylor Expansion for Two-Variable Function2 1 1 1 ( , )y f x h y kα β′ = + + 1k hf=
( )
( )
2 2 21 1 1 1 1 1
3 3 2 2 2 3 4
2 2
2 2 3 3
1 ( , ) 22
1
x y xx xy yyf x y f h f f h f h fhf hf h fα β α α β β= + + + + +
( )3 3 2 2 2 3 41 1 1 1 1
2 2 3 31
1 3 3 ( )6 xxx xxy xyy yyyf h f h hf f O hhf h f h fα α β α β β+ + + + +
( )3 2 2 2
2 2 2 2
( , )1( ) 2
y f x h y k
f x y f h f f h f h k fk k
α β
α β α α β β
′ = + +
= + + + + + k h ′( )
( )
2 2 2 2 2 2 2
3 3 2 2 2 3 42
2 2
2 32 2 22 2 2 2 2
( , ) 22
1 3 3 ( )6
x y xx xy yy
xxx xxy xyy yyy
f x y f h f f h f h k f
f h f h
k k
k k khf f O h
α β α α β β
α α β α β β
= + + + + +
+ + + + +
2 2k hy′=
SNURPL19
5. Runge-Kutta Method
( ) ( )2 1 1 1
2 2 2 2 31 1 1 1 1 1
( , )1 22x y xx xy yy
k hf x h y k
hf f f f h f f f f f h
α β
α β α α β β
= + +
= + + + + +
1k hf=
( )3 2 2 2 3 3 4 51 1 1 1 1 1
21 3 3 ( )6 xxx xxy xyy yyyf f f f f f f h O hα α β α β β+ + + + +
3 3k y h′=
( )3 3
2 2 3 2 22 2 2 2 2 2 2
22 2
1 22
1
x y xx xy yy
y
fh f h f f h f h k fk h k hα β α α β β= + + + + +
( )3 4 2 3 2 2 3 52 2 2 2 2 2
4
2 32 2 2
1 3 3 ( )6
?
xxx xxy xyy yyyf h f h hk f f hk k O h
k
α α β α β β+ + + + +
1 1 2 2 3 3 4 4
1 2 3 4 ( )y k k k k
hfω ω ω ωω ω ω ω
Δ = + + += + + +
( )22 1 1 3 2 4 3 3
3 4 53 4
2( ) ( ) ( )
( )x y x y x yh f f f f f f f f f
h c h c O h
ω α β ω α β ω α β+ + + + + +
+ + +
SNURPL20
5. Runge-Kutta Method
o Taylor Expansion of Single Variable Form(4)
2 3 4 5 ( ) ( ) (*)hy y yy y x h y y h h h h O h′′ ′′′
′= + = + + + + + L( ) ( ) ( )2 3! 4!
( , ); x x y
h
y
y y y y
f fy f x y f yy f f′ ′ ′= + = +′=
2 ( )( )y f f f yf y f yf yf′′′ ′′ ′++ + +′+2 2
(4)
( )
(
2
?
) xxx y y x y
xx xy yy x
y
y
x yy
y
y f f f y
f f f f f f f
f y f y
f f
f y
y
f += + + +
= + + +
+
+
=2Coefficients of the 2nd order terms ( )?
1 ( )
h
y f f f
•
′′→ + 1
?y =
Coefficients of the 1st order terms ( )?from Eq. (*)
hy f•′ =
1
2 2 1 1
( )2
0( )
x y
x y
y f f f
kk f f fω α β
→ +
→→ +
2 1 3 2 4 3
2 1 3 2 4 3
1 21
ω α ω α ω α
ω β ω β ω β
= + +
= + +
1 1
2 2 1 2 3 4 1k fk fk f
ωω ω ω ω ω
→→ ⇒ + + + =→ 2 2 1 1
3 3 2 2
4 4 3 3
( )
( )
( )
x y
x y
x y
f f f
k f f f
k f f f
β
ω α β
ω α β
→ +
→ +
2 1 3 2 4 32ω β ω β ω β+ +
i iα β=
3 3
4 4
k fk f
ωω
→
→
7 k i i
SNURPL21
7 unknowns remaining→
5. Runge-Kutta Method
o Other Relations1 2 3 4 1ω ω ω ω+ + + = Unknowns7forEquations→ 1
3 1 2 4 2 3
1 2 3 4
1
1 6
ω α α ω α α+ =Choice Standard
Unknowns7for Equations→( )1 1 2 3 4
where
1 2 26n ny y k k k k+ = + ++ +
2 23 1 2 4 2 3
2 1 3 2 4 31
1 8
2
ω α
ω α ω α ω
α ω α α
α
+ =
=+ +
121
11 ==
β
βα 1
2 1
( , )1 1 ,2 2
n n
n n
k hf x y
k hf x h y k
=
⎛ ⎞= + +⎜ ⎟⎝ ⎠3 1 2 4 2 3
2 2 22 1 3 2 4 3
81 3
ω α ω α ω α+ + =
1112
33
22
==
==
βα
βα
3 2
2 21 1 ,2 2n nk hf x h y k
⎝ ⎠⎛ ⎞= + +⎜ ⎟⎝ ⎠
2 23 1 2 4 2 3
3 3 3
1 12
1
ω α α ω α α
ω α ω α ω α
+ =
+ + =
31 ,
61
3241 ==== ωωωω ( )4 3 ,n nk hf h kx y= + +
2 1 3 2 4 3
4 1 2 31
4
24
ω α ω α ω α
ω α α α
+ + =
=
SNURPL22
24
Assessment of Accuracy
o Solution of Radiation Cooling Problemfunction y=stfbol(t,T)alpha=2.e-12;Ta=250;
l h *(T^4 T ^4)y=-alpha*(T^4-Ta^4);
y0 2500;
d lt 1 0
=
delt=1.0;
SNURPL23
Assessment of Accuracy
o Error Reduction BehaviorError of Various Methods at 10 sec
Time Euler Predictor-CorrectorAdams-Bashforth-
MoultonRunge-Kutta
Step Size, sec Error
Reduction Ratio
ErrorReduction
RatioError
Reduction Ratio
ErrorReduction
Ratio
1 1.49E+01 2.78E-01 7.48E-03 1.39E-05
0 5 7 29E 00 2 05 6 88E 02 4 05 5 25E 04 14 26 5 43E 07 25 670.5 7.29E+00 2.05 6.88E-02 4.05 5.25E-04 14.26 5.43E-07 25.67
0.25 3.61E+00 2.02 1.71E-02 4.03 3.43E-05 15.31 2.44E-08 22.27
0.125 1.79E+00 2.01 4.26E-03 4.01 2.18E-06 15.70 1.24E-09 19.75
0.0625 8.94E-01 2.01 1.06E-03 4.01 1.38E-07 15.87 6.73E-11 18.350.0625 8.94E 01 2.01 1.06E 03 4.01 1.38E 07 15.87 6.73E 11 18.35
0.03125 4.46E-01 2.00 2.66E-04 4.00 8.63E-09 15.94 2.96E-12 22.77
SNURPL24
6. System of First Order Differential Equationso Solution of a Second Order
Differential Equationo Predictor Corrector Solution
Obtain the predictor slopes for bothbothUse the two predictor slope to correct the slope
Oscillation of a mass on a spring ( ) ( ) ( )
Normal Formmy t y t ky f tβ
•′′ ′+ + =
• 00 1P ⎛ ⎞⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎡ ⎤ Normal Form ( ) ( ) ( ) y t by t ay g t•
′′ ′= − − +1,1, 1 1,
2,2, 1 2,
00 1
Pnn n
Pn nn n
yy yh
y gy y a b+
+
⎛ ⎞⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎡ ⎤= + +⎜ ⎟⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥⎜ ⎟− −⎣ ⎦ ⎣ ⎦⎣ ⎦⎣ ⎦ ⎣ ⎦ ⎝ ⎠
Conversion into two 1-st order ODEs•1 1 1n ny y+⎡ ⎤ ⎡ ⎤
⎢ ⎥ ⎢ ⎥1
122
( ) ( )
( ) ( )
y t y tdy ydt
y t y t →
=
′= =
1, 1 1,
2, 1 2,
1,1, 1 0 00 1 0 11 2
n n
n n
Pnn
P
y yy y
yyh
yg ga b y a b
+
+
+
=⎢ ⎥ ⎢ ⎥⎣ ⎦ ⎣ ⎦
⎛ ⎞⎡ ⎤ ⎡ ⎤⎡ ⎤ ⎡ ⎤⎡ ⎤ ⎡ ⎤+ + + +⎜ ⎟⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎜ ⎟⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎣ ⎦⎣ ⎦⎣ ⎦⎝ ⎠
0 1 0y y′⎡ ⎤ ⎡ ⎤⎡ ⎤ ⎡ ⎤ 1, 1, 1 1, 00 1 Pn n ny y yh +
⎛ ⎞⎡ ⎤ ⎡ ⎤+ ⎡ ⎤⎡ ⎤+ +⎜ ⎟⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥
22 1 ( ) ( ) dyy t by ay g t
dt
dt
′′ = = − +−
2,12, 12
nn nn yg ga b y a b++
⎜ ⎟− − − −⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎣ ⎦⎣ ⎦⎣ ⎦⎝ ⎠
{ {
1 1
2 2
0 1 0( ) ( )
( )( )
y yt t
y ya b gtt
⎡ ⎤ ⎡ ⎤⎡ ⎤ ⎡ ⎤= + = +⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥′ − −⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎣ ⎦
Ay g
gyA14243
, , ,
12, 2, 1 2,
2 P
n nn n n g gy a b y y ++
= + +⎜ ⎟⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥⎜ ⎟+− − +⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎣ ⎦⎝ ⎠
SNURPL25
( , )t= F y
Simulation of Damped Oscillation
y2];[y1;=y0;=y210;=y1b];- a- 1 [0=A
0.05;=b0.2;=a
100t d1.0;=delt99;=tend
0;=ty2];[y1;y0;y210;y1
0;=i1;=j
yn;clear tn 100;=tend
dfn]);[0;+y*(A*delt+y=yp df(t);=dfn 1;+i=i
tend)<(t while
dfnp1)/2;+dfn+yp)+(y*(A*delt+y=yt;= tn(i)df(t);=dfnp1
delt;+t= t
yn)tnr''yrefplot(trefoscil_ref load
end y(1);=yn(i)
dfnp1)/2;dfnyp)(y(Adeltyy
SNURPL26
yn)tn,,ryref,plot(tref,
6. System of First Order Differential Equations
o Point Kinetics Equation with 6 Delayed Groups 6( ) ktρ β λ− ∑ ⎥
⎤⎢⎡⎥⎤
⎢⎡−
⎥⎤
⎢⎡ 1
111 ζβλζ
1
( )( ) ( ) ( )
( ) ( ) ( ), 1,..,6
kk
k
k k k k
tp t p t t
t p t t k
ρ β λ ζ
ζ β λ ζ=
= +Λ Λ
= − =
∑&
&
dd
⎥⎥⎥⎥⎥⎤
⎢⎢⎢⎢⎢⎡
⎥⎥⎥⎥⎥⎥
⎢⎢⎢⎢⎢⎢
−−
−
=⎥⎥⎥⎥⎥⎤
⎢⎢⎢⎢⎢⎡
4
3
2
1
44
33
22
4
3
2
1
ζζζζ
βλβλβλ
ζζζζ
6
1
where
kk
β β=∑ pt
p
dt
⎥⎥⎥⎥⎥
⎦⎢⎢⎢⎢⎢
⎣⎥⎥⎥⎥⎥
⎦⎢⎢⎢⎢⎢
⎣ Λ−
ΛΛΛΛΛΛ
−−
⎥⎥⎥⎥⎥
⎦⎢⎢⎢⎢⎢
⎣)( 6
5
4
654321
66
55
6
5
4
ζζζ
βρλλλλλλβλβλ
ζζζ
1
( ) : Reactor Power ( ) : Delayed Precursor Concentration
k
p ttζ
=
Aydtdy
pp
=→
⎦⎣⎥⎦⎢⎣ ΛΛΛΛΛΛΛ⎦⎣
1
Runge-Kutta Solution Sequence 1) nts yA•
=
( ) : Reactivity (Driving Function) ( ) ( )
: Lifext t p
tfρ
ρ= −
Λ e Time (~20 s)μ
1 1
2 0.5 1
2 2
2) 3) ( 0.5 ) 4)
n
t h
n
k y hss A y kk y hs
+
= +
= +
= +: LifΛ e Time ( 20 s)μ
( )
3 0.5 2
4 3
1 1 2 3 4
5) ( 0.5 ) 6) ( )
17) 2 2
n t h
n t h
k y hA y kk y hA y k
y y k k k k
+
+
= + +
= + +
= + + + +
SNURPL27
( )1 1 2 3 4 7) 2 26n ny y k k k k+ + + + +
6. System of First Order Differential Equations
;sum(betak)betat0002584];.001102,0..0030704,0.0013908,0,0.00152,0[0.0002584betak
6];4027,3.928,0.3181,1.0318,0.119[0.0128,0.lambdakconstants %physical
==
= Main Loop
while t tend i i 1;% Runge-Kutta 1st Step
A *
•<
= +
mbdak'*p0;betak' /laystate-steadyat condition initial %
%power %initial 6;-1.ep0
0;t5;-2.5egentime
;( )
=
==
=k1 delt*yptp t 0.5*deltdelrhot betat*(rho(
tp,psum,y(7))-1)/
yp At*y; ; ; ;
gentimeAt(7,7) de ;
%lrhot
== +
==
=
b kbd k)di (lmatrix system %
;1)/gentime-y(7))psum,(rho(t,*betatdelrhotreactivity %
0;psump0;y(7)
mbdak *p0;betak ./lay
=
==
= % yp At*(y 0.5*k1) ;
= +k2 delt*yp;
% yp At*(y 0.5*k2); k3 delt*yp;%
=
= +=
N);zeros(1,tn/delt);round(tendN
0.005;delt0.99;tend
delrhot]; ntimelambdak/ge betak' bdak)[-diag(lamAt
====
=tp t deltdelrhot betat*(rho(tp,psum,y(7))-1)/gentime;
At(7,7) delrhot
% ;
; yp At*(y k3); k4 delt*yp;
= +
=
=
+
=
=
Feedbackwith ReactivityRamp•
0;itn;yn
N);zeros(1,tn
== % Runge-Kutta 4-th Step
; t t delt; tn(i) t; yn(i) y(7);
y y (k1 2*k2 2*k3 k4
psum psum y(7)*delt
)
;
/6= + ++
== +
+ +=
=
elset;*a=y
tramp)<if(t0.05;=alphap
;ymax/tramp=a0.1;=tramp1.2;=ymaxp)psum,rho(t,=yfunction
yp
psum psum y(7) delt;end
+
fb*l hp;*w)-(1+psum*w=pfb
t);*exp(-dec=w0.01;=dec
endymax;=y
else
SNURPL28
pfb;*alphap-y=y
Simulation of Power Pulse
SNURPL29
Fuel Burnup Chain
1 1
( ) ( ) ( 1,..., ) : Bateman Equat nioN N
iij j j ij j j i
j jj i j i
i i
i
dX t X X X i Ndt
dλ φ γ σ λ σ φ
= =≠ ≠
= + − =+∑ ∑l14243
Cm244
(18.1y)Cm242
(162d)α(162d)Cm243
(29.1y)( ) : atomic density of nuclide : decay constant of nuclide : position- and energy-averaged flux : spectr aum
i
i
X t iiλ
φσ veraged absorption cross section of nuclide i
Pu240
(6560 )Pu241
(14 4 )Pu242
(3 7 5 )
Am243
(7360y)
Pu238
(87 7 )Pu239
(24100 )
Am241
(433y)Am242m
β
α(433y)
EC
: spectr -aumiσ veraged absorption cross section of nuclide i
Np237
(2.1e6)Np239
(2.4d)
(6560y) (14.4y) (3.7e5y)(87.7y) (24100 y)
β
U234
(2.5e5y)U235
(7.0e8y)U236
(2.3e7y)U238
(4.5e9y)U233
(1.6e5y)
β
(n,2n)
Th232
(1.4e10y)Pa233
(27.0d)
β
SNURPL30
Matrix Exponential Solution of System of ODEs Matrix Form of System of ODEs
( ) ( ), (0)givend t t
•
=y Ay y 2 3
(0)
( ) ( ) ( )
at
n
y ay y y e
at at at
′ = → =
⎛ ⎞( ), ( )gdt
y y
Solution•
( ) ( ) ( )( ) (0) 12 3! !
at at aty t y atn
⎛ ⎞= + + + + +⎜ ⎟
⎝ ⎠L
0
( )let ( )= (0)!
k
k
ttk
∞
=
− ∑ Ay y
2 3⎛ ⎞ 3 2 1⎛ ⎞
= (0)teA y
2 3( ) ( ) ( ) ( )= (0)2 3! !
nd t d t t ttdt dt n
⎛ ⎞+ + + + +⎜ ⎟
⎝ ⎠
y A A AI A yL3 2 1
= (0)2! ( 1)!
n nt ttn
−⎛ ⎞+ + + +⎜ ⎟−⎝ ⎠
A AA A yL
2 2 1 1n nt t− −⎛ ⎞A A ( )= (0)2! ( 1)!
t ttn
⎛ ⎞+ + + +⎜ ⎟−⎝ ⎠
A AA I A yL ( )t= Ay
2 2Define
n nt t t
•A A AI A=
2! !te t
n+ + + + +A I A L
Solution in Matrix Exponential
t
•
A∞
∑ 1 i h ( )
SNURPL31
( ) (0)tt e= Ay y0
kk=
= ∑y 1 01 with (0)k kk −= =y Ay y y
Matrix Exponential in Krylov Subspace
2 2
Solution in Krylov Subspace
( ) 0( )k
tktt e t t
•
⎛ ⎞= + + + +⎜ ⎟≅A AAy y I A yL ( )t K∈y0( ) 0
!( )
2!t e t
k= + + + +⎜ ⎟
⎝ ⎠≅y y I A yL
20 1 0 2 0 0( ) ( ) ( ) ( ) k
ht c t c t c t= + + + +y y Ay A y A yL mz1( ) nt K +∈y
2 10 0 0 0 Krylov subpace K { , , , , }m
m−• = y Ay A y A yL y%0y
Search an approximate solution in lower dimensional Krylov Subspace•
0 0 0
pp y p
( , ),tm me K m k≅ = + ∈ <A y y y z A y%
0Let K be spanned by othornormal bases withm• vv yv 0
01 1 Let K be spanned by othornormal bases, ,with m mm =• vvv
yL
,1[ , , ] ( )m n
m m n− = ∈ <mV v vL
1p⎡ ⎤⎢ ⎥
m→ =Tm mV V I
1 [ , , ]m
mp
⎢ ⎥− = =⎢ ⎥⎢ ⎥⎣ ⎦
my v v V p% L M 0 ,t me→ ≅ ∈Amy V p p
Least Square Solution for Overdetermined Systemt
•AV T tT AV V V T tAV
SNURPL32
0te= A
mV p y 0T tme=T A
m mV V p V y 0T tme→ = Ap V y
Calculation of Matrix Exponential by Krylov Method
0T tme= Ap V y 0 10 1
0e
!T t Tm m
j
m
jk
mj
A tj
e=
= = ∑AV yV V V ey
Tm m mTm m m
==
V V IV AV H
0
0 1 0 1
0[ , , ]m m
⎡ ⎤⎢ ⎥⎢ ⎥= =⎢ ⎥
y
y v v y V eLM m m mV V
0⎢ ⎥⎢ ⎥⎣ ⎦
M
21 1 1 1 1 1( ) ( )T T T T T TV A V e V AAV e V A V H v e e V H Av eAV e+ += = + = +% %
1 1 1 1( )T T Tm m m m m m m m mV V H v e H e V Av e e+ += + +% % 1 0T
me e =Q
1 1 1 1 1 1( ) ( )m m m m m m m m m m m m mmV A V e V AAV e V A V H v e e V H Av eAV e+ ++ +
1 1( )Tm m m m mH V v e H e+= + %
12mH e=
0 1 10
00! !
j j j jkT
m m
km
j j
x V V ej
xA t et Hj= =
→ =∑ ∑
Finally : Exponential with much smaller matrix! but dense !mte= Hp y H
1 1In general, T j jm m mV A V e H e= 0 1
mH tx e e=
SNURPL33
0Finally, : Exponential with much smaller matrix!, but dense !me=p y H
Arnoldi Process in Krylov Subspace
v Objective: Build a set of orthogonal bases of Krylov sub-space mK•
1 11:
, 1,2, ,ij j i
Choose a vector v of normFor j m
h Av v for i j=
=< > = K
jAv1jv +
h
11
, 1,2, ,ij j i
j
j j ij ii
h Av v for i j
v Av h v+=
< >
= −∑
K
%
vjjh 1j jh
1,j jh +
1 1
1
1,
, 2
1, , ,/0 .j j j
j j j
j j jv
h w
If h elsestopv h+ + +
+
+ ≠ =
=
%
jv1jv −
jj 1,j jh −
1j
A h+
∑
1jAv −
E dn
1) : compent of onto ( )ij j ih Av v previously determined1
j ij ii
Av h v=
=∑
12) ( ) where ( ) is a -th order polynomial ( each time, the order increase by ).
3) 's are orthonogonal are orthogonal bases of subspace of .4
j j j j
i m
Av A v x j Av
v K
η η= Q
) ( )v K A v∈
SNURPL34
4 1 1) ( , )j jv K A v+ ∈
Hessenberg Matrices
11 12 1 1 1
Define Hessenberg Matrices
m mh h h hh h h h −
•
⎡ ⎤⎡ ⎤ ⎢ ⎥
LL11 12 1 1 1
21 22 2 1 221 22 2 1 2
32 3 1 3,32 3 1 3
00 ,
0
m mm m
m mm mm m
m m m m
h h h hh h h h
h h h hh h h
H h h h H
−−
−−
−
⎡ ⎤ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥= ∈ = ∈⎢ ⎥⎢ ⎥ ⎢ ⎥
L
OO
M O O M1,m m+
1,
1
1
00
00 0
0 0mmmm
mmm
mmmhhh
h h −−
+
⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎣ ⎦
⎢ ⎥⎣ ⎦
M O O MM O O M
LL
1 2[ , , , ] j colj m mAv v v v H j m
V
−= ∀ <L1442443
1
1
j
j ij ii
Av h v+
=
= →∑ ,n mmV ∈
mV1
1
m
m im ii
Av h v+
=
= →∑ 1, 1
1
m colm m m m m m
m
Av V H h v
v
−+ +
+
= +14243%
V H + %
1TAV V H v e= + %
1 2 1[ , , , ] [ , , , , ]m m m m
m
Av Av Av V H vAV
+= + =0 0 0 %L L144424443
[0, 0,1]T mme = ∈L
1T
m m m mV H v e++ %
1V H=
A mV mV mH= +1mv +%
SNURPL35
1m m m m mAV V H v e++ 1m mV H+
Properties of Bases and Hessenberg Matrices 1 1
Tm m m m m m mAV V H v e V H+ += + =%
T⎡ ⎤1
,21 2[ , , , ]
T
TT m m T
m m m m i j ij
vv
V V v v v I v v δ
⎡ ⎤⎢ ⎥⎢ ⎥= = ∈ =⎢ ⎥⎢ ⎥
L QMTmv
⎢ ⎥⎢ ⎥⎣ ⎦
0T mV R
⎡ ⎤⎢ ⎥% M 0TV %1
0
T mm mV v R+
⎢ ⎥= ∈⎢ ⎥⎢ ⎥⎣ ⎦
M 1 0Tm mV v + =
1T T T
m m m mm m mmT
mV AV V V v HV H e+= + =%
1TV AV H=1m m mV AV H+
SNURPL36
Calculation of Matrix Exponential by Krylov Method2 1
0 0 0 0 Krylov subpace K { , , , , }mm r Ar A r A r−• = L
2Matrix Exponential Solution in Krylov Subspace
kA A•
mz1( ) kx t K +∈
2
0 0 1 0( ) ( ) ( , )2 !
kAt
kA Ax t e x I A x K A x
k += = + + + ∈L
Search an approximate solution in lower dimensional Krylov Subspace• x%
m
0x
0 0 0( , ),Atm me x x x z K A x m l≅ = + ∈ <%
02 10 0 0 1 10 Let K { , , , , } be spanned by othornormal bases, ,with m
m mx Ax A x xvA x m v v−• == L L
x
,1[ , , ] ( )m n
m mV v v m n− = ∈ <L
0 0 0 1 10
0{ , , , , } p y , ,m m x
1γ⎡ ⎤⎢ ⎥
A mV mV mH= +1mv +%
H
1 [ , , ]m m
m
x v v V yγ
⎢ ⎥− = =⎢ ⎥⎢ ⎥⎣ ⎦
% L M 0 ,At mme x V y y→ ≅ ∈
Least Square Solution for Overdetermined System•mH
[0, 0, ]β← L1mV +0
AtmV y e x=
0T T At
m m mV V y V e x=0
T Atmy V e x→ =
Tm m mT
m m m
V V IV AV H
==
SNURPL37
0m