Go to the documentation of this file.
25 #ifndef SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_EDGES_TRAPEZOIDAL_COLLOCATION_EDGES_H_
26 #define SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_EDGES_TRAPEZOIDAL_COLLOCATION_EDGES_H_
40 class TrapezoidalCollocationDynamicsOnlyEdge :
public Edge<VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex>
43 using Ptr = std::shared_ptr<TrapezoidalCollocationDynamicsOnlyEdge>;
44 using UPtr = std::unique_ptr<TrapezoidalCollocationDynamicsOnlyEdge>;
47 VectorVertex& x2, ScalarVertex& dt)
48 :
Edge<VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex>(x1, u1, u2, x2, dt),
_dynamics(dynamics)
59 bool isLinear()
const override {
return false; }
98 using Ptr = std::shared_ptr<TrapezoidalCollocationIntegralCostEdge>;
99 using UPtr = std::unique_ptr<TrapezoidalCollocationIntegralCostEdge>;
103 :
Edge<
VectorVertex,
VectorVertex,
VectorVertex,
VectorVertex,
ScalarVertex>(x1, u1, u2, x2, dt),
_stage_cost(stage_cost),
_k(k)
106 assert(stage_cost->getIntegralStateControlTermDimension(
_k) == 1);
118 bool isLinear()
const override {
return false; }
151 using Ptr = std::shared_ptr<TrapezoidalCollocationIntegralEqualityDynamicsEdge>;
152 using UPtr = std::unique_ptr<TrapezoidalCollocationIntegralEqualityDynamicsEdge>;
179 bool isLinear()
const override {
return false; }
186 const VectorVertex* x1 =
static_cast<const VectorVertex*
>(
_vertices[0]);
187 const VectorVertex* u1 =
static_cast<const VectorVertex*
>(
_vertices[1]);
188 const VectorVertex* u2 =
static_cast<const VectorVertex*
>(
_vertices[2]);
189 const VectorVertex* x2 =
static_cast<const VectorVertex*
>(
_vertices[3]);
190 const ScalarVertex* dt =
static_cast<const ScalarVertex*
>(
_vertices[4]);
195 values.head(
_dim_dyn).noalias() = 0.5 * dt->value() * (
_f1 +
_f2) - (x2->values() - x1->values());
199 _stage_eq->computeIntegralStateControlTerm(
_k, x1->values(), u1->values(),
_eq1);
200 _stage_eq->computeIntegralStateControlTerm(
_k, x2->values(), u2->values(),
_eq2);
214 Eigen::VectorXd
_eq1;
215 Eigen::VectorXd
_eq2;
229 using Ptr = std::shared_ptr<TrapezoidalCollocationIntegralEqualityEdge>;
230 using UPtr = std::unique_ptr<TrapezoidalCollocationIntegralEqualityEdge>;
234 :
Edge<
VectorVertex,
VectorVertex,
VectorVertex,
VectorVertex,
ScalarVertex>(x1, u1, u2, x2, dt),
_stage_eq(stage_eq),
_k(k)
271 Eigen::VectorXd
_eq1;
272 Eigen::VectorXd
_eq2;
283 using Ptr = std::shared_ptr<TrapezoidalCollocationIntegralInequalityEdge>;
284 using UPtr = std::unique_ptr<TrapezoidalCollocationIntegralInequalityEdge>;
288 :
Edge<VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex>(x1, u1, u2, x2, dt),
_stage_ineq(stage_ineq),
_k(k)
337 #endif // SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_EDGES_TRAPEZOIDAL_COLLOCATION_EDGES_H_
void computeValues(Eigen::Ref< Eigen::VectorXd > values) override
Compute function values.
TrapezoidalCollocationIntegralCostEdge(VectorVertex &x1, VectorVertex &u1, VectorVertex &u2, VectorVertex &x2, ScalarVertex &dt, StageCost::Ptr stage_cost, int k)
bool isLeastSquaresForm() const override
Defines if the edge is formulated as Least-Squares form.
TrapezoidalCollocationIntegralInequalityEdge(VectorVertex &x1, VectorVertex &u1, VectorVertex &u2, VectorVertex &x2, ScalarVertex &dt, StageInequalityConstraint::Ptr stage_ineq, int k)
bool isLinear() const override
Return true if the edge is linear (and hence its Hessian is always zero)
TrapezoidalCollocationDynamicsOnlyEdge(SystemDynamicsInterface::Ptr dynamics, VectorVertex &x1, VectorVertex &u1, VectorVertex &u2, VectorVertex &x2, ScalarVertex &dt)
int getDimension() const override
Get dimension of the edge (dimension of the cost-function/constraint value vector)
std::unique_ptr< TrapezoidalCollocationDynamicsOnlyEdge > UPtr
bool isLinear() const override
Return true if the edge is linear (and hence its Hessian is always zero)
std::unique_ptr< TrapezoidalCollocationIntegralEqualityDynamicsEdge > UPtr
std::shared_ptr< StageInequalityConstraint > Ptr
StageEqualityConstraint::Ptr _stage_eq
bool isLeastSquaresForm() const override
Defines if the edge is formulated as Least-Squares form.
bool isLinear() const override
Return true if the edge is linear (and hence its Hessian is always zero)
bool isLeastSquaresForm() const override
Defines if the edge is formulated as Least-Squares form.
StageEqualityConstraint::Ptr _stage_eq
int getDimension() const override
Get dimension of the edge (dimension of the cost-function/constraint value vector)
virtual ~TrapezoidalCollocationIntegralEqualityDynamicsEdge()=default
std::unique_ptr< TrapezoidalCollocationIntegralCostEdge > UPtr
std::shared_ptr< StageCost > Ptr
const Eigen::VectorXd & values() const
Read-access to the underlying value vector.
void computeValues(Eigen::Ref< Eigen::VectorXd > values) override
Compute function values.
virtual ~TrapezoidalCollocationIntegralCostEdge()=default
virtual ~TrapezoidalCollocationDynamicsOnlyEdge()=default
bool isLinear() const override
Return true if the edge is linear (and hence its Hessian is always zero)
bool isLeastSquaresForm() const override
Defines if the edge is formulated as Least-Squares form.
TrapezoidalCollocationIntegralEqualityEdge(VectorVertex &x1, VectorVertex &u1, VectorVertex &u2, VectorVertex &x2, ScalarVertex &dt, StageEqualityConstraint::Ptr stage_eq, int k)
TrapezoidalCollocationIntegralEqualityDynamicsEdge(SystemDynamicsInterface::Ptr dynamics, VectorVertex &x1, VectorVertex &u1, VectorVertex &u2, VectorVertex &x2, ScalarVertex &dt, StageEqualityConstraint::Ptr stage_eq, int k)
bool isLeastSquaresForm() const override
Defines if the edge is formulated as Least-Squares form.
void computeValues(Eigen::Ref< Eigen::VectorXd > values) override
Compute function values.
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
std::shared_ptr< SystemDynamicsInterface > Ptr
std::shared_ptr< TrapezoidalCollocationIntegralCostEdge > Ptr
void computeValues(Eigen::Ref< Eigen::VectorXd > values) override
Compute function values.
std::shared_ptr< TrapezoidalCollocationDynamicsOnlyEdge > Ptr
A matrix or vector expression mapping an existing expression.
const double & value() const
Get underlying value.
std::shared_ptr< TrapezoidalCollocationIntegralEqualityDynamicsEdge > Ptr
bool isLinear() const override
Return true if the edge is linear (and hence its Hessian is always zero)
virtual ~TrapezoidalCollocationIntegralInequalityEdge()=default
int getDimension() const override
Get dimension of the edge (dimension of the cost-function/constraint value vector)
int getDimension() const override
Get dimension of the edge (dimension of the cost-function/constraint value vector)
Vertex implementation for scalar values.
SystemDynamicsInterface::Ptr _dynamics
SystemDynamicsInterface::Ptr _dynamics
StageCost::Ptr _stage_cost
Templated base edge class that stores an arbitary number of value.
Vertex implementation that stores an Eigen::VectorXd (dynamic dimension)
int getDimension() const override
Get dimension of the edge (dimension of the cost-function/constraint value vector)
std::unique_ptr< TrapezoidalCollocationIntegralInequalityEdge > UPtr
std::shared_ptr< TrapezoidalCollocationIntegralInequalityEdge > Ptr
StageInequalityConstraint::Ptr _stage_ineq
std::shared_ptr< StageEqualityConstraint > Ptr
virtual ~TrapezoidalCollocationIntegralEqualityEdge()=default
void computeValues(Eigen::Ref< Eigen::VectorXd > values) override
Compute function values.
const VertexContainer _vertices
Vertex container.
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:07:08