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.8395434178723409 0.6323658156762144 … 0.9790164937452577 0.5974083142039901; 0.3293345901386743 0.643025610690287 … 0.15845211967289408 0.7502912093689793; 0.48190477682517563 0.7764236297689818 … 0.7268224546883333 0.8590914957915404], u = [0.5785173748006812 0.21582202119125715 … 0.7203455946687526 0.6899788455921725; 0.8040413070968467 0.6434930718220266 … 0.4486407506140252 0.4819061582357914], Δ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.4463442397852564], β = [0.5457619486682224])

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.