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

N = 10
dt = 0.1
0.1

then build named tuple of components and data matrices.

components = (
    x = rand(3, N),
    u = rand(2, N),
    Δt = fill(dt, 1, N),
)
(x = [0.15265183687602757 0.67452982011044 … 0.07560298538412324 0.3689260990228648; 0.3138844004648631 0.5869992050971506 … 0.6515914102569239 0.2811013000828463; 0.26056246087661794 0.35310525950467164 … 0.06060795289671672 0.9469232538810296], u = [0.4033901224256319 0.8495626877471326 … 0.2648278149030425 0.9093840646885845; 0.6909380431263616 0.8281801700815171 … 0.2978999438670026 0.1907409320789627], Δ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.16695722316900607], β = [0.28776730327547695])

we can now create a NamedTrajectory object with parameters specification.

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

This page was generated using Literate.jl.