cyqlone develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
Loading...
Searching...
No Matches
Optimal control problem formulations

Detailed Description

Data structures for different formulations of optimal control problems.

Files

file  conversion.hpp
 Conversion utilities for optimal control problems.
file  cyqlone-storage.hpp
 Data structure for optimal control problems where the initial states are eliminated.
file  ocp.hpp
 Data structure for optimal control problems.

Classes

struct  cyqlone::LinearOCPSparseQP
 Represents a sparse multiple shooting formulation of the standard optimal control problem. More...
struct  cyqlone::CyqloneStorage< T >
 Storage for a linear-quadratic OCP with the initial states x₀ eliminated. More...
struct  cyqlone::OCPDim
 Dimensions of an optimal control problem. More...
struct  cyqlone::LinearOCPStorage
 Storage for a linear-quadratic OCP of the form. More...

Functions

void cyqlone::reference_to_gradient (const LinearOCPStorage &ocp, std::span< const real_t > ref, std::span< real_t > qr)
 Simply computes the gradient of the quadratic cost \( J(x, u) = \sum_{j=1}^{N-1} \ell_j(x^j, u^j) + \ell_N(x^N) \), with \( \ell_j(x, u) = \tfrac12 \left\| \begin{pmatrix} x - x^j_\text{ref} \\ u - u^j_\text{ref} \end{pmatrix} \right\|_{H_j}^2 \), with the Hessian \( H_j = \begin{pmatrix} Q_j & S_j^\top \\ S_j & R_j \end{pmatrix} \).
LinearOCPStorage cyqlone::generate_random_ocp (OCPDim dim, uint_fast32_t seed=0)
 Generates a random linear OCP with the given dimensions and random seed.

Function Documentation

◆ reference_to_gradient()

void cyqlone::reference_to_gradient ( const LinearOCPStorage & ocp,
std::span< const real_t > ref,
std::span< real_t > qr )

#include <cyqlone/conversion.hpp>

Simply computes the gradient of the quadratic cost \( J(x, u) = \sum_{j=1}^{N-1} \ell_j(x^j, u^j) + \ell_N(x^N) \), with \( \ell_j(x, u) = \tfrac12 \left\| \begin{pmatrix} x - x^j_\text{ref} \\ u - u^j_\text{ref} \end{pmatrix} \right\|_{H_j}^2 \), with the Hessian \( H_j = \begin{pmatrix} Q_j & S_j^\top \\ S_j & R_j \end{pmatrix} \).

Stores \( \nabla J(0, 0) \) to qr.

Definition at line 9 of file conversion.cpp.

◆ generate_random_ocp()

LinearOCPStorage cyqlone::generate_random_ocp ( OCPDim dim,
uint_fast32_t seed = 0 )
inline

#include <cyqlone/random-ocp.hpp>

Generates a random linear OCP with the given dimensions and random seed.

Definition at line 11 of file random-ocp.hpp.