|
Janus 2.0.0
High-performance C++20 dual-mode numerical framework
|
Direct collocation transcription. More...
#include <Collocation.hpp>


Public Member Functions | |
| DirectCollocation (Opti &opti) | |
| Construct with a reference to the optimization environment. | |
| std::tuple< SymbolicMatrix, SymbolicMatrix, NumericVector > | setup (int n_states, int n_controls, double t0, double tf, const CollocationOptions &opts={}) |
| Set up the collocation problem with fixed final time. | |
| std::tuple< SymbolicMatrix, SymbolicMatrix, NumericVector > | setup (int n_states, int n_controls, double t0, const SymbolicScalar &tf, const CollocationOptions &opts={}) |
| Set up the collocation problem with variable final time. | |
| SymbolicScalar | quadrature (const SymbolicVector &integrand) const |
| Composite quadrature for an integrand sampled at collocation nodes. | |
| int | n_intervals () const |
| Get the number of collocation intervals. | |
| Public Member Functions inherited from janus::TranscriptionBase< DirectCollocation > | |
| TranscriptionBase (Opti &opti) | |
| Construct with a reference to the optimization environment. | |
| void | set_initial_state (const NumericVector &x0) |
| Pin all initial states to specified values. | |
| void | set_final_state (const NumericVector &xf) |
| Pin all final states to specified values. | |
| void | set_dynamics (Func &&dynamics) |
| Register the dynamics function xdot = f(x, u, t). | |
| const SymbolicMatrix & | states () const |
| Get the state decision variable matrix. | |
| const SymbolicMatrix & | controls () const |
| Get the control decision variable matrix. | |
| const NumericVector & | time_grid () const |
| Get the normalized time grid. | |
| int | n_nodes () const |
| Get the number of discretization nodes. | |
| int | n_states () const |
| Get the number of state variables per node. | |
| int | n_controls () const |
| Get the number of control variables per node. | |
| void | add_dynamics_constraints () |
| Add dynamics constraints to the optimization problem. | |
| void | add_defect_constraints () |
| Alias for add_dynamics_constraints(). | |
| void | add_continuity_constraints () |
| Alias for add_dynamics_constraints(). | |
Friends | |
| class | TranscriptionBase< DirectCollocation > |
Additional Inherited Members | |
| Protected Member Functions inherited from janus::TranscriptionBase< DirectCollocation > | |
| SymbolicScalar | get_duration () const |
| SymbolicScalar | get_time_at_node (int k) const |
| SymbolicVector | get_state_at_node (int k) const |
| SymbolicVector | get_control_at_node (int k) const |
| Protected Attributes inherited from janus::TranscriptionBase< DirectCollocation > | |
| Opti & | opti_ |
| int | n_states_ |
| int | n_controls_ |
| int | n_nodes_ |
| double | t0_ |
| double | tf_fixed_ |
| SymbolicScalar | tf_symbolic_ |
| bool | tf_is_variable_ |
| bool | setup_complete_ |
| bool | dynamics_set_ |
| bool | dynamics_constraints_added_ |
| NumericVector | tau_ |
| SymbolicMatrix | states_ |
| SymbolicMatrix | controls_ |
| std::function< SymbolicVector(const SymbolicVector &, const SymbolicVector &, const SymbolicScalar &)> | dynamics_ |
Direct collocation transcription.
|
inlineexplicit |
Construct with a reference to the optimization environment.
| opti | Opti instance |
|
inline |
Get the number of collocation intervals.
|
inline |
Composite quadrature for an integrand sampled at collocation nodes.
Trapezoidal scheme uses composite trapezoidal weights. Hermite-Simpson uses composite Simpson when possible (even number of intervals), otherwise falls back to trapezoidal.
| integrand | symbolic vector of integrand values at each node |
|
inline |
Set up the collocation problem with variable final time.
| n_states | number of state variables |
| n_controls | number of control variables |
| t0 | initial time |
| tf | symbolic final time (decision variable) |
| opts | collocation options |
|
inline |
Set up the collocation problem with fixed final time.
| n_states | number of state variables |
| n_controls | number of control variables |
| t0 | initial time |
| tf | final time |
| opts | collocation options |
|
friend |