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.7299263932953574 0.00657075754781189 … 0.3671330092202594 0.8697198983963195; 0.4975296349179621 0.756125660354542 … 0.20307550568657218 0.7171098819311523; 0.49511854217683515 0.8764170450203002 … 0.8475723098972147 0.7686856124981694], u = [0.7201722116981276 0.9443205002119239 … 0.6489709611725054 0.8185603061163528; 0.5224331931846276 0.5409740086229672 … 0.8038355213009665 0.9042850323681102], Δ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.832693440905731], β = [0.27414175718477996])
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.