-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from ErikQQY/qqy/constructor
Add docs for constructors and populate docs
- Loading branch information
Showing
4 changed files
with
137 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,30 @@ | ||
# # Constructors | ||
|
||
# To construct a `NamedTrajectory` using NamedTrajectories.jl, we simply need to utilize the `NamedTrajectory` constructor. | ||
|
||
using NamedTrajectories | ||
|
||
## define number of timesteps and timestep | ||
T = 10 | ||
dt = 0.1 | ||
|
||
# build named tuple of components and data matrices. | ||
|
||
components = ( | ||
x = rand(3, T), | ||
u = rand(2, T), | ||
Δt = fill(dt, 1, T), | ||
) | ||
|
||
# we must specify a timestep and control variable for the trajectory. | ||
|
||
timestep = 0.1 | ||
control = :u | ||
|
||
# we can now create a `NamedTrajectory` object. | ||
|
||
traj = NamedTrajectory(components; timestep=timestep, controls=control) | ||
|
||
# Construct `NamedTrajectory` from previous constructed one. | ||
|
||
traj = NamedTrajectory(components, traj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters