3
3
f = (u,p,t) -> 1.01 u
4
4
σ = (u,p,t) -> 0.87 u
5
5
(ff:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W) = u0.* exp .(0.63155 t+ 0.87 W)
6
- """
6
+
7
+ doc"""
7
8
```math
8
9
du_t = βudt + αudW_t
9
10
```
32
33
end
33
34
end
34
35
(ff:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W) = u0.* exp .(0.63155 * t+ 0.87 * W)
35
- """
36
+ doc """
36
37
8 linear SDEs (as a 4x2 matrix):
37
38
38
39
```math
@@ -62,7 +63,7 @@ prob_sde_2Dlinear_stratonovich = SDEProblem(f,σ,ones(4,2)/2,(0.0,1.0))
62
63
f = (u,p,t) -> - .25 * u* (1 - u^ 2 )
63
64
σ = (u,p,t) -> .5 * (1 - u^ 2 )
64
65
(ff:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W) = ((1 + u0). * exp .(W)+ u0- 1 ). / ((1 + u0). * exp .(W)+ 1 - u0)
65
- """
66
+ doc """
66
67
```math
67
68
du_t = \\ frac{1}{4}u(1-u^2)dt + \\ frac{1}{2}(1-u^2)dW_t
68
69
```
@@ -78,7 +79,7 @@ prob_sde_cubic = SDEProblem(f,σ,1/2,(0.0,1.0))
78
79
f = (u,p,t) -> - 0.01 * sin .(u).* cos .(u).^ 3
79
80
σ = (u,p,t) -> 0.1 * cos .(u).^ 2
80
81
(ff:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W) = atan .(0.1 * W + tan .(u0))
81
- """
82
+ doc """
82
83
```math
83
84
du_t = -\\ frac{1}{100}\s in(u)\c os^3(u)dt + \\ frac{1}{10}\c os^{2}(u_t) dW_t
84
85
```
@@ -96,7 +97,7 @@ f = (u,p,t) -> p[2]./sqrt.(1+t) - u./(2*(1+t))
96
97
p = (0.1 ,0.05 )
97
98
(ff:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W) = u0./ sqrt .(1 + t) + p[2 ]* (t+ p[1 ]* W). / sqrt .(1 + t)
98
99
99
- """
100
+ doc """
100
101
Additive noise problem
101
102
102
103
```math
126
127
end
127
128
(ff:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W) = u0./ sqrt (1 + t) + sde_wave_βvec.* (t+ sde_wave_αvec.* W). / sqrt (1 + t)
128
129
129
- """
130
+ doc """
130
131
A multiple dimension extension of `additiveSDEExample`
131
132
132
133
"""
@@ -143,7 +144,7 @@ end σ ρ β
143
144
du[i] = 3.0 # Additive
144
145
end
145
146
end
146
- """
147
+ doc """
147
148
Lorenz Attractor with additive noise
148
149
149
150
```math
@@ -162,7 +163,7 @@ prob_sde_lorenz = SDEProblem(f,σ,ones(3),(0.0,10.0),(10.0,28.0,2.66))
162
163
f = (u,p,t) -> (1 / 3 )* u^ (1 / 3 ) + 6 * u^ (2 / 3 )
163
164
σ = (u,p,t) -> u^ (2 / 3 )
164
165
(ff:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W) = (2 t + 1 + W/ 3 )^ 3
165
- """
166
+ doc """
166
167
Runge–Kutta methods for numerical solution of stochastic differential equations
167
168
Tocino and Ardanuy
168
169
"""
@@ -316,8 +317,26 @@ function oval2ModelExample(;largeFluctuations=false,useBigs=false,noiseLevel=1)
316
317
SDEProblem (f,σ,u0,(0.0 ,500.0 ))
317
318
end
318
319
320
+ stiff_quad_f_ito (u,p,t) = - (p[1 ]+ (p[2 ]^ 2 )* u)* (1 - u^ 2 )
321
+ stiff_quad_f_strat (u,p,t) = - p[1 ]* (1 - u^ 2 )
322
+ stiff_quad_g (u,p,t) = p[2 ]* (1 - u^ 2 )
319
323
320
- """
324
+ function stiff_quad_f_ito (:: Type{Val{:analytic}} ,u0,p,t,W)
325
+ α = p[1 ]
326
+ β = p[2 ]
327
+ exp_tmp = exp (- 2 * α* t+ 2 * β* W)
328
+ tmp = 1 + u0
329
+ (tmp* exp_tmp + u0 - 1 )/ (tmp* exp_tmp - u0 + 1 )
330
+ end
331
+ function stiff_quad_f_strat (:: Type{Val{:analytic}} ,u0,p,t,W)
332
+ α = p[1 ]
333
+ β = p[2 ]
334
+ exp_tmp = exp (- 2 * α* t+ 2 * β* W)
335
+ tmp = 1 + u0
336
+ (tmp* exp_tmp + u0 - 1 )/ (tmp* exp_tmp - u0 + 1 )
337
+ end
338
+
339
+ doc"""
321
340
The composite Euler method for stiff stochastic
322
341
differential equations
323
342
@@ -334,31 +353,28 @@ Stiffness of Euler is determined by α+β²<1
334
353
Higher α or β is stiff, with α being deterministic stiffness and
335
354
β being noise stiffness (and grows by square).
336
355
"""
337
- function generate_stiff_quad (α,β;ito= true )
338
- if ito
339
- f = function (u,p,t)
340
- - (α+ (β^ 2 )* u)* (1 - u^ 2 )
341
- end
342
- else
343
- f = function (u,p,t)
344
- - α* (1 - u^ 2 )
345
- end
346
- end
356
+ prob_sde_stiffquadito = SDEProblem (stiff_quad_f_ito,stiff_quad_g,0.5 ,(0.0 ,3.0 ),(1.0 ,1.0 ))
347
357
348
- function g (u,p,t)
349
- β * ( 1 - u ^ 2 )
350
- end
358
+ doc"""
359
+ The composite Euler method for stiff stochastic
360
+ differential equations
351
361
352
- function (:: typeof (f))(:: Type{Val{:analytic}} ,u0,p,t,W)
353
- exp_tmp = exp (- 2 * α* t+ 2 * β* W)
354
- tmp = 1 + u0
355
- (tmp* exp_tmp + u0 - 1 )/ (tmp* exp_tmp - u0 + 1 )
356
- end
362
+ Kevin Burrage, Tianhai Tian
357
363
358
- SDEProblem (f,g,0.5 ,(0.0 ,3.0 ))
359
- end
364
+ And
365
+
366
+ S-ROCK: CHEBYSHEV METHODS FOR STIFF STOCHASTIC
367
+ DIFFERENTIAL EQUATIONS
360
368
369
+ ASSYR ABDULLE AND STEPHANE CIRILLI
370
+
371
+ Stiffness of Euler is determined by α+β²<1
372
+ Higher α or β is stiff, with α being deterministic stiffness and
373
+ β being noise stiffness (and grows by square).
361
374
"""
375
+ prob_sde_stiffquadstrat = SDEProblem (stiff_quad_f_strat,stiff_quad_g,0.5 ,(0.0 ,3.0 ),(1.0 ,1.0 ))
376
+
377
+ doc"""
362
378
Stochastic Heat Equation with scalar multiplicative noise
363
379
364
380
S-ROCK: CHEBYSHEV METHODS FOR STIFF STOCHASTIC
@@ -432,6 +448,7 @@ network = @reaction_network rnType begin
432
448
p10, SP2 --> 0
433
449
end p1 p2 p3 p4 p5 p6 p7 p8 p9 p10
434
450
p = (0.01 ,3.0 ,3.0 ,4.5 ,2. ,15. ,20.0 ,0.005 ,0.01 ,0.05 )
451
+
435
452
"""
436
453
An oscillatory chemical reaction system
437
454
"""
0 commit comments