smooth_feedback
Control and estimation on Lie groups
|
Collocation mesh of interval [0, 1]. More...
#include <mesh.hpp>
Public Member Functions | |
Mesh () | |
Create a mesh consisting of a single interval [0, 1]. More... | |
Mesh (const std::size_t n, const std::size_t k=Kmin) | |
Create a mesh consisting of a n intervals of equal size over [0, 1]. More... | |
std::size_t | N_ivals () const |
Number of intervals in mesh. More... | |
std::size_t | N_colloc () const |
Number of collocation points in mesh. More... | |
std::size_t | N_colloc_ival (std::size_t i) const |
Number of collocation points in interval i. More... | |
void | refine_ph (std::size_t i, std::size_t D) |
Refine interval using the ph strategy. More... | |
void | refine_errors (std::ranges::sized_range auto &&errs, double target_err) |
Refine intervals in mesh to satisfy a target error criterion. More... | |
void | set_N_colloc_ival (std::size_t i, std::size_t K) |
Set the number of collocation points in interval i to K. More... | |
auto | interval_nodes (std::size_t i) const |
Interval nodes (as range of doubles). More... | |
auto | all_nodes () const |
Nodes (as range of doubles). More... | |
auto | interval_weights (std::size_t i) const |
Interval weights (as range of doubles) More... | |
auto | all_weights () const |
Weights (as range of doubles) More... | |
Eigen::MatrixXd | interval_diffmat (std::size_t i) const |
Interval differentiation matrix w.r.t. [0, 1] timescale. More... | |
std::pair< double, MatMap > | interval_diffmat_unscaled (std::size_t i) const |
Interval differentiation matrix (unscaled). More... | |
Eigen::MatrixXd | interval_intmat (std::size_t i) const |
Interval integration matrix w.r.t. [0, 1] timescale. More... | |
std::size_t | interval_find (double t) const |
Find interval index that contains t. More... | |
void | increase_degrees () |
Increase the degree of all intervals by one (up to maximal degree Kmax + 1) More... | |
void | decrease_degrees () |
Decrease the degree of all intervals by one (down to minimal degree Kmin) More... | |
template<smooth::RnType RetT> | |
RetT | eval (double t, std::ranges::range auto &&r, std::size_t p=0, bool extend=true) const |
Evaluate a function. More... | |
Static Public Attributes | |
static constexpr auto | Kmin = _Kmin |
Minimal number of collocation points per interval. More... | |
static constexpr auto | Kmax = _Kmax |
Maximal number of collocation points per interval. More... | |
Collocation mesh of interval [0, 1].
_Kmin | minimal number of collocation points per interval |
_Kmax | maximal number of collocation points per interval |
[0, 1] is divided into non-overlapping intervals I_i, and each interval I_i has K_i LGR collocation points.
|
inline |
Create a mesh consisting of a single interval [0, 1].
Kmin | minimal polynomial degree in mesh |
Kmax | maximal polynomial degree in mesh |
|
inline |
|
inline |
Nodes (as range of doubles).
|
inline |
Weights (as range of doubles)
|
inline |
|
inline |
|
inline |
|
inline |
Interval differentiation matrix w.r.t. [0, 1] timescale.
Returns a \( (K+1 \times K) \) matrix \( D \) s.t.
\[ \begin{bmatrix} y'(\tau_{i, 0}) & y'(\tau_{i, 1}) & \cdots & y'(\tau_{i, K-1}) \end{bmatrix} = \begin{bmatrix} y(\tau_{i, 0}) & y(\tau_{i, 1}) & \cdots & y(\tau_{i, K}) \end{bmatrix} D \]
, where \( y(\cdot) \in \mathbb{R}^{d \times 1} \) is a Lagrange polynomial in interval i.
|
inline |
Interval differentiation matrix (unscaled).
Returns a Map D_us and a scalar alpha s.t. D = alpha * D_us
|
inline |
|
inline |
Interval integration matrix w.r.t. [0, 1] timescale.
Returns a \( (K \times K) \) matrix \( I \) s.t.
\[ \begin{bmatrix} y(\tau_{i, 1}) & y(\tau_{i, 2}) & \cdots & y(\tau_{i, K}) \end{bmatrix} = y(\tau_{i, 0}) \begin{bmatrix} 1 & \ldots & 1 \end{bmatrix} + \begin{bmatrix} \dot y(\tau_{i, 0}) & \dot y(\tau_{i, 1}) & \cdots & \dot y(\tau_{i, K-1}) \end{bmatrix} I \]
, where \( y(\cdot) \in \mathbb{R}^{d \times 1} \) is a Lagrange polynomial in interval i.
|
inline |
Interval nodes (as range of doubles).
|
inline |
Interval weights (as range of doubles)
|
inline |
|
inline |
|
inline |
|
inline |
Refine intervals in mesh to satisfy a target error criterion.
errs | relative errors for all intervals ( |
target_err | target relative error |
|
inline |
Refine interval using the ph strategy.
i | index of interval to refine |
D | target number of collocation points in refined interval |
If D > Kmax, or current degree > Kmax then the interval is divided into n = max(2, ceil(D / Kmin)) intervals with deg Kmin If D < current degree, then nothing is done. If D <= Kmax, then the polynomial degree is increased to D.
|
inline |
|
staticconstexpr |
|
staticconstexpr |