Skip to content

Commit

Permalink
Merge pull request #148 from ModiaSim/mo_states_in_model_functions
Browse files Browse the repository at this point in the history
Version 0.9.0
  • Loading branch information
MartinOtter authored Jul 5, 2022
2 parents 8c8ab98 + b277824 commit 958fad1
Show file tree
Hide file tree
Showing 46 changed files with 6,019 additions and 1,804 deletions.
441 changes: 235 additions & 206 deletions Manifest.toml

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
authors = ["Hilding Elmqvist <[email protected]>", "Martin Otter <[email protected]>"]
name = "Modia"
uuid = "cb905087-75eb-5f27-8515-1ce0ec8e839e"
version = "0.8.4"

[compat]
DataFrames = "1"
DifferentialEquations = "7"
FiniteDiff = "2"
ForwardDiff = "0.10"
JSON = "0.21"
Measurements = "2"
ModiaBase = "0.11"
ModiaResult = "0.4.1"
MonteCarloMeasurements = "1"
OrderedCollections = "1"
RecursiveFactorization = "0.2"
Reexport = "1"
StaticArrays = "1"
Sundials = "4.4"
TimerOutputs = "0.5"
Unitful = "1"
julia = "1.7"
version = "0.9.0"

[deps]
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
Expand All @@ -32,17 +14,37 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
ModiaBase = "ec7bf1ca-419d-4510-bbab-199861c55244"
ModiaResult = "16a87621-1533-42f6-8e19-4a825980cec2"
MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SignalTables = "3201582d-3078-4276-ba5d-0a1254d79d7c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
DiffEqBase = "6.82.0"
DataFrames = "1"
DifferentialEquations = "7"
FiniteDiff = "2"
ForwardDiff = "0.10"
JSON = "0.21"
Measurements = "2"
ModiaBase = "0.11"
MonteCarloMeasurements = "1"
OrderedCollections = "1"
RecursiveFactorization = "0.2"
Reexport = "1"
SignalTables = "0.3.4"
StaticArrays = "1"
Sundials = "4"
TimerOutputs = "0.5"
Unitful = "1"
julia = "1.7"

[extras]
CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ The [Modia Tutorial](https://modiasim.github.io/Modia.jl/stable/tutorial/Getting
The [Modia3D Tutorial](https://modiasim.github.io/Modia3D.jl/stable/tutorial/GettingStarted.html) provides an introduction to use 3D components in Modia.
Modia is part of [ModiaSim](https://modiasim.github.io/docs/).

[Modia](https://github.com/ModiaSim/Modia.jl) is an environment in form of a Julia package to model and simulate physical systems (electrical, mechanical, thermo-dynamical, etc.) described by differential and algebraic equations. A user defines a model on a high level with model components (like a mechanical body, an electrical resistance, or a pipe) that are physically connected together. A model component is constructed by **`expression = expression` equations** or by Julia structs/functions, such as the pre-defined Modia 3D-mechanical components. The defined model is symbolically processed (for example, equations might be analytically differentiated) with algorithms from package [ModiaBase.jl](https://github.com/ModiaSim/ModiaBase.jl). From the transformed model a Julia function is generated that is used to simulate the model with integrators from [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl).
[Modia](https://github.com/ModiaSim/Modia.jl) is an environment in form of a Julia package to model and simulate physical systems (electrical, mechanical, thermo-dynamical, etc.) described by differential and algebraic equations. A user defines a model on a high level with model components (like a mechanical body, an electrical resistance, or a pipe) that are physically connected together. A model component is constructed by **`expression = expression` equations** or by Julia structs/functions, such as the pre-defined [Modia3D] (https://github.com/ModiaSim/Modia3D.jl) multibody components. The defined model is symbolically processed (for example, equations might be analytically differentiated) with algorithms from package [ModiaBase.jl](https://github.com/ModiaSim/ModiaBase.jl). From the transformed model a Julia function is generated that is used to simulate the model with integrators from [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl).
The basic type of the floating point variables is usually `Float64`, but can be set to any
type `FloatType<:AbstractFloat` via `@instantiateModel(..., FloatType = xxx)`, for example
type `FloatType <: AbstractFloat` via `@instantiateModel(..., FloatType = xxx)`, for example
it can be set to `Float32, DoubleFloat, Measurement{Float64}, StaticParticles{Float64,100}`.

## Installation
Expand All @@ -24,16 +24,22 @@ Furthermore, one or more of the following packages should be installed in order
to be able to generate plots:

```julia
julia> ]add ModiaPlot_PyPlot # if plotting with PyPlot desired
add ModiaPlot_GLMakie # if plotting with GLMakie desired
add ModiaPlot_WGLMakie # if plotting with WGLMakie desired
add ModiaPlot_CairoMakie # if plotting with CairoMakie desired
julia> ]add SignalTablesInterface_PyPlot # if plotting with PyPlot desired

# currently under registration
add SignalTablesInterface_GLMakie # if plotting with GLMakie desired
add SignalTablesInterface_WGLMakie # if plotting with WGLMakie desired
add SignalTablesInterface_CairoMakie # if plotting with CairoMakie desired
```

or call `t = getValues(instantiatedModel, "time"), y = getValues(instantiatedModel, "y")` to retrieve
the results in form of vectors and arrays and use any desired plot package for plotting, e.g., `plot(t,y)`.

Note, Modia reexports the following definitions

- `using Unitful`
- `using DifferentialEquations`
- `using SignalTables`
- and exports functions `CVODE_BDF` and `IDA` of [Sundials.jl](https://github.com/SciML/Sundials.jl).

As a result, it is usually sufficient to have `using Modia` in a model to utilize the relevant
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Documenter, Modia, Modia.ModiaResult, ModiaPlot_PyPlot
using Documenter, Modia, SignalTables, SignalTablesInterface_PyPlot

makedocs(
#modules = [Modia],
Expand Down
Loading

0 comments on commit 958fad1

Please sign in to comment.