FlightSims
FlightSims
is a general-purpose numerical simulator by defining nested environments.
This package can be used for any kind of numerical simulation with dynamical systems
although it was supposed to be dedicated only for flight simulations.
Features
Compatibility
- It is compatible with OrdinaryDiffEq.jl. Supporting full compatibility with DifferentialEquations.jl is not on the road map for now. If you want more functionality, please feel free to report an issue!
Nested Environments and Zoo
- One can generate user-defined nested environments (or, dynamical systems) for complex flight simulation.
Also, some predefined environments are provided for reusability (i.e., environment zoo).
Take a look at
src/environments
.
Utilities
- Some utilities are also provided, for example, calculation of polynomial basis and 3D rotation.
Take a look at
src/utils
.
APIs
Main APIs are provided in src/APIs
.
Make an environment
AbstractEnv
: an abstract type for user-defined and predefined environments. All environment structures should be sub-type ofAbstractEnv
.State(env::AbstractEnv)
: return a function that produces structured states.dynamics!(env::AbstractEnv)
anddynamics(env::AbstractEnv)
: return a function that maps in-place (recommended) and out-of-place dynamics (resp.), compatible withDifferentialEquations
. User can extend these methods or simply define other methods.apply_inputs(func; kwargs...)
: It is borrowed from an MRAC example. By using this, user can easily apply various kind of inputs into the dynamical system (environment).
Simulation and data saving & loading
- To-do: Fill the following contents.
sim
: returnprob::ODEProblem
andsol::ODESolution
.process
: processprob
andsol
to get simulation data.save
: saveenv
,prob
,sol
, and optionallyprocess
, in a.jld2
file.load
: loadenv
,prob
,sol
, and optionallyprocess
, from a.jld2
file.
Usage
- For an example of infinite-horizon continuous-time linear quadratic regulator (LQR), take a look at
test/lqr.jl
. - For an example of continuous-time value-iteration adaptive dynamic programming (CT-VI-ADP), take a look at
main/continuous_time_vi_adp.jl
. - To-do: add an example