Skip to content

Releases: ModiaSim/Modia.jl

v0.8.3

15 Mar 13:15
1789334
Compare
Choose a tag to compare

Modia v0.8.3

Diff since v0.8.2

  • Bug fix: Parameters that are Numbers, but not AbstractFloats, and have no unit defined,
    e.g. a Bool or an Int parameter, are no longer converted to FloatType in the generated Code.

Merged pull requests:

v0.8.2

06 Mar 22:14
b1e8ca9
Compare
Choose a tag to compare

Modia v0.8.2

Diff since v0.8.1

  • New exported functions

    • modelToJSON(model; expressionsAsStrings=true)
    • JSONToModel(json)
    • writeModel(filename, model; log=true)
    • readModel(filename; log=true)
      writeModel saves the model in JSON format on file and readModel reads the model from a JSON file.
  • Modia/examples/ServoSystem.jl enhanced, so that the hierarchical model with units is
    first stored in JSON format on file, then the model is read from file, a parameter is modified,
    and then the model is passed to @instantiateModel(..).

  • @instantiateModel(...):

    • @instantiateModel(..., logCode=true, ...) provides now correct unit type casts for scalars.
    • @instantiateModel(..., saveCodeOnFile=fileName, ...) stores the generated code on file fileName.
    • Automatically use @instantiatedModel(..., unitless=true, ..), if FloatType = MonteCarloMeasurements.XXX,
      because there are easily cases where this fails, if units are present.
  • @showModel model: Nicer pretty print if model is hierarchical.

  • New function Modia.unitAsString(unitOfQuantity),
    see Unitful issue 412 (PainterQubits/Unitful.jl#412).

  • Remove empty hierarchies in model parameters (seen with simulate!(..., logParameters=true)).

  • Memory allocation reduced if states or tearing variables are SVectors.

  • Improved casting and checking of types in the generated code
    (see new test model Modia/test/TestUnitAsString.jl).

  • Moved ModiaBase.Symbolic.makeDerVar from ModiaBase to new file Modia/src/Symbolic.jl (because makeDerVar needs FloatType for
    generating type-stable code and FloatType is available in Modia but not in ModiaBase).

  • Github actions workflow added for automatic tests on Linux/Windows/MacOS, for pull requests on main.

Bug fixes

  • Fixed issue with unit on macOS (exponents had been displayed as Unicode superscripts when converting
    the unit to a string, leading to errors in the further processing).

  • Hide result only if Var(hideResult=true) (previously, hideResult=false was treated as true).

  • Modia/models/Rotational.jl: Change some Int to Float64 values, because errors occured in some situations.

Merged pull requests:

  • Test github actions workflow for automatic tests if pull request to main (#138) (@MartinOtter)
  • Reduce memory allocation if states or tearing variables are SVectors … (#139) (@MartinOtter)
  • Remove empty parameter levels (#140) (@MartinOtter)

v0.8.1

01 Mar 01:05
Compare
Choose a tag to compare

Modia v0.8.1

Diff since v0.8.0

  • Missing file Modia/test/TestLinearEquations.jl added.

v0.8.0

01 Mar 00:41
Compare
Choose a tag to compare

Modia v0.8.0

Diff since v0.7.0

Non-backwards compatible changes

The Modia packages are slightly restructured to allow more efficient operations.
Previously, Modia was planned to include all the functionality with all model libraries.
This is now changed and Modia includes now equation-oriented modeling and basic model libraries.
Further model libraries, such as Modia3D (and other model libraries in the future) must be
explicitly imported and are no longer automatically imported by Modia.
To simplify the structuring, ModiaLang is merged into Modia
and some functionality for the code generation is moved from ModiaBase to Modia.
Overall, the benefit is that loading and compilation times are reduced, if Modia3D is not needed.
Furthermore, the generated code contains only references to Modia functionality and no longer to ModiaBase.
Details of the changes:

  • ModiaLang#main 0.11.3 and ModiaLang#development merged into Modia 0.7.0 resulting
    in the new Modia version 0.8.0 (hereby history of both ModiaLang and of Modia is preserved).

  • Modia3D is removed from Modia (so when a model is using Modia3D, the package must be explicitly imported
    and is no longer automatically imported from Modia).

  • Require ModiaBase 0.10 (where EquationAndStateInfo.jl and StateSelection.jl are removed and
    added to Modia, in order that only references to Modia are in the generated code and no longer
    references to ModiaBase).

Closed issues:

  • ModiaLang v0.8.2 - missing feature in main branch (#126)

v0.7.0

27 Feb 11:33
Compare
Choose a tag to compare

Modia v0.7.0

Diff since v0.6.1

Non-backwards compatible changes (basically, these changes are, erronously, in 0.6.1):

  • Equations can only be defined with key equations and no other key
    (still, expressions can be associated with one variable, such as b = Var(:(2*a))).
    In versions 0.6.0 and before, equations could be associated with any key.

  • The merge operator | appends the expression vectors of equations, so
    m1 | m2 basically appends the vector of m2.equations to the vector of m1.equations.
    In versions 0.6.0 and before, the merge operator did not handle equations specially,
    and therefore m1 | m2 replaced m1.equations by m2.equations.

  • Parameter values in the code are now type cast to the type of the parameter value from the
    @instantiatedModel(..) call. The benefit is that access of parameter values in the code is type stable
    and operations with the parameter value are more efficient and at run-time no memory is allocated.
    Existing models can no longer be simulated, if parameter values provided via simulate!(.., merge=xx) are not
    type compatible to their definition. For example, an error is thrown if the @instantedModel(..) uses a Float64 value and the
    simulate!(.., merge=xx) uses a Measurement{Float64} value for the same parameter

  • Operator buildModia3D(..) as used in Modia3D models is removed. Instead, the new constructor
    Model3D(..) must be used at the top level of a Modia3D definition. It is now possible to define
    several, independent multibody systems (currently, only one of them can have animation and animation export).

  • Var(init=[...]) or Var(start=[..]) of FreeMotion joints must be defined as
    Var(init=SVector{3,Float64}(..)) or Var(start=SVector{3,Float64}(..)).
    Otherwise, errors occur during compilation.

Other changes

  • Documentation (especially tutorial) adapted to the new version.

  • Examples and test models (Modia/examples, Modia/tests) adapted to the new version, especially
    to the non-backwards compatible changes.

  • For further changes of equation-based models, see the release notes of ModiaLang 0.11.0.

  • For further changes of Modia3D models, see the release notes of Modia3D 0.9.0.

Closed issues:

  • Modia.jl 0.6.1 instantiatemodel fails (#137)

v0.6.1

23 Feb 13:53
45eb2f7
Compare
Choose a tag to compare

Modia v0.6.1

Diff since v0.6.0

  • Project.toml and Manifest.toml updated due to new versions of Modia3D and ModiaLang
  • docu: fix some typing and formatting

Closed issues:

  • dead-time function (#125)

Merged pull requests:

  • fix some documentation typos / formatting to one sentence per line (#134) (@alhirzel)
  • Project.toml and Manifest.toml are updated to v0.6.1 (#136) (@AndreaNeumayr)

v0.6.0

04 Feb 11:31
421d7e0
Compare
Choose a tag to compare

Modia v0.6.0

Diff since v0.5.2

  • Modia is restricted to Julia 1.7
  • cyclic dependencies with Modia3D package are removed

Merged pull requests:

v0.5.2

03 Feb 10:04
51250b3
Compare
Choose a tag to compare

Modia v0.5.2

Diff since v0.5.1

Merged pull requests:

v0.5.1

25 Nov 14:43
Compare
Choose a tag to compare

Modia v0.5.1

Diff since v0.5.0

Merged pull requests:

v0.5.0

28 Jul 09:25
Compare
Choose a tag to compare

Modia v0.5.0

Diff since v0.4.0

  • Using and reexporting ModiaLang 0.8.1 (see release notes).
  • Using and partially reexporting Modia3D 0.5.0 (see release notes).
  • New plot package interface via ModiaResult. Additional support for PyPlot, WGLMakie, CairoMakie (besides GLMakie).

Closed issues:

  • Out of bounds error using previous (#113)