-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Example for CLE where paths go negative #661
Comments
We need to document that we currently wrap in absolute values, and perhaps provide an option to not do this? |
Currently, things can go negative: using Catalyst, StochasticDiffEq, Plots
rn = @reaction_network begin
(p,1.0), 0 <--> X
end
sprob = SDEProblem(rn, [1.0], (0.0, 10.0), [1.0])
sol = solve(sprob, ImplicitEM())
plot(sol) However, the
|
That's unrelated to positive domain callback, it's from an older version of Julia where chkfinite wasn't disabled by check=false. But also no, this is not a problem where PositiveDomain callback makes sense. The first requirement of using a domain callback is that the domain constraint has to be satisfied by the solution. The whole purpose of this issue is that the CLE does not always emit a solution that is positive, so the callback is not a solution. IIRC Catalyst always does |
I guess we could implement a reflection callback, as that is an approach that has been used, but then the model one is simulating is no longer the CLE. |
(So I don't think it really makes sense to push such an approach.) |
Would it be possible to make the default having nothing, but having a sqrt with a modified error message that explains what is going on and suggests a couple of ways to deal with it (while admitting that these will produce a non-true CLE)? And then we could provide |
I don't think we'd want to wrap Julia's sqrt for performance reasons. |
suspected so. Let's just keep it as it is and add options for alternative ways of dealing (or not dealing) with it |
Explain about using absolute values of rates, but that this doesn't guarantee the solution stays positive.
The text was updated successfully, but these errors were encountered: