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

Jump simulations are Float64 valued #3446

Open
TorkelE opened this issue Mar 7, 2025 · 0 comments · May be fixed by #3448
Open

Jump simulations are Float64 valued #3446

TorkelE opened this issue Mar 7, 2025 · 0 comments · May be fixed by #3448
Assignees
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Mar 7, 2025

When you run jump simulations the type of the values are now Float64 (even if initialised with Int64). These are integer-valued simulations, and should have integer values.

using ModelingToolkit, JumpProcesses

@parameters p d
@variables X(t)
rate1   = p
rate2   = X*d
affect1 = [X ~ X + 1]
affect2 = [X ~ X - 1]
j1 = ConstantRateJump(rate1, affect1)
j2 = ConstantRateJump(rate2, affect2)

# Works.
@mtkbuild js = JumpSystem([j1, j2], t, [X], [p,d])
dprob = DiscreteProblem(js, [X => 15], (0.0, 10.), [p => 2.0, d => 0.5])
jprob = JumpProblem(js, dprob, Direct())
sol = solve(jprob, SSAStepper())
sol[X] # Returns `Vector{Float64}`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants