#include <alpaqa/casadi/CasADiControlProblem.hpp>
Definition at line 19 of file CasADiControlProblem.hpp.
Public Types | |
using | Box = alpaqa::Box< config_t > |
Public Member Functions | |
CasADiControlProblem (const std::string &filename, length_t N) | |
~CasADiControlProblem () | |
CasADiControlProblem (const CasADiControlProblem &) | |
CasADiControlProblem & | operator= (const CasADiControlProblem &) |
CasADiControlProblem (CasADiControlProblem &&) noexcept | |
CasADiControlProblem & | operator= (CasADiControlProblem &&) noexcept |
void | load_numerical_data (const std::filesystem::path &filepath, char sep=',') |
Load the numerical problem data (bounds and parameters) from a CSV file. | |
void | get_U (Box &U) const |
void | get_D (Box &D) const |
void | get_D_N (Box &D_N) const |
void | get_x_init (rvec x_init) const |
void | eval_f (index_t timestep, crvec x, crvec u, rvec fxu) const |
void | eval_jac_f (index_t timestep, crvec x, crvec u, rmat J_fxu) const |
void | eval_grad_f_prod (index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p) const |
void | eval_h (index_t timestep, crvec x, crvec u, rvec h) const |
void | eval_h_N (crvec x, rvec h) const |
real_t | eval_l (index_t timestep, crvec h) const |
real_t | eval_l_N (crvec h) const |
void | eval_qr (index_t timestep, crvec xu, crvec h, rvec qr) const |
void | eval_q_N (crvec x, crvec h, rvec q) const |
void | eval_add_Q (index_t timestep, crvec xu, crvec h, rmat Q) const |
void | eval_add_Q_N (crvec x, crvec h, rmat Q) const |
void | eval_add_R_masked (index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R, rvec work) const |
void | eval_add_S_masked (index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S, rvec work) const |
void | eval_add_R_prod_masked (index_t timestep, crvec xu, crvec h, crindexvec mask_J, crindexvec mask_K, crvec v, rvec out, rvec work) const |
void | eval_add_S_prod_masked (index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v, rvec out, rvec work) const |
length_t | get_R_work_size () const |
length_t | get_S_work_size () const |
void | eval_constr (index_t timestep, crvec x, rvec c) const |
void | eval_grad_constr_prod (index_t timestep, crvec x, crvec p, rvec grad_cx_p) const |
void | eval_add_gn_hess_constr (index_t timestep, crvec x, crvec M, rmat out) const |
void | eval_constr_N (crvec x, rvec c) const |
void | eval_grad_constr_prod_N (crvec x, crvec p, rvec grad_cx_p) const |
void | eval_add_gn_hess_constr_N (crvec x, crvec M, rmat out) const |
void | check () const |
length_t | get_N () const |
length_t | get_nx () const |
length_t | get_nu () const |
length_t | get_nh () const |
length_t | get_nh_N () const |
length_t | get_nc () const |
length_t | get_nc_N () const |
void | eval_proj_diff_g (crvec z, rvec e) const |
void | eval_proj_multipliers (rvec y, real_t M) const |
Public Attributes | |
length_t | N |
length_t | nx |
length_t | nu |
length_t | nh |
length_t | nh_N |
length_t | nc |
length_t | nc_N |
vec | x_init |
vec | param |
Box | U |
Box | D |
Box | D_N |
vec | work |
index_t | penalty_alm_split = 0 |
Components of the constraint function with indices below this number are handled using a quadratic penalty method rather than using an augmented Lagrangian method. | |
index_t | penalty_alm_split_N = 0 |
Same as penalty_alm_split, but for the terminal constraint. | |
Private Types | |
using | Functions = casadi_loader::CasADiControlFunctionsWithParam< Conf > |
Private Attributes | |
util::copyable_unique_ptr< Functions > | impl |
using Box = alpaqa::Box<config_t> |
Definition at line 22 of file CasADiControlProblem.hpp.
|
private |
Definition at line 177 of file CasADiControlProblem.hpp.
CasADiControlProblem | ( | const std::string & | filename, |
length_t | N | ||
) |
|
default |
|
default |
|
defaultnoexcept |
|
default |
|
defaultnoexcept |
void load_numerical_data | ( | const std::filesystem::path & | filepath, |
char | sep = ',' |
||
) |
Load the numerical problem data (bounds and parameters) from a CSV file.
The file should contain 8 rows, with the following contents:
Line endings are encoded using a single line feed (\n
), and the column separator can be specified using the sep
argument.
Definition at line 258 of file CasADiControlProblem.tpp.
|
inline |
Definition at line 61 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 62 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 63 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 64 of file CasADiControlProblem.hpp.
void eval_f | ( | index_t | timestep, |
crvec | x, | ||
crvec | u, | ||
rvec | fxu | ||
) | const |
Definition at line 327 of file CasADiControlProblem.tpp.
void eval_jac_f | ( | index_t | timestep, |
crvec | x, | ||
crvec | u, | ||
rmat | J_fxu | ||
) | const |
Definition at line 335 of file CasADiControlProblem.tpp.
void eval_grad_f_prod | ( | index_t | timestep, |
crvec | x, | ||
crvec | u, | ||
crvec | p, | ||
rvec | grad_fxu_p | ||
) | const |
Definition at line 344 of file CasADiControlProblem.tpp.
void eval_h | ( | index_t | timestep, |
crvec | x, | ||
crvec | u, | ||
rvec | h | ||
) | const |
Definition at line 355 of file CasADiControlProblem.tpp.
void eval_h_N | ( | crvec | x, |
rvec | h | ||
) | const |
Definition at line 363 of file CasADiControlProblem.tpp.
auto eval_l | ( | index_t | timestep, |
crvec | h | ||
) | const |
Definition at line 369 of file CasADiControlProblem.tpp.
auto eval_l_N | ( | crvec | h | ) | const |
Definition at line 376 of file CasADiControlProblem.tpp.
void eval_qr | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
rvec | qr | ||
) | const |
Definition at line 383 of file CasADiControlProblem.tpp.
void eval_q_N | ( | crvec | x, |
crvec | h, | ||
rvec | q | ||
) | const |
Definition at line 391 of file CasADiControlProblem.tpp.
void eval_add_Q | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
rmat | Q | ||
) | const |
Definition at line 398 of file CasADiControlProblem.tpp.
void eval_add_Q_N | ( | crvec | x, |
crvec | h, | ||
rmat | Q | ||
) | const |
Definition at line 421 of file CasADiControlProblem.tpp.
void eval_add_R_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask, | ||
rmat | R, | ||
rvec | work | ||
) | const |
Definition at line 444 of file CasADiControlProblem.tpp.
void eval_add_S_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask, | ||
rmat | S, | ||
rvec | work | ||
) | const |
Definition at line 475 of file CasADiControlProblem.tpp.
void eval_add_R_prod_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask_J, | ||
crindexvec | mask_K, | ||
crvec | v, | ||
rvec | out, | ||
rvec | work | ||
) | const |
Definition at line 506 of file CasADiControlProblem.tpp.
void eval_add_S_prod_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask_K, | ||
crvec | v, | ||
rvec | out, | ||
rvec | work | ||
) | const |
Definition at line 535 of file CasADiControlProblem.tpp.
auto get_R_work_size | ( | ) | const |
Definition at line 564 of file CasADiControlProblem.tpp.
auto get_S_work_size | ( | ) | const |
Definition at line 570 of file CasADiControlProblem.tpp.
void eval_constr | ( | index_t | timestep, |
crvec | x, | ||
rvec | c | ||
) | const |
Definition at line 576 of file CasADiControlProblem.tpp.
void eval_grad_constr_prod | ( | index_t | timestep, |
crvec | x, | ||
crvec | p, | ||
rvec | grad_cx_p | ||
) | const |
Definition at line 585 of file CasADiControlProblem.tpp.
void eval_add_gn_hess_constr | ( | index_t | timestep, |
crvec | x, | ||
crvec | M, | ||
rmat | out | ||
) | const |
Definition at line 595 of file CasADiControlProblem.tpp.
void eval_constr_N | ( | crvec | x, |
rvec | c | ||
) | const |
Definition at line 621 of file CasADiControlProblem.tpp.
void eval_grad_constr_prod_N | ( | crvec | x, |
crvec | p, | ||
rvec | grad_cx_p | ||
) | const |
Definition at line 630 of file CasADiControlProblem.tpp.
void eval_add_gn_hess_constr_N | ( | crvec | x, |
crvec | M, | ||
rmat | out | ||
) | const |
Definition at line 639 of file CasADiControlProblem.tpp.
|
inline |
Definition at line 99 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 124 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 125 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 126 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 127 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 128 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 129 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 130 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 133 of file CasADiControlProblem.hpp.
|
inline |
Definition at line 141 of file CasADiControlProblem.hpp.
length_t N |
Definition at line 23 of file CasADiControlProblem.hpp.
length_t nx |
Definition at line 23 of file CasADiControlProblem.hpp.
length_t nu |
Definition at line 23 of file CasADiControlProblem.hpp.
length_t nh |
Definition at line 23 of file CasADiControlProblem.hpp.
length_t nh_N |
Definition at line 23 of file CasADiControlProblem.hpp.
length_t nc |
Definition at line 23 of file CasADiControlProblem.hpp.
length_t nc_N |
Definition at line 23 of file CasADiControlProblem.hpp.
vec x_init |
Definition at line 24 of file CasADiControlProblem.hpp.
vec param |
Definition at line 25 of file CasADiControlProblem.hpp.
Box U |
Definition at line 26 of file CasADiControlProblem.hpp.
Box D |
Definition at line 26 of file CasADiControlProblem.hpp.
Box D_N |
Definition at line 26 of file CasADiControlProblem.hpp.
|
mutable |
Definition at line 27 of file CasADiControlProblem.hpp.
index_t penalty_alm_split = 0 |
Components of the constraint function with indices below this number are handled using a quadratic penalty method rather than using an augmented Lagrangian method.
Specifically, the Lagrange multipliers for these components (which determine the shifts in ALM) are kept at zero.
Definition at line 33 of file CasADiControlProblem.hpp.
index_t penalty_alm_split_N = 0 |
Same as penalty_alm_split, but for the terminal constraint.
Definition at line 35 of file CasADiControlProblem.hpp.
|
private |
Definition at line 178 of file CasADiControlProblem.hpp.