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.4407517199399227 0.41487425724261384 … 0.9056909008250105 0.6175888275156712; 0.9760485535372143 0.07842464895157208 … 0.12032169081345268 0.9326434572237979; 0.9783549824551907 0.02063317249333274 … 0.41128983924835194 0.16946880115717566], u = [0.38074143257768145 0.04963638653514002 … 0.8367021434481777 0.2252050919469899; 0.4075516178020733 0.04498331396752042 … 0.3838917873149059 0.8906609819001791], Δ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.6543650854301802], β = [0.9311381997188185])

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.