-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
Add new option to DAE solvers to never initialize DAE #549
Comments
Indeed I agree this option is necessary. |
We will also want it accessible in callbacks so after modifying values you can tell it whether or not to re-run initialization. |
I could not figure out what to do (with DifferentialEquations v6.15.0). I tried to call
before running a simulation and then get the message
It seems that Since you closed this issue, it seems to be solved. Can you give more explanations what to do to switch off automatic initialization for DAE problems |
Oh, forgot to add it to the docs: https://github.com/SciML/DiffEqDocs.jl/blob/master/docs/src/solvers/dae_solve.md#full-list-of-methodsid-dae_solve_full .
It is. https://github.com/SciML/Sundials.jl/blob/master/src/common_interface/integrator_utils.jl#L113-L115 What version of Sundials are you using? |
Now that (We still need to unify Sundials with the new initialization setup, but for now it's 🤷 ) |
Still do not manage. I tried:
and get then the error
I also tried to call
and get then the error:
I use the newest versions:
|
It wasn't exported, so I just added a patch that fixes that: SciML/OrdinaryDiffEq.jl@2b3770c Should be registered in about an hour or so. |
I use:
for DifferentialEquations.IDA() solver. This works for a standard DAE. However, if an event is triggered with conditions!/affect! functions, an error is triggered when the affect! function is left:
It seems NoInit() is not yet fully implemented for IDA? When supplying the differential_vars argument to DAEproblem, the event is correctly processed (but probably IDA is running its initialization code - which should be switched off). |
Yes it's on OrdinaryDiffEq. This is an issue for Sundials.jl then. SciML/Sundials.jl#285 |
Please, add a new option to the DAE solvers, so that initialization is never performed by the DAE solver.
Note, the IDA DAE solver uses the following code in Sundials/src/common_interface/solve.jl:
This means that
solve
first calls the user-suppled functionf! = prob.f
and then checks whether the absolute values of the returned residualsrtest
are small enough. If this is not the case, the IDA initialization IDACalcIC is called. The problem is that this function may easily fail, even if the IDA integrator will integrate the model with the providedu0, du0
. Explanation:Initialization of DAEs is difficult. Good initializers use model information that is not available to a general DAE solver. For example assume that the DAE is initialized in steady state (so
du=0
) with a homotopy method (because good start values are not available foru0
; this is, for example, standard for electric circuit simulators). Good non-linear solvers will not use the absolute values of the residuals as termination conditions, because this is not scale invariant (multiplying a residual equation with any number, will not change the exact mathematical solution). Therefore, it is easily possible that the solver testany(abs.(rtest) .>= reltol)
fails, even if initialization is fine and the DAE integrator will integrate the model with theu0, du0
computed by an external initializer.The text was updated successfully, but these errors were encountered: