Interpolants¶
Barycentric Lagrange machinery behind the polynomial time reconstruction, including the differentiation matrix.
pinn_rk.interpolants ¶
Functions:¶
barycentric_weights ¶
Compute first-form barycentric weights for Lagrange interpolation. Complexity O(q^2), stable for small q (as here).
Source code in src\pinn_rk\interpolants.py
lagrange_eval ¶
Evaluate Lagrange basis at t using first-form barycentric formula.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
Tensor [...], evaluation points
|
|
required |
nodes
|
Tensor [q], interpolation nodes
|
|
required |
w
|
Tensor [q], barycentric weights
|
|
required |
Returns:
| Type | Description |
|---|---|
Tensor [..., q] : basis weights ℓ_j(t)
|
|
Source code in src\pinn_rk\interpolants.py
differentiation_matrix ¶
Build the barycentric differentiation matrix for the given interpolation nodes.
Returns D with D[i, j] = ℓ_j'(t_i), so that for values u sampled at
nodes, D @ u is the derivative of the interpolating polynomial evaluated
at those same nodes. This is exact for polynomials of degree ≤ q-1.
Off-diagonal entries follow the standard barycentric identity
D[i, j] = (w_j / w_i) / (t_i - t_j); the diagonal is set by the negative
row sum, which enforces exactness on constants.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes
|
Tensor [q], interpolation nodes, pairwise distinct
|
|
required |
w
|
Tensor [q], optional precomputed barycentric weights
|
|
None
|
Returns:
| Type | Description |
|---|---|
Tensor [q, q] : differentiation matrix
|
|