Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Version 0.5.0

Compare
Choose a tag to compare
@MartinOtter MartinOtter released this 04 Apr 19:54
· 26 commits to master since this release
ab4862a
  • Version is not backwards compatible:

    • The values of @enum structureOfDAE have changed.
    • ModiaMath.SimulationState: Keyword argument structureOfDAE has default DAE_LinearDerivativesAndConstraints instead of DAE_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 argument is_constraint.
    • ModiaMath.SimulationState: Keyword argument nc has no effect anymore (is ignored). Instead with new keyword argument is_constraint it is defined which residue element is a constraint (fc) equation. At an event instant, the value of is_constraint can change. This allows to model varying index systems (with Dirac impulses).
  • ModiaMath.SimulationState: New keyword argument has_constraintDerivatives. If true, the derivatives of the constraint equations (der(fc)) must be returned in the model residue, if ModiaMath.compute_der_fc = true. During initialization/reinitialization the Jacobian that is used to compute der(x) is then no longer computed with finite differences but by using der(fc) which gives a more reliable numerical solution.

  • New function ModiaMath.get_is_constraint to get a reference to the is_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, if has_constraintDerivative was defined to be true. This feature is demonstrated in model examples/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.