Parameters

NamedTrajectory.jl support passing parameters as a Tuple when construct a NamedTrajectory.

using NamedTrajectories

First we need to define number of timesteps and timestep

T = 10
dt = 0.1
0.1

then build named tuple of components and data matrices.

components = (
    x = rand(3, T),
    u = rand(2, T),
    Δt = fill(dt, 1, T),
)
(x = [0.16440576966042386 0.6288036976323633 … 0.28791139329704984 0.7942598742628378; 0.9406793858747873 0.4019464546868815 … 0.6521836374239262 0.48979619651390627; 0.8397352742087236 0.2863516414502062 … 0.12227714901482012 0.45786937750413725], u = [0.44823423722704503 0.7232825011968191 … 0.6273981801516498 0.19138638286167076; 0.14359495346396467 0.33233516840108657 … 0.9794321997992805 0.40083342848993586], Δt = [0.1 0.1 … 0.1 0.1])

we must specify a timestep and control variable for the trajectory.

timestep = :Δt
control = :u
:u

some global params as a NamedTuple

params = (
    α = rand(1),
    β = rand(1)
)
(α = [0.3163390973255962], β = [0.7021149000447401])

we can now create a NamedTrajectory object with parameters specification.

traj = NamedTrajectory(components, params; timestep=timestep, controls=control)
T = 10, (x = 1:3, u = 4:5, → Δt = 6:6), (α = 1:1, β = 2:2)

This page was generated using Literate.jl.