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

SSAStepper() drops the diffusive part (and it works fine without it). #258

Closed
pooyaravari opened this issue Aug 1, 2019 · 1 comment
Closed

Comments

@pooyaravari
Copy link

pooyaravari commented Aug 1, 2019

It seems that in SSAStepper() interferes with stochastic part of SDE. I've tried it for one, two, and many jumps. For instance if run this code:

using DifferentialEquations ,  StochasticDiffEq, DiffEqJump, Plots
function f(du,u,p,t)
    du[1] = u[1]
end
function g(du,u,p,t)
    du[1] = u[1]
end
prob = SDEProblem(f,g,[0.2],(0.0,10.0))



rate(u,p,t) = 2
affect!(integrator) = (integrator.u[1] = integrator.u[1]/2)
jump = ConstantRateJump(rate,affect!)

jump_prob = JumpProblem(prob,Direct(),jump )
sol_o = solve(jump_prob)#,SSAStepper())#SRIW1())
p1 = plot(sol_o, label = "Default()", title= "Two identical constant rate jumps")

sol_ssas = solve(jump_prob, SSAStepper())#,SSAStepper())#SRIW1())
p2 = plot(sol_ssas, label = "SSAStepper()")


sol_sriw1 = solve(jump_prob, SRIW1())#,SSAStepper())#SRIW1())
p3 = plot(sol_sriw1, label = "SRIW1()")


sol_without_jump_o = solve(prob)#,SSAStepper())#SRIW1())
p4 = plot(sol_without_jump_o,  label = "without jump")

plot(p1, p2, p3, p4, layout = (2, 2), legend = true )

2

@ChrisRackauckas
Copy link
Member

Yes, SSAStepper is for jump-only problems. I added an error message for this case:

SciML/JumpProcesses.jl#74

and made the docs more clear

a31fe95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants