Parameters
NamedTrajectory.jl support passing parameters as a Tuple when construct a NamedTrajectory.
using NamedTrajectoriesFirst we need to define number of timesteps and timestep
N = 10
dt = 0.10.1then build named tuple of components and data matrices.
components = (x = rand(3, N), u = rand(2, N), Δt = fill(dt, 1, N))(x = [0.29242371514342835 0.9039313318667599 … 0.23315012689260828 0.36591305322874; 0.49358224910470705 0.9801780457444803 … 0.6208725842776326 0.8920482702413076; 0.572233311553889 0.6651557411173491 … 0.6827912975297522 0.12538369430128937], u = [0.8536365469592664 0.5819635972117997 … 0.16276623672682466 0.29299893460618975; 0.10119783960052176 0.19156067066621363 … 0.677474352564878 0.2285178955830287], Δt = [0.1 0.1 … 0.1 0.1])we must specify a timestep and control variable for the trajectory.
timestep = :Δt
control = :u:usome global params as a NamedTuple
params = (α = rand(1), β = rand(1))(α = [0.8677565378883606], β = [0.9168677916848951])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.