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.2545805349568495 0.8602784788421538 … 0.8118320241124221 0.08728235097215897; 0.7597776094692231 0.17581015400112854 … 0.24399872369515485 0.9046738133759994; 0.5410179870787439 0.5781472481134758 … 0.025009579193023046 0.9299495177759559], u = [0.44451098487383256 0.7788007188560526 … 0.07677699287366369 0.7777822849963937; 0.869331438971647 0.3836184788686543 … 0.9476687173151058 0.5357396758539724], Δ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.5960833971133239], β = [0.4893055311998412])

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.