smooth_feedback
Control and estimation on Lie groups
Loading...
Searching...
No Matches
Functions
ocp_to_qp.hpp File Reference

Formulate optimal control problem as a quadratic program. More...

#include <Eigen/Core>
#include <smooth/diff.hpp>
#include "collocation/mesh.hpp"
#include "collocation/mesh_function.hpp"
#include "ocp.hpp"
#include "qp.hpp"
Include dependency graph for ocp_to_qp.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<diff::Type DT = diff::Type::Default>
QuadraticProgramSparse< double > smooth::feedback::ocp_to_qp (const OCPType auto &ocp, const MeshType auto &mesh, double tf, auto &&xl_fun, auto &&ul_fun)
 Formulate an optimal control problem as a quadratic program via linearization. More...
 
auto smooth::feedback::qpsol_to_ocpsol (const OCPType auto &ocp, const MeshType auto &mesh, const QPSolution<-1, -1, double > &qpsol, double tf, auto &&xl_fun, auto &&ul_fun)
 Convert QP solution to OCP solution. More...
 

Detailed Description

Formulate optimal control problem as a quadratic program.

Definition in file ocp_to_qp.hpp.

Function Documentation

◆ ocp_to_qp()

template<diff::Type DT = diff::Type::Default>
QuadraticProgramSparse< double > smooth::feedback::ocp_to_qp ( const OCPType auto &  ocp,
const MeshType auto &  mesh,
double  tf,
auto &&  xl_fun,
auto &&  ul_fun 
)

Formulate an optimal control problem as a quadratic program via linearization.

/**

Parameters
ocpinput problem
meshtime discretization
tftime horizon
xl_funstate linearization (must be differentiable w.r.t. time)
ul_funinput linearization
Returns
sparse quadratic program for a flattened formulation of ocp.
Note
allocates memory for each call. To reduce memory allocation for repeated calls, see ocp_to_qp_allocate() and ocp_to_qp_update().
See also
qpsol_to_ocpsol()

Definition at line 423 of file ocp_to_qp.hpp.

◆ qpsol_to_ocpsol()

auto smooth::feedback::qpsol_to_ocpsol ( const OCPType auto &  ocp,
const MeshType auto &  mesh,
const QPSolution<-1, -1, double > &  qpsol,
double  tf,
auto &&  xl_fun,
auto &&  ul_fun 
)

Convert QP solution to OCP solution.

If qp_sol solves a QP obtained via ocp_to_qp(), then qpsol_to_ocpsol(qp_sol) is the corrensponding OCP solution.

Parameters
ocpoptimal control problem
meshdiscretization mesh
qpsolsolution to quadratic program obtained via ocp_to_qp()
tffinal time used in ocp_to_qp()
xl_funstate linearization trajectory used in ocp_to_qp()
ul_funinput linearization trajectory used in ocp_to_qp()
See also
ocp_to_qp()

Definition at line 452 of file ocp_to_qp.hpp.