-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Tiny fix of Coevolve()
with the dependency graph check
#282
Conversation
this pull request is related to SciML#276 (comment)
Can you add a test which catches this? I guess it should be a case with mixed jumps? |
Here is a MWE using JumpProcesses
maj_rate = [1.]
react_stoich_ = [Vector{Pair{Int, Int}}()]
net_stoich_ = [[1 => 1]]
mass_action_jump_ = MassActionJump(maj_rate, react_stoich_, net_stoich_; scale_rates=false)
affect! = function (integrator)
integrator.u[1] -= 1
end
cs_rate1(u,p,t) = 0.2 * u[1]
constant_rate_jump = ConstantRateJump(cs_rate1, affect!)
jumpset_ = JumpSet((), (constant_rate_jump,), nothing, mass_action_jump_)
u0 = [0]
tspan = (0.0, 30.0)
prob_ = DiscreteProblem(u0, tspan)
alg = Coevolve()
jprob_ = JumpProblem(dprob_, alg, jumpset_, save_positions=(false, false)) where the
But instead, the dependency graph is generated by
But Coevolve() will still show error because the length of dependency graph does not fit the total reaction number
So at the end, one still needs to provide a correct dependency graph. |
Can you add that MWE as a test? |
Use Catalyst to generate the problem so it has the dependency graph? Or use one of the hand-built ones and extend it? |
I just added a test for this based on the MWE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GTG if tests pass I think.
Thanks @palmtree2013 |
Thank you for adding the test |
this pull request is related to #276 (comment)