Skip to content

Commit

Permalink
Merge pull request #767 from SciML/myb/mm
Browse files Browse the repository at this point in the history
Mass matrix handling for SDEs
  • Loading branch information
ChrisRackauckas authored Jul 5, 2021
2 parents ea2cd75 + 6a50544 commit 677ecb7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/sde_default_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,29 @@ function default_algorithm(prob::DiffEqBase.AbstractSDEProblem{uType,tType,isinp
alg = RKMilCommute()
end

if :stiff alg_hints
is_stiff = :stiff alg_hints
is_stratonovich = :stratonovich alg_hints
if is_stiff || prob.f.mass_matrix !== I
alg = ImplicitRKMil(autodiff=false)
end

if :stratonovich alg_hints
if :stiff alg_hints
if is_stratonovich
if is_stiff || prob.f.mass_matrix !== I
alg = ImplicitRKMil(autodiff=false,interpretation=:stratonovich)
else
alg = RKMil(interpretation=:stratonovich)
end
end

if prob.noise_rate_prototype != nothing || prob.noise != nothing
if :stratonovich alg_hints
if :stiff alg_hints
if is_stratonovich
if is_stiff || prob.f.mass_matrix !== I
alg = ImplicitEulerHeun(autodiff=false)
else
alg = LambaEulerHeun()
end
else
if :stiff alg_hints
if is_stiff || prob.f.mass_matrix !== I
alg = ISSEM(autodiff=false)
else
alg = LambaEM()
Expand All @@ -38,7 +40,7 @@ function default_algorithm(prob::DiffEqBase.AbstractSDEProblem{uType,tType,isinp
end

if :additive alg_hints
if :stiff alg_hints
if is_stiff || prob.f.mass_matrix !== I
alg = SKenCarp(autodiff=false)
else
alg = SOSRA()
Expand Down

0 comments on commit 677ecb7

Please sign in to comment.