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
.
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
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
or in 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
which are modeled as
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
.
data = simulate(my_model, T = 10 // 1)
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. In the future more complex examples and tutorials will be added there.
A similar simulation architecture was proposed by @tuckermcclure in overdot-sandbox.