|
| 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...
|
|
template<std::size_t _Kmin = 5, std::size_t _Kmax = 10>
requires (_Kmin <= _Kmax)
class smooth::feedback::Mesh< _Kmin, _Kmax >
Collocation mesh of interval [0, 1].
- Template Parameters
-
_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.
Definition at line 62 of file mesh.hpp.
template<std::size_t _Kmin = 5, std::size_t _Kmax = 10>
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.
- Note
- Allocates heap memory for return value.
Definition at line 312 of file mesh.hpp.
template<std::size_t _Kmin = 5, std::size_t _Kmax = 10>
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.
- Note
- Allocates heap memory for return value.
-
Performs a matrix inverse.
Definition at line 387 of file mesh.hpp.
template<std::size_t _Kmin = 5, std::size_t _Kmax = 10>
Refine interval using the ph strategy.
- Parameters
-
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.
- Note
- May allocate heap memory due to vector resizing if the number of intervals is increased.
Definition at line 145 of file mesh.hpp.