nmpc_cgmres
|
C/GMRES solver. More...
#include <CgmresSolver.h>
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | CgmresSolver (std::shared_ptr< CgmresProblem > problem, std::shared_ptr< OdeSolver > ode_solver, std::shared_ptr< OdeSolver > sim_ode_solver=nullptr) |
Constructor. More... | |
void | setup () |
Setup. More... | |
void | run () |
Run NMPC. More... | |
void | calcControlInput (double t, const Eigen::Ref< const Eigen::VectorXd > &x, const Eigen::Ref< const Eigen::VectorXd > &next_x, Eigen::Ref< Eigen::VectorXd > u) |
Calculate the control input. More... | |
void | calcDhDuList (double t, const Eigen::Ref< const Eigen::VectorXd > &x, const Eigen::Ref< const Eigen::MatrixXd > &u_list, Eigen::Ref< Eigen::MatrixXd > DhDu_list) |
Calculate the list in the horizon. More... | |
Eigen::VectorXd | eqAmulFunc (const Eigen::Ref< const Eigen::VectorXd > &vec) |
Function to return where is given. More... | |
Public Attributes | |
std::shared_ptr< CgmresProblem > | problem_ |
std::shared_ptr< OdeSolver > | ode_solver_ |
std::shared_ptr< OdeSolver > | sim_ode_solver_ |
double | sim_duration_ = 10 |
double | steady_horizon_duration_ = 1.0 |
int | horizon_divide_num_ = 25 |
double | horizon_increase_ratio_ = 0.5 |
double | dt_ = 0.001 |
double | eq_zeta_ = 1000.0 |
int | k_max_ = 5 |
double | finite_diff_delta_ = 0.002 |
int | dump_step_ = 5 |
Eigen::VectorXd | x_ |
Eigen::VectorXd | u_ |
double | t_with_delta_ |
Eigen::VectorXd | x_with_delta_ |
Eigen::MatrixXd | x_list_ |
Eigen::MatrixXd | lmd_list_ |
Eigen::MatrixXd | u_list_ |
Eigen::MatrixXd | u_list_Amul_func_ |
Eigen::MatrixXd | DhDu_list_ |
Eigen::MatrixXd | DhDu_list_with_delta_ |
Eigen::MatrixXd | DhDu_list_Amul_func_ |
std::shared_ptr< Eigen::Map< Eigen::VectorXd > > | DhDu_vec_ |
std::shared_ptr< Eigen::Map< Eigen::VectorXd > > | DhDu_vec_with_delta_ |
std::shared_ptr< Eigen::Map< Eigen::VectorXd > > | DhDu_vec_Amul_func_ |
Eigen::VectorXd | delta_u_vec_ |
std::ofstream | ofs_x_ |
std::ofstream | ofs_u_ |
std::ofstream | ofs_err_ |
const Eigen::IOFormat | vecfmt_dump_ = Eigen::IOFormat(Eigen::StreamPrecision, 0, ", ", ", ", "", "", "", "") |
C/GMRES solver.
See the following articles about the C/GMRES method:
Definition at line 22 of file CgmresSolver.h.
|
inline |
Constructor.
Definition at line 28 of file CgmresSolver.h.
void nmpc_cgmres::CgmresSolver::calcControlInput | ( | double | t, |
const Eigen::Ref< const Eigen::VectorXd > & | x, | ||
const Eigen::Ref< const Eigen::VectorXd > & | next_x, | ||
Eigen::Ref< Eigen::VectorXd > | u | ||
) |
Calculate the control input.
void nmpc_cgmres::CgmresSolver::calcDhDuList | ( | double | t, |
const Eigen::Ref< const Eigen::VectorXd > & | x, | ||
const Eigen::Ref< const Eigen::MatrixXd > & | u_list, | ||
Eigen::Ref< Eigen::MatrixXd > | DhDu_list | ||
) |
Calculate the list in the horizon.
Eigen::VectorXd nmpc_cgmres::CgmresSolver::eqAmulFunc | ( | const Eigen::Ref< const Eigen::VectorXd > & | vec | ) |
Function to return where is given.
void nmpc_cgmres::CgmresSolver::run | ( | ) |
Run NMPC.
void nmpc_cgmres::CgmresSolver::setup | ( | ) |
Setup.
Eigen::VectorXd nmpc_cgmres::CgmresSolver::delta_u_vec_ |
Definition at line 102 of file CgmresSolver.h.
Eigen::MatrixXd nmpc_cgmres::CgmresSolver::DhDu_list_ |
Definition at line 94 of file CgmresSolver.h.
Eigen::MatrixXd nmpc_cgmres::CgmresSolver::DhDu_list_Amul_func_ |
Definition at line 96 of file CgmresSolver.h.
Eigen::MatrixXd nmpc_cgmres::CgmresSolver::DhDu_list_with_delta_ |
Definition at line 95 of file CgmresSolver.h.
std::shared_ptr<Eigen::Map<Eigen::VectorXd> > nmpc_cgmres::CgmresSolver::DhDu_vec_ |
Definition at line 98 of file CgmresSolver.h.
std::shared_ptr<Eigen::Map<Eigen::VectorXd> > nmpc_cgmres::CgmresSolver::DhDu_vec_Amul_func_ |
Definition at line 100 of file CgmresSolver.h.
std::shared_ptr<Eigen::Map<Eigen::VectorXd> > nmpc_cgmres::CgmresSolver::DhDu_vec_with_delta_ |
Definition at line 99 of file CgmresSolver.h.
double nmpc_cgmres::CgmresSolver::dt_ = 0.001 |
Definition at line 72 of file CgmresSolver.h.
int nmpc_cgmres::CgmresSolver::dump_step_ = 5 |
Definition at line 79 of file CgmresSolver.h.
double nmpc_cgmres::CgmresSolver::eq_zeta_ = 1000.0 |
Definition at line 74 of file CgmresSolver.h.
double nmpc_cgmres::CgmresSolver::finite_diff_delta_ = 0.002 |
Definition at line 77 of file CgmresSolver.h.
int nmpc_cgmres::CgmresSolver::horizon_divide_num_ = 25 |
Definition at line 69 of file CgmresSolver.h.
double nmpc_cgmres::CgmresSolver::horizon_increase_ratio_ = 0.5 |
Definition at line 70 of file CgmresSolver.h.
int nmpc_cgmres::CgmresSolver::k_max_ = 5 |
Definition at line 75 of file CgmresSolver.h.
Eigen::MatrixXd nmpc_cgmres::CgmresSolver::lmd_list_ |
Definition at line 89 of file CgmresSolver.h.
std::shared_ptr<OdeSolver> nmpc_cgmres::CgmresSolver::ode_solver_ |
Definition at line 62 of file CgmresSolver.h.
std::ofstream nmpc_cgmres::CgmresSolver::ofs_err_ |
Definition at line 107 of file CgmresSolver.h.
std::ofstream nmpc_cgmres::CgmresSolver::ofs_u_ |
Definition at line 106 of file CgmresSolver.h.
std::ofstream nmpc_cgmres::CgmresSolver::ofs_x_ |
Definition at line 105 of file CgmresSolver.h.
std::shared_ptr<CgmresProblem> nmpc_cgmres::CgmresSolver::problem_ |
Definition at line 61 of file CgmresSolver.h.
double nmpc_cgmres::CgmresSolver::sim_duration_ = 10 |
Definition at line 66 of file CgmresSolver.h.
std::shared_ptr<OdeSolver> nmpc_cgmres::CgmresSolver::sim_ode_solver_ |
Definition at line 63 of file CgmresSolver.h.
double nmpc_cgmres::CgmresSolver::steady_horizon_duration_ = 1.0 |
Definition at line 68 of file CgmresSolver.h.
double nmpc_cgmres::CgmresSolver::t_with_delta_ |
Definition at line 85 of file CgmresSolver.h.
Eigen::VectorXd nmpc_cgmres::CgmresSolver::u_ |
Definition at line 83 of file CgmresSolver.h.
Eigen::MatrixXd nmpc_cgmres::CgmresSolver::u_list_ |
Definition at line 91 of file CgmresSolver.h.
Eigen::MatrixXd nmpc_cgmres::CgmresSolver::u_list_Amul_func_ |
Definition at line 92 of file CgmresSolver.h.
const Eigen::IOFormat nmpc_cgmres::CgmresSolver::vecfmt_dump_ = Eigen::IOFormat(Eigen::StreamPrecision, 0, ", ", ", ", "", "", "", "") |
Definition at line 108 of file CgmresSolver.h.
Eigen::VectorXd nmpc_cgmres::CgmresSolver::x_ |
Definition at line 82 of file CgmresSolver.h.
Eigen::MatrixXd nmpc_cgmres::CgmresSolver::x_list_ |
Definition at line 88 of file CgmresSolver.h.
Eigen::VectorXd nmpc_cgmres::CgmresSolver::x_with_delta_ |
Definition at line 86 of file CgmresSolver.h.