Skip to content

Commit 0930b72

Browse files
update to v0.15.0
1 parent 9bd45a5 commit 0930b72

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

src/DiffEqProblemLibrary.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export prob_ode_linear, prob_ode_bigfloatlinear, prob_ode_2Dlinear,
2020
export prob_sde_wave, prob_sde_linear, prob_sde_cubic, prob_sde_2Dlinear, prob_sde_lorenz,
2121
prob_sde_2Dlinear, prob_sde_additive, prob_sde_additivesystem, oval2ModelExample
2222

23+
#SDE Stratonovich Example Problems
24+
export prob_sde_linear_stratonovich, prob_sde_2Dlinear_stratonovich
25+
2326
#DAE Example Problems
2427
export prob_dae_resrob
2528

src/sde_premade_problems.jl

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### SDE Examples
22

3-
f = (t,u) -> 1.01*u
4-
σ = (t,u) -> 0.87*u
5-
(p::typeof(f))(::Type{Val{:analytic}},t,u0,W) = u0.*exp.(0.63155*t+0.87*W)
3+
f = (t,u) -> 1.01u
4+
σ = (t,u) -> 0.87u
5+
(p::typeof(f))(::Type{Val{:analytic}},t,u0,W) = u0.*exp.(0.63155t+0.87W)
66
"""
77
```math
88
du_t = βudt + αudW_t
@@ -16,6 +16,11 @@ u(t,u0,W_t)=u0\\exp((α-\\frac{β^2}{2})t+βW_t)
1616
"""
1717
prob_sde_linear = SDEProblem(f,σ,1/2,(0.0,1.0))
1818

19+
f = (t,u) -> 1.01u
20+
σ = (t,u) -> 0.87u
21+
(p::typeof(f))(::Type{Val{:analytic}},t,u0,W) = u0.*exp.(1.01t+0.87W)
22+
prob_sde_linear_stratonovich = SDEProblem(f,σ,1/2,(0.0,1.0))
23+
1924
f = (t,u,du) -> begin
2025
for i = 1:length(u)
2126
du[i] = 1.01*u[i]
@@ -41,6 +46,18 @@ u(t,u0,W_t)=u0\\exp((α-\\frac{β^2}{2})t+βW_t)
4146
"""
4247
prob_sde_2Dlinear = SDEProblem(f,σ,ones(4,2)/2,(0.0,1.0))
4348

49+
f = (t,u,du) -> begin
50+
for i = 1:length(u)
51+
du[i] = 1.01*u[i]
52+
end
53+
end
54+
σ = (t,u,du) -> begin
55+
for i in 1:length(u)
56+
du[i] = .87*u[i]
57+
end
58+
end
59+
(p::typeof(f))(::Type{Val{:analytic}},t,u0,W) = u0.*exp.(1.01*t+0.87*W)
60+
prob_sde_2Dlinear_stratonovich = SDEProblem(f,σ,ones(4,2)/2,(0.0,1.0))
4461

4562
f = (t,u) -> -.25*u*(1-u^2)
4663
σ = (t,u) -> .5*(1-u^2)
@@ -142,6 +159,16 @@ with ``σ=10``, ``ρ=28``, ``β=8/3``, ``α=3.0`` and inital condition ``u0=[1;1
142159
"""
143160
prob_sde_lorenz = SDEProblem(f,σ,ones(3),(0.0,10.0))
144161

162+
163+
f = (t,u) -> (1/3)*u^(1/3) + 6*u^(2/3)
164+
σ = (t,u) -> u^(2/3)
165+
(p::typeof(f))(::Type{Val{:analytic}},t,u0,W) = (2t + 1 + W/3)^3
166+
"""
167+
Runge–Kutta methods for numerical solution of stochastic differential equations
168+
Tocino and Ardanuy
169+
"""
170+
prob_sde_nltest = SDEProblem(f,σ,1.0,(0.0,10.0))
171+
145172
function oval2ModelExample(;largeFluctuations=false,useBigs=false,noiseLevel=1)
146173
#Parameters
147174
J1_200=3.

0 commit comments

Comments
 (0)