When attempting to simulate a model with an algebraic equation declared on top of the equation list (i.e., before the differential equations), and this equation contains a square root of a state variable whose initial value is zero, the simulation aborts immediately and the error displayed is Floating point exception.
The file attached below contains a minimal model that exhibits this behavior.
Notes:
-- The floating point exception in this model happens when symbolic differentiation is used, given that in this case the first and second derivatives (if using QSS3 for example) are not defined for x = 0, if we use a numeric aproximation of the derivatives the initial value can be esatimated (but itis not correct) which is the case of DOPRI, DASSL, and also the QSS methods with the Symbolic Diff flag off and the simulaiton works but the problem is still present, we have to change the initial values.
-- We remove the restriction that requires that the algebraic variables where defined before they can be used in the definition of state derivatives, given that is was a restriction we used during the development stage and it is not needed anymore. The fact that the simulation worked when the order of the algebraic variables definition was changed was just a coincidence.
This changes are commited in Rev. 1526
Diff: