Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janneshb/simplesim.jl
A minimalist Julia package for modular dynamical systems simulation. Work in Progress :-)
https://github.com/janneshb/simplesim.jl
control dynamical-systems julia modeling simulation
Last synced: 3 months ago
JSON representation
A minimalist Julia package for modular dynamical systems simulation. Work in Progress :-)
- Host: GitHub
- URL: https://github.com/janneshb/simplesim.jl
- Owner: janneshb
- License: mit
- Created: 2024-05-23T19:28:13.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-22T13:27:15.000Z (3 months ago)
- Last Synced: 2024-10-23T09:25:17.459Z (3 months ago)
- Topics: control, dynamical-systems, julia, modeling, simulation
- Language: Julia
- Homepage: https://janneshb.github.io/SimpleSim.jl/
- Size: 17.5 MB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.md
- Citation: CITATION.bib
Awesome Lists containing this project
README
# SimpleSim.jl
[![](https://img.shields.io/badge/docs-online-blue.svg)](https://janneshb.github.io/SimpleSim.jl/dev/)
[![JuliaTest](https://github.com/janneshb/SimpleSim.jl/workflows/CI/badge.svg)](https://github.com/janneshb/SimpleSim.jl/actions)
[![Codecov](https://img.shields.io/codecov/c/github/janneshb/SimpleSim.jl)](https://codecov.io/gh/janneshb/SimpleSim.jl)SimpleSim.jl is a light-weight simulation package for dynamical systems simulation, controller synthesis and testing and robotics.
Run `import Pkg; Pkg.add("SimpleSim")` from within your Julia environment to install `SimpleSim.jl`.
## Short Overview
The main point of interaction with `SimpleSim.jl` is the `simulate` function. As a first argument, it expects to be passed _some_ object that provides named fields that supply hooks for various functionalities.
A simple example of a dynamical system model accepted by `SimpleSim.jl` would be
```julia
my_model = (
fc = dynamics_function,
gc = measurement_function,
)
```
where we pass two functions `dynamics_function` and `measurement_function` that we have defined elsewhere.These two functions model the dynamics of the model using the following approach for continuous-time dynamical systems
```math
\dot{x}(t) = f(x(t), u(t), p, t)\\
y(t) = g(x(t), u(t), p, t)
```
or in Julia```julia
dynamics_function = (x, u, p, t) -> ...
measurement_function = (x, u, p, t) -> ...
```If `my_model` has no field named `p`, `SimpleSim.jl` will pass `nothing` to `fc` and `gc`.
Similarly, `SimpleSim.jl` supports discrete-time systems
```math
x_{k+1} = f(x_k, u_k, p, t)\\
y_k = g(x_k, u_k, p, t)
```
which are modeled as
```julia
my_dt_model = (
fd = dt_dynamics_function,
gd = dt_measurement_function,
Δt = 1 // 10,
)
```Running a simulation is as easy as calling `simulate` with your model and a total simulation time `T`.
```julia
data = simulate(my_model, T = 10 // 1)
```## Examples
Multiple demos in the `examples/` provide a rough but incomplete overview of what `SimpleSim.jl` can do.
Some examples are described in detail in the [official documentation](https://janneshb.github.io/SimpleSim.jl/). In the future more complex examples and tutorials will be added there.
## Credit
A similar simulation architecture was proposed by [@tuckermcclure](https://www.github.com/tuckermcclure) in [overdot-sandbox](https://github.com/tuckermcclure/overdot-sandbox).