Professional Documents
Culture Documents
Modified Patankar-Runge-Kutta Schemes For The Solution Be Positive
Modified Patankar-Runge-Kutta Schemes For The Solution Be Positive
Modified Patankar-Runge-Kutta Schemes For The Solution Be Positive
Institute of Mathematics
University of Kassel
Advection-Diffusion-Production-Destruction Systems
Pharmaceutical Applications
Summary
Many applications can be modeled by positive and
conservative production-destruction-systems
I Production-Destruction-System (PDS):
XN
yi0 (t) = pij (y(t)) − dij (y(t)), pij (y), dij (y) ≥ 0
j=1
y = (y1 , . . . , yN )T
I Positivity:
yi (t) > 0 for all t ≥ 0
I Conservation:
XN XN XN
pij (t) − dij (t) = 0 =⇒ yi (t) = yi (0)
i,j=1 i=1 i=1
Nonlinear model problem
12
y1
10 y2
y3
8
y30 = ay2 2
-2
0 5 10 15 20 25 30
t
p21 (y) = y1 y2 /(y1 + 1) = d12 (y), p32 (y) = ay2 = d23 (y)
Definition
Given an explicit RK scheme with nonnegative parameters, the
scheme
(k)
Xk−1 XN (ν) yj(k) (ν) yi
(k)
n
yi = yi + ∆t akν pij (k) − dij (k) ,
ν=1 j=1
πj πi
n+1 n+1
(k) yj
(k) yi
Xs XN
n+1 n
yi = yi + ∆t bk pij − dij
k=1 j=1 σj σi
M(k) y(k) = yn , k = 1, . . . , s,
Myn+1 = yn ,
with
(k)
Xk−1 XN (ν) (k)
mii = 1 + ∆t akν d /πi > 0,
ν=1 j=1 ij
(k)
Xk−1 (ν) (k)
mij = −∆t akν pij /πj ≤ 0, i 6= j,
ν=1
and
Xs XN (k)
mii = 1 + ∆t bk d /σi > 0,
k=1 j=1 ij
Xs (k)
mij = −∆t bk pij /σj ≤ 0, i 6= j.
k=1
MPRK schemes are unconditionally positive and
conservative
Lemma
An MPRK scheme applied to a conservative PDS is unconditionally
conservative.
Lemma
An MPRK scheme applied to a conservative PDS is unconditionally
positive. The same holds for all the stages of the scheme.
The MPRK22(α) schemes
Theorem
A two-stage MPRK scheme based on the RK scheme
0
1
α α , α≥
2
1 − 1/(2α) 1/(2α)
with
(2)
πi = yin , σi = (yin )1−1/α (yi )1/α ,
is second order accurate.
MPRK22(1)
(1)
yi = yin ,
(2)
XN (1) yjn+1 (1) yi
n+1
yi = yin+ ∆t pij − dij ,
j=1 yjn yin
n+1 n+1
(2) yj
∆t XN (1) (1) (2) yi
yin+1 n
= yi + pij + pij (2)
− dij + dij (2)
2 j=1
yj yi
0
I Based on Heun’s method 1 1
1/2 1/2
-2
0 5 10 15 20 25 30
t
The MPRK43 schemes
Theorem
The MPRK scheme based on an explicit three-stage third order
Runge-Kutta scheme with non-negative weights is of third order, if
we choose
(2) 1/p
!
(1) (2) y
πi = yin , πi = yin i
, p = 3a21 (a31 + a32 )b3 ,
yin
(2) 1/q
!
y
µi = yin i
, q = a21 ,
yin
XN σ
j
n
σi = yi + ∆t β1 pij (y(1) ) + β2 pij (y(2) )
j=1 µj
σ
(1) (2) i
− β1 dij (y ) + β2 dij (y ) .
µi
-2
0 5 10 15 20 25 30
t
The Robertson problem
I Initial values:
I Time interval:
10−6 ≤ t ≤ 1010
I Time stepping:
∆ti = 4i−1 10−6
I Stiff problem!
Approximations of the Robertson problem
MPE MPRK22(0.500)
1 1
y1 y1
10000 y 2
10000 y 2
0.8 0.8
y3 y3
Σ yi Σ yi
0.6 y 1 num 0.6 y 1 num
10000 y 2
num 10000 y 2
num
y 3 num y 3 num
0.4 Σ y i num 0.4 Σ y i num
0.2 0.2
0 0
10 -5 10 0 10 5 10 10 10 -5 10 0 10 5 10 10
t MPRK43I(1.000, 0.500) t
1
y1
10000 y 2
0.8
y3
Σ yi
0.6 y 1 num
10000 y 2
num
y 3 num
0.4 Σ y i num
0.2
0
10 -5 10 0 10 5 10 10
Advection-Diffusion-Production-Destruction Systems
∂ui ∂ui ∂ 2 ui XN
+ ai − di 2
= (pij (u) − dij (u)) , i = 1, . . . , N
∂t ∂x ∂x j=1
∆x 2
∆t = CFL min
i 2di + ai ∆x
I Reactions are “hard to solve”
I Aim: Integrate reactions with ∆t and capture the basic dynamics
NPZD Model
y1 y2
y10 = 0.01y2 + 0.01y3 + 0.003y4 − ,
0.01 + y1
y1 y2
y20 = − 0.01y2 − 0.5 1 − exp(1.21y22 ) y3 − 0.05y2 ,
0.01 + y1
0
y3 = 0.5 1 − exp(1.21y22 ) y3 − 0.01y3 − 0.02y3 ,
10
y1
6
y2
y
3
4 y4
0 1 2 3 4 5
t
∆x 2
∆t = 0.9 min = 0.8824
i 2di + ai ∆x
I Time step for reactions:
∆treaction = ∆t
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK22(1) at t = 8.82s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK22(1) at t = 17.65s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK22(1) at t = 26.47s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK22(1) at t = 35.29s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK22(1) at t = 44.12s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK22(1) at t = 50s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with SDIRK2 at t = 0s
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with SDIRK2 at t = 8.82s
0 12000 100
600
90
-2000
10000
80
500
-4000 70
8000
400
60
-6000
6000 50
300
-8000 40
4000
30 200
-10000
20
2000 100
10
-12000
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with SDIRK2 at t = 17.65s
× 10 7 × 10 7 × 10 6
0 15 8
10000
-2 7
9000
-4 8000 6
10 7000
-6 5
6000
-8 4
5000
-10 4000 3
5
3000
-12 2
2000
-14 1
1000
-16 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with SDIRK2 at t = 26.47s
× 10 11 × 10 11 × 10 5 × 10 9
0
12
3
2
-0.5 10
2.5
1.5 8
-1
2
6
1 1.5
-1.5
4
1
-2 0.5
0.5 2
-2.5 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with SDIRK2 at t = 35.29s
× 10 11 × 10 11 × 10 5 × 10 10
0 3
4.5
5
-1 4 2.5
3.5
4
-2 2
3
3 2.5
-3 1.5
2
2
-4 1.5 1
1
-5 1 0.5
0.5
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with SDIRK2 at t = 44.12s
× 10 11 × 10 11 × 10 5 × 10 10
0
6
4.5 3
-1
5 4
2.5
3.5
-2
4
3 2
-3
2.5
3
1.5
-4 2
2 1.5 1
-5
1
1 0.5
-6 0.5
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with SDIRK2 at t = 50s
× 10 11 × 10 11 × 10 5 × 10 10
0 12
6
6
-2 10
5
5
-4
8
4
4
-6
6
3 3
-8
4 2
2
-10
2 1 1
-12
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Approximations of the NPZD model with ∆t = 0.02
Heun MPRK22(1)
20 20
15 15
10 10
5 5
0 0
-5 -5
-10 -10
0 1 2 3 4 5 0 1 2 3 4 5
t
ROS2 t
SDIRK2
20 20
15 15
10 10
5 5
0 0
-5 -5
-10 -10
0 1 2 3 4 5 0 1 2 3 4 5
t t
Comparison with other Schemes
I Set ∆treaction to “largest” value, which avoids negative
approximations (execpt for MPRK22(1))
I Impact on efficiency:
I ode23s:
Abs
1 10−1 10−2 10−3 10−4
Rel
1 – – – – –
10−1 – – – –
10−2 – – –
10−3 17.75s 18.09s
10−4 18.52s
Comparison with adaptive time integrators
I ode15s without non-negativity feature:
Abs
1 10−1 10−2 10−3 10−4
Rel
1 – – – – –
10−1 – – – –
10−2 – 9.49s 9.79s
10−3 9.90s 10.18s
10−4 11.88s
Abs
1 10−1 10−2 10−3 10−4
Rel
1 11.29s 11.38s 11.6s 11.68s 11.6s
10−1 11.46s 11.68s 11.83s 14.84s
10−2 12.58s 12.50s 13.26s
10−3 12.86s 13.59s
10−4 14.44s
MPRK22(1) applied to the NPZD model with ∆t = 1
y1
10
y2
y3
8
y4
Σ yi
6
y 1 num
y 2 num
4 y 3 num
y 4 num
2 Σ y i num
0 10 20 30 40 50 60
t
MPRK43I(1,1/2) applied to the NPZD model with ∆t = 1
y1
10
y2
y3
8
y4
Σ yi
6
y 1 num
y 2 num
4 y 3 num
y 4 num
2 Σ y i num
0 10 20 30 40 50 60
t
Numerical Simulations with MPRK43I(1,1/2) at t = 0s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK43I(1,1/2) at t = 8.82s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK43I(1,1/2) at t = 17.65s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK43I(1,1/2) at t = 26.47s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK43I(1,1/2) at t = 35.29s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK43I(1,1/2) at t = 44.12s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Numerical Simulations with MPRK43I(1,1/2) at t = 50s
Nutrients Phytoplankton Zooplankton Detritus
10 10 10
10
9 9 9
9
8 8 8
8
7 7 7
7
6 6 6
6
5 5 5
5
4 4 4 4
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
Comparison with other Schemes
I Set ∆treaction to “largest” value, which avoids negative
approximations (execpt for MPRK schemes)
I Impact on efficiency:
u10 = d − a1 u1 + a1 u2 ,
u20 = a1 u1 − a1 u2 − a2 u2 (a3 − u3 ) − a4 u5 u2 + a5 u3 ,
u30 = a2 u2 (a3 − u3 ) − a5 u3 ,
u40 = a6 u3 − a7 u4 + a8 ,
u50 = a9 u4 − a10 u5
15 y num
2
20000000 y num
3
10 10000 y num
4
y 5 num
5
0
0 200 400 600 800 1000
t
Approximation of the rifampicin model with ∆t = 30
MPRK43I(1.000, 0.500)
35
30
25
20
15
10
0
0 0.5 1 1.5 2 2.5 3
t 4
×10
Approximation of the rifampicin model (adap. time step.)
MPRK43Iadap(1.000,0.500)
35
y1
30 y2
20000000 y
3
25 10000 y
4
y5
20
y 1 num
15 y num
2
20000000 y num
3
10 10000 y num
4
y 5 num
5
0
0 200 400 600 800 1000
t
Approximation of the rifampicin model (adap. time step.)
MPRK43Iadap(1.000,0.500)
35
30
25
20
15
10
0
0 0.5 1 1.5 2 2.5 3
t 4
×10
VEGF model
I Time interval:
0 ≤ t ≤ 31536000 (= 1 Year)
1.5
0.5
0
0 0.5 1 1.5 2 2.5 3
t ×10 7
Solution of the VEGF model
Reference solution
10 -2
10 -4
10 -6
10 -8
10 -10 y1
y2
-12
10
0 0.5 1 1.5 2 2.5 3
t ×10 7
Approximation of the VEGF model with ∆t=1 week
MPRK43I(1.000, 0.500)
10 -2
10 -4
10 -6
10 -8
y
1
y
2
10 -10 y 1 num
y num
2
-12
10
0 0.5 1 1.5 2 2.5 3
t ×10 7
Approximation of the VEGF model (adaptive time stepping)
MPRK43Iadap(1.000,0.500)
10 -2
10 -4
10 -6
10 -8
y
1
y2
10 -10 y 1 num
y 2 num
-12
10
0 0.5 1 1.5 2 2.5 3
t ×10 7
Approximation of the VEGF model (adaptive time stepping)
ODE45
10 -2
10 -4
10 -6
10 -8
y
1
y2
10 -10 y 1 num
y 2 num
-12
10
0 0.5 1 1.5 2 2.5 3
t ×10 7
Approximation of the VEGF model (adaptive time stepping)
ODE15s
10 -2
10 -4
10 -6
10 -8
y
1
y2
10 -10 y 1 num
y 2 num
-12
10
0 0.5 1 1.5 2 2.5 3
t ×10 7
Summary