9#include "akreon/convex/composed/quad_form.hpp"
10#include "akreon/convex/composed/weighted_sum.hpp"
11#include "akreon/convex/convex_problem.hpp"
12#include "akreon/convex/intersection.hpp"
13#include "akreon/convex/variable.hpp"
35template <ContinuousPlantModelLike Plant, std::
size_t N>
37 using Model = linalg::remove_cvref_t<Plant>;
64 template <convex::AtomLike ZVar>
78 template <convex::AtomLike ZVar>
81 static_assert(convex::is_var_type_v<ZVar>,
"Input atom is not a var");
82 using ZDom = convex::meta_dom_t<convex::atom_meta_t<ZVar>>;
83 static_assert(convex::dom_vartype_v<ZDom> == convex::VarType::FREE,
84 "Merged decision var must be free");
85 using ZVarSpace = convex::dom_space_t<ZDom>;
86 static_assert(std::same_as<ZVarSpace, ZSpace>,
87 "Expected merged decision size [svec(P); vec(Y)]");
96 std::index_sequence<
Is...>) {
97 return convex::Intersection(
p_lmi,
130template <ContinuousPlantModelLike Plant, std::
size_t N, convex::AtomLike ZVar>
140 linalg::Vector<T, PSF::ZDim>
c{};
141 for (std::size_t
i = 0;
i < PSF::PDim; ++
i)
c(
i) = p_weights(
i);
142 for (std::size_t
i = 0;
i < PSF::YDim; ++
i)
c(PSF::PDim +
i) = y_weights(
i);
144 return convex::make_weighted_sum(
c,
Z);
158template <ContinuousPlantModelLike Plant, std::
size_t N, convex::AtomLike ZVar>
166 return convex::make_quad_form(
P,
q,
Z);
179template <ContinuousPlantModelLike Plant, std::
size_t N, convex::AtomLike ZVar>
181 const linalg::Vector<Plant, N>&
poly,
const ZVar&
Z,
const auto&
obj,
184 return convex::make_problem(
Z).in_set(
pldi).minimize(
obj);
196template <ContinuousPlantModelLike Plant, std::
size_t N, convex::AtomLike ZVar>
198 const linalg::Vector<Plant, N>&
poly,
const ZVar&
Z,
201 return convex::make_problem(
Z).in_set(
pldi).feasibility();
constexpr bool is_continuous_v
check if continuous or not
constexpr auto make_polytopic_state_feedback_linear_objective(const linalg::Vector< plant_type_t< Plant >, PolytopicStateFeedback< Plant, N >::PDim > &p_weights, const linalg::Vector< plant_type_t< Plant >, PolytopicStateFeedback< Plant, N >::YDim > &y_weights, const ZVar &Z)
make linear objective over merged PLDI variable
typename plant_traits< linalg::remove_cvref_t< Plant > >::T plant_type_t
extract scalar type from plant
constexpr auto make_polytopic_state_feedback_problem(const linalg::Vector< Plant, N > &poly, const ZVar &Z, const auto &obj, plant_type_t< Plant > margin=1e-6)
make PLDI problem with objective
constexpr auto make_polytopic_state_feedback_quadratic_objective(const linalg::Matrix< plant_type_t< Plant >, PolytopicStateFeedback< Plant, N >::ZDim, PolytopicStateFeedback< Plant, N >::ZDim > &P, const linalg::Vector< plant_type_t< Plant >, PolytopicStateFeedback< Plant, N >::ZDim > &q, const ZVar &Z)
make quadratic objective over merged PLDI variable
static constexpr std::size_t YDim
typename VertexFeedback::KMat KMat
typename VertexFeedback::Fs Fs
typename VertexFeedback::FMat FMat
static constexpr std::size_t PDim
constexpr auto operator()(const Polytope &poly, const ZVar &Z, T margin=1e-6) const
operator overload (form polytopic state feedback)
typename VertexFeedback::PMat PMat
static constexpr std::size_t StateDim
StateFeedback< Model > VertexFeedback
typename VertexFeedback::ZSpace ZSpace
constexpr auto apply(const Polytope &poly, const ZVar &Z, T margin=1e-6) const
apply (polytopic state feedback)
linalg::remove_cvref_t< Plant > Model
typename VertexFeedback::YMat YMat
linalg::Vector< Plant, N > Polytope
static constexpr std::size_t InputDim
constexpr auto K(const PMat &P, const YMat &Y) const
K.
static constexpr std::size_t ZDim
linalg::Matrix< T, StateDim, StateDim > PMat
static constexpr std::size_t StateDim
linalg::RowVector< T, ZDim > ZSpace
static constexpr std::size_t PDim
static constexpr std::size_t ZDim
static constexpr std::size_t InputDim
linalg::Matrix< T, InputDim, StateDim > KMat
linalg::Matrix< T, InputDim, StateDim > YMat
linalg::Vector< FMat, ZDim > Fs
static constexpr std::size_t YDim