Version 0.5.0
-
Version is not backwards compatible:
- The values of
@enum structureOfDAE
have changed. ModiaMath.SimulationState
: Keyword argumentstructureOfDAE
has defaultDAE_LinearDerivativesAndConstraints
instead ofDAE_NoSpecialStructure
. The consequence is that by default it is assumed that the DAE depends linearly on the derivatives (this should probably always be the case, so this should be uncritical). However, the constraint equations (fc) must be now precisely identified via the new keyword argumentis_constraint
.ModiaMath.SimulationState
: Keyword argumentnc
has no effect anymore (is ignored). Instead with new keyword argumentis_constraint
it is defined which residue element is a constraint (fc) equation. At an event instant, the value ofis_constraint
can change. This allows to model varying index systems (with Dirac impulses).
- The values of
-
ModiaMath.SimulationState
: New keyword argumenthas_constraintDerivatives
. Iftrue
, the derivatives of the constraint equations (der(fc)
) must be returned in the model residue, ifModiaMath.compute_der_fc = true
. During initialization/reinitialization the Jacobian that is used to computeder(x)
is then no longer computed with finite differences but by usingder(fc)
which gives a more reliable numerical solution. -
New function
ModiaMath.get_is_constraint
to get a reference to theis_constraint
vector. -
New function
ModiaMath.compute_der_fc
to inquire in a model whether the constraint equations (fc) or its derivatives (der(fc)) shall be computed, ifhas_constraintDerivative
was defined to betrue
. This feature is demonstrated in modelexamples/withoutMacros_withoutVariables/models/PendulumDAE.jl
. -
New example
examples/withoutMacros_withoutVariables/Simulate_IdealClutch.jl
to simulate an electrical circuit driving an inertia that is connected with an ideal clutch to a second inertia. It is demonstrated how the index can change during simulation and how Dirac impulses are handled during initialization and at events. -
Adapted tolerance of nonlinear solver so that it is identical to integrator tolerance (to avoid failed initialization for integrator tolerances smaller as 1e-6).
-
Bugs in event iteration corrected:
- Number of event iterations is limited (more as 20 iterations triggers an error), to avoid infinite looping.
- Also at a time-event, re-initialization is performed to compute consistent
x, der(x)
variables.
-
Documentation
docs/src/man/Overview.md
considerably improved. Now reflecting the current status of ModiaMath. -
In some examples corrected packages to import packages via ModiaMath.
-
Using newest versions of all used packages.