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.6380664536108507 0.21535093134552719 … 0.9192163082216542 0.7990413144901005; 0.6620247064412679 0.46571404828973506 … 0.25815383368257305 0.4243466469622782; 0.18182756533308042 0.1929757864406071 … 0.4242354102422977 0.879800394503063], u = [0.21917223215087134 0.7978650944297506 … 0.8045426377095258 0.6145459352815444; 0.5707797879012457 0.8816571725033581 … 0.5199210587963576 0.7675186335943596], Δ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.6943985605569306], β = [0.6162117162675211])

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.