Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use EnumX #583

Merged
merged 8 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Random = "1.6"
RandomNumbers = "1.5.3"
RecursiveArrayTools = "2, 3"
Reexport = "0.2, 1.0"
SciMLBase = "2.0.6"
SciMLBase = "2.51"
SciMLOperators = "0.2.9, 0.3"
SparseArrays = "1.6"
SparseDiffTools = "2"
Expand Down
1 change: 1 addition & 0 deletions src/StochasticDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ else
end

import SciMLBase
import EnumX
ChrisRackauckas marked this conversation as resolved.
Show resolved Hide resolved

using SparseDiffTools: forwarddiff_color_jacobian!, ForwardColorJacCache

Expand Down
18 changes: 9 additions & 9 deletions src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,22 @@ beta1_default(alg::Union{StochasticDiffEqAlgorithm,StochasticDiffEqRODEAlgorithm

isdtchangeable(alg::Union{StochasticDiffEqAlgorithm,StochasticDiffEqRODEAlgorithm}) = true

SciMLBase.alg_interpretation(alg::StochasticDiffEqAlgorithm) = :Ito
SciMLBase.alg_interpretation(alg::EulerHeun) = :Stratonovich
SciMLBase.alg_interpretation(alg::LambaEulerHeun) = :Stratonovich
SciMLBase.alg_interpretation(alg::KomBurSROCK2) = :Stratonovich
SciMLBase.alg_interpretation(alg::StochasticDiffEqAlgorithm) = SciMLBase.AlgorithmInterpretation.Ito
SciMLBase.alg_interpretation(alg::EulerHeun) = SciMLBase.AlgorithmInterpretation.Stratonovich
SciMLBase.alg_interpretation(alg::LambaEulerHeun) = SciMLBase.AlgorithmInterpretation.Stratonovich
SciMLBase.alg_interpretation(alg::KomBurSROCK2) = SciMLBase.AlgorithmInterpretation.Stratonovich
SciMLBase.alg_interpretation(alg::RKMil{interpretation}) where {interpretation} = interpretation
SciMLBase.alg_interpretation(alg::SROCK1{interpretation,E}) where {interpretation,E} = interpretation
SciMLBase.alg_interpretation(alg::RKMilCommute) = alg.interpretation
SciMLBase.alg_interpretation(alg::RKMilGeneral) = alg.interpretation
SciMLBase.alg_interpretation(alg::ImplicitRKMil{CS,AD,F,P,FDT,ST,CJ,N,T2,Controller,interpretation}) where {CS,AD,F,P,FDT,ST,CJ,N,T2,Controller,interpretation} = interpretation

SciMLBase.alg_interpretation(alg::RS1) = :Stratonovich
SciMLBase.alg_interpretation(alg::RS2) = :Stratonovich
SciMLBase.alg_interpretation(alg::RS1) = SciMLBase.AlgorithmInterpretation.Stratonovich
SciMLBase.alg_interpretation(alg::RS2) = SciMLBase.AlgorithmInterpretation.Stratonovich

SciMLBase.alg_interpretation(alg::NON) = :Stratonovich
SciMLBase.alg_interpretation(alg::COM) = :Stratonovich
SciMLBase.alg_interpretation(alg::NON2) = :Stratonovich
SciMLBase.alg_interpretation(alg::NON) = SciMLBase.AlgorithmInterpretation.Stratonovich
SciMLBase.alg_interpretation(alg::COM) = SciMLBase.AlgorithmInterpretation.Stratonovich
SciMLBase.alg_interpretation(alg::NON2) = SciMLBase.AlgorithmInterpretation.Stratonovich

alg_compatible(prob, alg::Union{StochasticDiffEqAlgorithm,StochasticDiffEqRODEAlgorithm}) = true
alg_compatible(prob, alg::StochasticDiffEqAlgorithm) = false
Expand Down
26 changes: 13 additions & 13 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,49 +77,49 @@ Springer. Berlin Heidelberg (2011)

RKMil: Nonstiff Method
An explicit Runge-Kutta discretization of the strong order 1.0 Milstein method.
Defaults to solving the Ito problem, but RKMil(interpretation=:Stratonovich) makes it solve the Stratonovich problem.
Defaults to solving the Ito problem, but RKMil(interpretation=SciMLBase.AlgorithmInterpretation.Stratonovich) makes it solve the Stratonovich problem.
Only handles scalar and diagonal noise.
"""
struct RKMil{interpretation} <: StochasticDiffEqAdaptiveAlgorithm end
RKMil(;interpretation=:Ito) = RKMil{interpretation}()
RKMil(;interpretation=SciMLBase.AlgorithmInterpretation.Ito) = RKMil{interpretation}()

"""
Kloeden, P.E., Platen, E., Numerical Solution of Stochastic Differential Equations.
Springer. Berlin Heidelberg (2011)

RKMilCommute: Nonstiff Method
An explicit Runge-Kutta discretization of the strong order 1.0 Milstein method for commutative noise problems.
Defaults to solving the Ito problem, but RKMilCommute(interpretation=:Stratonovich) makes it solve the Stratonovich problem.
Defaults to solving the Ito problem, but RKMilCommute(interpretation=SciMLBase.AlgorithmInterpretation.Stratonovich) makes it solve the Stratonovich problem.
Uses a 1.5/2.0 error estimate for adaptive time stepping.
Default: ii_approx=IICommutative() does not approximate the Levy area.
"""
struct RKMilCommute{T} <: StochasticDiffEqAdaptiveAlgorithm
interpretation::Symbol
interpretation::SciMLBase.AlgorithmInterpretation.T
ii_approx::T
end
RKMilCommute(;interpretation=:Ito, ii_approx=IICommutative()) = RKMilCommute(interpretation,ii_approx)
RKMilCommute(;interpretation=SciMLBase.AlgorithmInterpretation.Ito, ii_approx=IICommutative()) = RKMilCommute(interpretation,ii_approx)

"""
Kloeden, P.E., Platen, E., Numerical Solution of Stochastic Differential Equations.
Springer. Berlin Heidelberg (2011)

RKMilGeneral: Nonstiff Method
RKMilGeneral(;interpretation=:Ito, ii_approx=IILevyArea()
RKMilGeneral(;interpretation=SciMLBase.AlgorithmInterpretation.Ito, ii_approx=IILevyArea()
An explicit Runge-Kutta discretization of the strong order 1.0 Milstein method for general non-commutative noise problems.
Allows for a choice of interpretation between :Ito and :Stratonovich.
Allows for a choice of interpretation between SciMLBase.AlgorithmInterpretation.Ito and SciMLBase.AlgorithmInterpretation.Stratonovich.
Allows for a choice of iterated integral approximation.
Default: ii_approx=IILevyArea() uses LevyArea.jl to choose optimal algorithm. See
Kastner, F. and Rößler, A., arXiv: 2201.08424
Kastner, F. and Rößler, A., LevyArea.jl, 10.5281/ZENODO.5883748, https://github.com/stochastics-uni-luebeck/LevyArea.jl
"""
struct RKMilGeneral{T, TruncationType} <: StochasticDiffEqAdaptiveAlgorithm
interpretation::Symbol
interpretation::SciMLBase.AlgorithmInterpretation.T
ii_approx::T
c::Int
p::TruncationType
end

function RKMilGeneral(;interpretation=:Ito,ii_approx=IILevyArea(), c=1, p=nothing, dt=nothing)
function RKMilGeneral(;interpretation=SciMLBase.AlgorithmInterpretation.Ito,ii_approx=IILevyArea(), c=1, p=nothing, dt=nothing)
γ = 1//1
p==true && (p = Int(floor(c*dt^(1//1-2//1*γ)) + 1))
RKMilGeneral{typeof(ii_approx), typeof(p)}(interpretation, ii_approx, c, p)
Expand Down Expand Up @@ -160,13 +160,13 @@ struct WangLi3SMil_F <: StochasticDiffEqAlgorithm end
"""
SROCK1: S-ROCK Method
Is a fixed step size stabilized explicit method for stiff problems.
Defaults to solving th Ito problem but SROCK1(interpretation=:Stratonovich) can make it solve the Stratonovich problem.
Defaults to solving th Ito problem but SROCK1(interpretation=SciMLBase.AlgorithmInterpretation.Stratonovich) can make it solve the Stratonovich problem.
Strong order of convergence is 0.5 and weak order 1, but is optimised to get order 1 in case os scalar/diagonal noise.
"""
struct SROCK1{interpretation,E} <: StochasticDiffEqAlgorithm
eigen_est::E
end
SROCK1(;interpretation=:Ito,eigen_est=nothing) = SROCK1{interpretation,typeof(eigen_est)}(eigen_est)
SROCK1(;interpretation=SciMLBase.AlgorithmInterpretation.Ito,eigen_est=nothing) = SROCK1{interpretation,typeof(eigen_est)}(eigen_est)

# Weak Order 2
for Alg in [:SROCK2, :KomBurSROCK2, :SROCKC2]
Expand Down Expand Up @@ -701,7 +701,7 @@ ImplicitEulerHeun(;chunk_size=0,autodiff=true,diff_type=Val{:central},
ImplicitRKMil: Stiff Method
An order 1.0 drift-implicit method.
This is a theta method which defaults to theta=1 or the Trapezoid method on the drift term.
Defaults to solving the Ito problem, but ImplicitRKMil(interpretation=:Stratonovich) makes it solve the Stratonovich problem.
Defaults to solving the Ito problem, but ImplicitRKMil(interpretation=SciMLBase.AlgorithmInterpretation.Stratonovich) makes it solve the Stratonovich problem.
This method defaults to symplectic=false, but when true and theta=1/2 this is the implicit Midpoint method on the drift term and is symplectic in distribution.
Handles diagonal and scalar noise. Uses a 1.5/2.0 heuristic for adaptive time stepping.
"""
Expand All @@ -721,7 +721,7 @@ ImplicitRKMil(;chunk_size=0,autodiff=true,diff_type=Val{:central},
extrapolant=:constant,
theta = 1,symplectic = false,
new_jac_conv_bound = 1e-3,
controller = :Predictive,interpretation=:Ito) =
controller = :Predictive,interpretation=SciMLBase.AlgorithmInterpretation.Ito) =
ImplicitRKMil{chunk_size,autodiff,
typeof(linsolve),typeof(precs),diff_type,
OrdinaryDiffEq._unwrap_val(standardtag),
Expand Down
12 changes: 6 additions & 6 deletions src/perform_step/SROCK_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
cosh_inv = log(ω₀ + Sqrt_ω) # arcosh(ω₀)
ω₁ = (Sqrt_ω*cosh(mdeg*cosh_inv))/(mdeg*sinh(mdeg*cosh_inv))

if SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Stratonovich
α = cosh(mdeg*cosh_inv)/(2*ω₀*cosh((mdeg-1)*cosh_inv))
γ = 1/(2*α)
β = -γ
Expand Down Expand Up @@ -42,7 +42,7 @@
k = integrator.f(uᵢ₋₁,p,tᵢ₋₁)

u = dt*μ*k + ν*uᵢ₋₁ + κ*uᵢ₋₂
if (i > mdeg - 2) && SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich
if (i > mdeg - 2) && SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Stratonovich
if i == mdeg - 1
gₘ₋₂ = integrator.g(uᵢ₋₁,p,tᵢ₋₁)
if W.dW isa Number || !is_diagonal_noise(integrator.sol.prob)
Expand All @@ -58,7 +58,7 @@
u .+= (β .* gₘ₋₂ .+ γ .* gₘ₋₁) .* W.dW
end
end
elseif (i == mdeg) && SciMLBase.alg_interpretation(integrator.alg) == :Ito
elseif (i == mdeg) && SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
if W.dW isa Number
gₘ₋₂ = integrator.g(uᵢ₋₁,p,tᵢ₋₁)
uᵢ₋₂ = uᵢ₋₁ + sqrt(abs(dt))*gₘ₋₂
Expand Down Expand Up @@ -105,7 +105,7 @@ end
cosh_inv = log(ω₀ + Sqrt_ω) # arcosh(ω₀)
ω₁ = (Sqrt_ω*cosh(mdeg*cosh_inv))/(mdeg*sinh(mdeg*cosh_inv))

if SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Stratonovich
α = cosh(mdeg*cosh_inv)/(2*ω₀*cosh((mdeg-1)*cosh_inv))
γ = 1/(2*α)
β = -γ
Expand All @@ -132,7 +132,7 @@ end
κ = - Tᵢ₋₂/Tᵢ
integrator.f(k,uᵢ₋₁,p,tᵢ₋₁)
@.. u = dt*μ*k + ν*uᵢ₋₁ + κ*uᵢ₋₂
if (i > mdeg - 2) && SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich
if (i > mdeg - 2) && SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Stratonovich
if i == mdeg - 1
integrator.g(gₘ₋₂,uᵢ₋₁,p,tᵢ₋₁)
if W.dW isa Number || is_diagonal_noise(integrator.sol.prob)
Expand All @@ -152,7 +152,7 @@ end
@.. u += γ*k
end
end
elseif (i == mdeg) && SciMLBase.alg_interpretation(integrator.alg) == :Ito
elseif (i == mdeg) && SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
if W.dW isa Number || is_diagonal_noise(integrator.sol.prob)
integrator.g(gₘ₋₂,uᵢ₋₁,p,tᵢ₋₁)
@.. uᵢ₋₂ = uᵢ₋₁ + sqrt(abs(dt))*gₘ₋₂
Expand Down
28 changes: 14 additions & 14 deletions src/perform_step/low_order.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,16 @@ end
K = @.. uprev + dt * du1
L = integrator.g(uprev,p,t)
mil_correction = zero(u)
if SciMLBase.alg_interpretation(integrator.alg) == :Ito
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
utilde = K + L*integrator.sqdt
ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt)
mil_correction = ggprime.*(W.dW.^2 .- abs(dt))./2
elseif SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich
elseif SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Stratonovich
utilde = uprev + L*integrator.sqdt
ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt)
mil_correction = ggprime.*(W.dW.^2)./2
else
error("Alg interpretation invalid. Use either :Ito or :Stratonovich")
error("Algorithm interpretation invalid. Use either SciMLBase.AlgorithmInterpretation.Ito or SciMLBase.AlgorithmInterpretation.Stratonovich")
end
u = K+L.*W.dW+mil_correction

Expand All @@ -241,16 +241,16 @@ end
integrator.g(L,uprev,p,t)
@.. K = uprev + dt * du1
@.. du2 = zero(eltype(u)) # This makes it safe to re-use the array
if SciMLBase.alg_interpretation(integrator.alg) == :Ito
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
@.. tmp = K + integrator.sqdt * L
integrator.g(du2,tmp,p,t)
@.. tmp = (du2-L)/(2integrator.sqdt)*(W.dW.^2 - abs(dt))
elseif SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich
elseif SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Stratonovich
@.. tmp = uprev + integrator.sqdt * L
integrator.g(du2,tmp,p,t)
@.. tmp = (du2-L)/(2integrator.sqdt)*(W.dW.^2)
else
error("Alg interpretation invalid. Use either :Ito or :Stratonovich")
error("Algorithm interpretation invalid. Use either SciMLBase.AlgorithmInterpretation.Ito or SciMLBase.AlgorithmInterpretation.Stratonovich")
end
@.. u = K+L*W.dW + tmp
if integrator.opts.adaptive
Expand All @@ -275,7 +275,7 @@ end
J = get_iterated_I(dt, dW, W.dZ, Jalg)

mil_correction = zero(u)
if SciMLBase.alg_interpretation(integrator.alg) == :Ito
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
if dW isa Number || is_diagonal_noise(integrator.sol.prob)
J = J .- 1//2 .* abs(dt)
else
Expand All @@ -289,7 +289,7 @@ end
K = uprev + dt*du1

if is_diagonal_noise(integrator.sol.prob)
tmp = (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L
tmp = (SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito ? K : uprev) .+ integrator.sqdt .* L
gtmp = integrator.g(tmp,p,t)
Dgj = (gtmp - L)/sqdt
ggprime_norm = integrator.opts.internalnorm(Dgj,t)
Expand Down Expand Up @@ -343,7 +343,7 @@ end
J = Jalg.J

@.. mil_correction = zero(u)
if SciMLBase.alg_interpretation(integrator.alg) == :Ito
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
if dW isa Number || is_diagonal_noise(integrator.sol.prob)
@.. J -= 1 // 2 * abs(dt)
else
Expand All @@ -357,7 +357,7 @@ end
@.. K = uprev + dt*du1

if is_diagonal_noise(integrator.sol.prob)
tmp .= (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L
tmp .= (SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito ? K : uprev) .+ integrator.sqdt .* L
integrator.g(gtmp,tmp,p,t)
@.. Dgj = (gtmp - L)/sqdt
ggprime_norm = integrator.opts.internalnorm(Dgj,t)
Expand Down Expand Up @@ -397,7 +397,7 @@ end

J = get_iterated_I(dt, dW, W.dZ, Jalg, integrator.alg.p, integrator.alg.c, alg_order(integrator.alg))

if SciMLBase.alg_interpretation(integrator.alg) == :Ito
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
if dW isa Number || is_diagonal_noise(integrator.sol.prob)
J = J .- 1//2 .* abs(dt)
else
Expand All @@ -413,7 +413,7 @@ end

if dW isa Number || is_diagonal_noise(integrator.sol.prob)
K = @.. uprev + dt*du₁
utilde = (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) + L*integrator.sqdt
utilde = (SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito ? K : uprev) + L*integrator.sqdt
ggprime = (integrator.g(utilde,p,t) .- L) ./ (integrator.sqdt)
mil_correction = ggprime .* J
u = K + L .* dW + mil_correction
Expand Down Expand Up @@ -467,7 +467,7 @@ end
@.. mil_correction = zero(eltype(u))
ggprime_norm = zero(eltype(ggprime))

if SciMLBase.alg_interpretation(integrator.alg) == :Ito
if SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito
if dW isa Number || is_diagonal_noise(integrator.sol.prob)
@.. J -= 1 // 2 * abs(dt)
else
Expand All @@ -478,7 +478,7 @@ end
if dW isa Number || is_diagonal_noise(integrator.sol.prob)
@.. K = uprev + dt*du₁
@.. du₂ = zero(eltype(u))
tmp .= (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L
tmp .= (SciMLBase.alg_interpretation(integrator.alg) == SciMLBase.AlgorithmInterpretation.Ito ? K : uprev) .+ integrator.sqdt .* L
integrator.g(du₂,tmp,p,t)
@.. ggprime = (du₂ - L)/sqdt
ggprime_norm = integrator.opts.internalnorm(ggprime,t)
Expand Down
12 changes: 6 additions & 6 deletions src/perform_step/sdirk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
end

if cache isa ImplicitRKMilConstantCache || integrator.opts.adaptive == true
if SciMLBase.alg_interpretation(alg) == :Ito ||
if SciMLBase.alg_interpretation(alg) == SciMLBase.AlgorithmInterpretation.Ito ||
cache isa ImplicitEMConstantCache
K = @.. uprev + dt * ftmp
utilde = K + L*integrator.sqdt
ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt)
mil_correction = ggprime .* (integrator.W.dW.^2 .- abs(dt))./2
gtmp += mil_correction
elseif SciMLBase.alg_interpretation(alg) == :Stratonovich ||
elseif SciMLBase.alg_interpretation(alg) == SciMLBase.AlgorithmInterpretation.Stratonovich ||
cache isa ImplicitEulerHeunConstantCache
utilde = uprev + L*integrator.sqdt
ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt)
mil_correction = ggprime.*(integrator.W.dW.^2)./2
gtmp += mil_correction
else
error("Alg interpretation invalid. Use either :Ito or :Stratonovich")
error("Algorithm interpretation invalid. Use either SciMLBase.AlgorithmInterpretation.Ito or SciMLBase.AlgorithmInterpretation.Stratonovich")
end
end

Expand Down Expand Up @@ -154,18 +154,18 @@ end

if cache isa ImplicitRKMilCache
gtmp3 = cache.gtmp3
if SciMLBase.alg_interpretation(alg) == :Ito
if SciMLBase.alg_interpretation(alg) == SciMLBase.AlgorithmInterpretation.Ito
@.. z = uprev + dt * tmp + integrator.sqdt * gtmp
integrator.g(gtmp3,z,p,t)
@.. gtmp3 = (gtmp3-gtmp)/(integrator.sqdt) # ggprime approximation
@.. gtmp2 += gtmp3*(dW.^2 - abs(dt))/2
elseif SciMLBase.alg_interpretation(alg) == :Stratonovich
elseif SciMLBase.alg_interpretation(alg) == SciMLBase.AlgorithmInterpretation.Stratonovich
@.. z = uprev + integrator.sqdt * gtmp
integrator.g(gtmp3,z,p,t)
@.. gtmp3 = (gtmp3-gtmp)/(integrator.sqdt) # ggprime approximation
@.. gtmp2 += gtmp3*(dW.^2)/2
else
error("Alg interpretation invalid. Use either :Ito or :Stratonovich")
error("Algorithm interpretation invalid. Use either SciMLBase.AlgorithmInterpretation.Ito or SciMLBase.AlgorithmInterpretation.Stratonovich")
end
end

Expand Down
Loading
Loading