-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
SavingCallback used together with event handling callbacks #30
Comments
Right now it's before the affect! of a |
Then a simple workaround is to place |
Yeah, you can add that to the |
I have the following code to use
|
And the output
|
Yeah, this will be a difficult issue to solve. The DiscreteCallbacks are done after the continuous callbacks which would be required for correctness in a lot of cases where they modify the value. However, in your case you'd want the |
Interesting... Rewriting
|
Yes, you need to do the saveat before application of other parts. That's the difficulty in solving this generally. |
Back to this issue.
However with some ODE problems I have encountered wrong results applying this approch. Here is MWE with |
Well, I am still thinking of a good way to handle
There is a number of problems with this approach :
And here is a MWE from SBML cases (sorry, not really "Minimal"):
The output is:
The sequence of solution timepoints is wrong because integration intervals
This seems to solve my issue. The sequence of saved timepoints is now correct:
But... this doesn't work with |
Event handling callbacks (
DiscreteCallback
,ContinuousCallback
) allow us to saveu
before and after theaffect!
withsave_positions=(true,true)
. It would be a nice option forSavingCallback
to save values before and after theaffect!
of event handling callback when those callbacks are used together in aCallbackSet
.The text was updated successfully, but these errors were encountered: