Releases: ModiaSim/Modia.jl
v0.8.3
Modia v0.8.3
- 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:
- Support Var(init=nothing, start=nothing) (#141) (@MartinOtter)
- Bug fix: Do not convert Bool or Int (without units) to FloatType (#143) (@MartinOtter)
v0.8.2
Modia v0.8.2
-
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 filefileName
.- Automatically use
@instantiatedModel(..., unitless=true, ..)
, ifFloatType = 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
v0.8.0
Modia v0.8.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
Modia v0.7.0
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 asb = Var(:(2*a))
).
In versions 0.6.0 and before, equations could be associated with any key. -
The merge operator
|
appends the expression vectors ofequations
, so
m1 | m2
basically appends the vector ofm2.equations
to the vector ofm1.equations
.
In versions 0.6.0 and before, the merge operator did not handleequations
specially,
and thereforem1 | m2
replacedm1.equations
bym2.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 viasimulate!(.., 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 aMeasurement{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=[...])
orVar(start=[..])
of FreeMotion joints must be defined as
Var(init=SVector{3,Float64}(..))
orVar(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
Modia v0.6.1
- 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
Modia v0.6.0
- Modia is restricted to Julia 1.7
- cyclic dependencies with Modia3D package are removed
Merged pull requests:
- An julia1.7 (#132) (@AndreaNeumayr)
- An update project toml (#133) (@AndreaNeumayr)
v0.5.2
Modia v0.5.2
- Fully reexporting Modia3D and removing duplicate ModiaInterface (see Modia3D release notes 0.6.0).
Merged pull requests:
- add FloatType to Modia3D_Interface.jl (#127) (@AndreaNeumayr)
- temporarily changes needed for Modia3D interface (#128) (@AndreaNeumayr)
- temporarily, for ongoing work at Modia3D Interface (#129) (@AndreaNeumayr)
- reexport Modia3D, Modia3D_Interface.jl deleted (#130) (@AndreaNeumayr)
- An update version numbers (#131) (@AndreaNeumayr)
v0.5.1
Modia v0.5.1
- Using and reexporting ModiaLang 0.8.3 (see release notes 0.8.3 and 0.8.2).
- Using and partially reexporting Modia3D 0.5.1 (see release notes 0.5.1).
Merged pull requests:
- Adapted to corresponding Modia3D version/branch (#117) (@MartinOtter)
- Sync Modia3D_Interface.jl with Modia3D/src/ModiaInterface/model3D.jl (#123) (@GerhardHippmann)
v0.5.0
Modia v0.5.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)