Skip to content

Commit 0adecdd

Browse files
committed
Merge branch 'otter_development' of https://github.com/ModiaSim/Modia.jl into otter_development
2 parents 89100a4 + 50e0cc2 commit 0adecdd

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

README.md

+28-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
[![The MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/ModiaSim/Modia.jl/blob/master/LICENSE)
55

66
The [Modia Tutorial](https://modiasim.github.io/Modia.jl/stable/tutorial/GettingStarted.html) provides an introduction to Modia.
7-
The [Modia3D Tutorial](https://modiasim.github.io/Modia3D.jl/stable/tutorial/GettingStarted.html) provides an introduction to use 3D components in Modia.
8-
Modia is part of [ModiaSim](https://modiasim.github.io/docs/).
7+
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/).
8+
9+
[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).
910

10-
[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).
11-
The basic type of the floating point variables is usually `Float64`, but can be set to any
12-
type `FloatType <: AbstractFloat` via `@instantiateModel(..., FloatType = xxx)`, for example
13-
it can be set to `Float32, DoubleFloat, Measurement{Float64}, StaticParticles{Float64,100}`.
11+
The basic type of the floating point variables is usually *Float64*, but can be set to any type *FloatType <: AbstractFloat* via
12+
*@instantiateModel(..., FloatType = xxx)*, for example it can be set to *Float32, DoubleFloat, Measurement{Float64}, StaticParticles{Float64,100}*.
13+
14+
After a simulation, an instantiated model is treated as a *signal table* and therefore all functions from package [SignalTables.jl](https://github.com/ModiaSim/SignalTables.jl) can be used on it. In particular, the simulation results together with all parameter and start values can be stored on file in *JSON* or in *HDF5* format.
1415

1516
## Installation
1617

@@ -79,15 +80,33 @@ Pendulum = Model(
7980
pendulum1 = @instantiateModel(Pendulum)
8081
simulate!(pendulum1, Tsit5(), stopTime = 10.0u"s", log=true)
8182

83+
showInfo(pendulum1) # print info about the result
84+
writeSignalTable("pendulum1.json", pendulum1, indent=2, log=true)
85+
8286
@usingModiaPlot # Use plot package defined with
8387
# ENV["SignalTablesPlotPackage"] = "XXX" or with
8488
# usePlotPackage("XXX")
8589
plot(pendulum1, [("phi", "w"); "r"], figure = 1)
8690
```
91+
The result is the following print output
8792

88-
The result is the following plot:
93+
```julia
94+
name unit size eltypeOrType kind attributes
95+
─────────────────────────────────────────────────────────────────────────────────────────────────────
96+
time "s" (501,) Float64 Var independent=true
97+
w "rad*s^-1" (501,) Float64 Var start=0 rad s^-1, fixed=true, state=true, der="der…
98+
der(w) "rad*s^-2" (501,) Float64 Var
99+
phi "rad" (501,) Float64 Var start=1.57 rad, fixed=true, state=true, der="der(p
100+
der(phi) "rad*s^-1" (501,) Float64 Var
101+
r "m" (501,2) Float64 Var
102+
L "m" () Float64 Par
103+
m "kg" () Float64 Par
104+
d "m*N*s*rad^-1" () Float64 Par
105+
g "m*s^-2" () Float64 Par
106+
```
107+
file [pendulum1.json](https://modiasim.github.io/Modia.jl/resources/fileio/pendulum1.json) and the following plot:
89108
90-
![Pendulum-Figure](docs/resources/images/PendulumFigures.png)
109+
![Pendulum-Figure](https://modiasim.github.io/Modia.jl/resources/images/pendulum1.png)
91110
92111
Simulation and plotting of the pendulum with normally distributed uncertainty added to some parameters is performed in the following way:
93112
@@ -108,7 +127,7 @@ plot(pendulum2, [("phi", "w"); "r"], figure = 2)
108127
resulting in the following plot where mean values are shown with thick lines
109128
and standard deviations as area around the mean values.
110129
111-
![PendulumWithUncertainty](docs/resources/images/PendulumWithUncertainties.png)
130+
![PendulumWithUncertainty](https://modiasim.github.io/Modia.jl/resources/images/pendulum2.png)
112131
113132
## Main Developers
114133

0 commit comments

Comments
 (0)