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.2718268609483908 0.6807075986710212 … 0.45636412558017747 0.7950523292289744; 0.20733397030861367 0.5959038696970981 … 0.2196728814923854 0.35337921490871194; 0.11759481701224228 0.03672851432177404 … 0.56628538262703 0.4494826490073661], u = [0.16005856816737685 0.8013351474681975 … 0.2015083319652453 0.3331687694794665; 0.7083704176275818 0.18001489149442085 … 0.3150393634292823 0.5365452924030382], Δ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.06505918676797695], β = [0.9821467682535238])

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.