-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
FunctionCallingCallback not correctly synchronized with events #126
Comments
This above result was generated with DifferentialEquations.jl version v6.15.0. |
Unfortunately, the issue is worse than expected: It does not matter whether results are stored at an event point (I thought this is a work-around): The FunctionCallingCallback is still called for time instants before the event, but using the state information returned from affect!(..). This means that the result storage of saveat points before the event is completely wrong. |
Any progress here? I have the following (bad) work-around: I have now an application where my current work-around is not working: I am using IDA() to avoid solving large equation systems in the model. Before calling outputs!(..), I need to compute the derivatives by interpolation in the integrator ( # Error message:
[IDAS ERROR] IDAGetDky
Illegal value for t. t = 0.2 is not between tcur - hu = 0.67939 and tcur = 0.77939. # event is at 0.75
┌ Warning: IDAGetDky failed with error code =
│ flag = -26
└ @ Sundials ...\packages\Sundials\k9hc3\src\simple.jl:20 and I need it for previous steps since outputs!(..) is called for previous steps. It seems my only option is currently to call IDA(..) directly (with all the logic for event handling and communication points), and not using DifferentialEquations. |
The FunctionCallingCallback seems to be not correctly synchronized with events as shown with the following test model:
This results in the following output:
This means the affect-function is called at time = 0.45, but the FunctionCallingCallback for time = 0.2, 0.3, 0.4 is called after the affect-function is called at time = 0.45.
The text was updated successfully, but these errors were encountered: