Tiny fix of Coevolve() with the dependency graph check#282
Merged
isaacsas merged 3 commits intoSciML:masterfrom Jan 5, 2023
Merged
Tiny fix of Coevolve() with the dependency graph check#282isaacsas merged 3 commits intoSciML:masterfrom
Coevolve() with the dependency graph check#282isaacsas merged 3 commits intoSciML:masterfrom
Conversation
this pull request is related to SciML#276 (comment)
Member
|
Can you add a test which catches this? I guess it should be a case with mixed jumps? |
Contributor
Author
|
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 numberSo at the end, one still needs to provide a correct dependency graph. |
Member
|
Can you add that MWE as a test? |
Member
|
Use Catalyst to generate the problem so it has the dependency graph? Or use one of the hand-built ones and extend it? |
Member
|
I just added a test for this based on the MWE. |
Member
|
Thanks @palmtree2013 |
Contributor
Author
|
Thank you for adding the test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this pull request is related to #276 (comment)