DAEs and initialization

I need to use DAE formulation of models, and wonder about the initialization… From the documentation:

Question: Does this imply that those differential_vars which are differential, are assumed to have correct initial values, and that only the non-differential variables will be adjusted in the initialization phase? In other words, that those marked as differential variables will keep their initial values after the initialization phase, and that the non-differential variables may be adjusted?

The reason why I ask is that I need to know whether I can specify initial states, and know that these are not changed.

There is an added problem to this, of course: for DAEs, the state is not necessarily the same as the differential variable. The state is the vector of freely selectable variables which specifies the solution, and this is not necessarily the same as the differential variables in a model… If the model has more differential variables than the number of states, or fewer differential variables than the number of states, how do I handle that case?

From the docs:

See the Sundials manual for details on the additional options. The option init_all controls the initial condition consistancy routine. If the initial conditions are inconsistant (i.e. they do not satisfy the implicit equation), init_all=false means that the algebraic variables and derivatives will be modified in order to satisfy the DAE. If init_all=true , all initial conditions will be modified to satify the DAE.

So with IDA it’s an algorithm-specific option. As we get OrdinaryDiffEq with a bunch of initialization as well, we should probably make a change to specifying that option in the problem constructor. Please open an issue in DifferentialEquations.jl and ping @kanav99 on it.