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.7541634632381968 0.8214279336842907 … 0.7370359639183631 0.6965138048715042; 0.9013284319196494 0.6421367676011869 … 0.7072977229032589 0.6975236539763614; 0.6890527848270412 0.22087506010071467 … 0.7064869456131865 0.1406532214879972], u = [0.43132559526733927 0.08663544194519168 … 0.26538525254154754 0.10307312094605647; 0.8176219109343805 0.5124137971820606 … 0.6538730096005185 0.4322217494463805], Δ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.2523707243615807], β = [0.3253191442069494])

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.