Butcher Tableaux¶
Runge-Kutta tableaux. All shipped families are collocation methods, so A and b are determined by the nodes c; tests/test_tableau_order.py re-derives them and verifies the order conditions.
pinn_rk.tableau ¶
Classes¶
ButcherTableau
dataclass
¶
Butcher tableau for a q-stage RK method.
Source code in src\pinn_rk\tableau.py
Functions:¶
collocation_tableau ¶
collocation_tableau(
nodes: Sequence[float] | Tensor,
device: device = torch.device("cpu"),
) -> ButcherTableau
Build the collocation tableau determined by its nodes.
For a collocation method the Butcher coefficients are not free: given distinct nodes c, they are fixed by
a_ij = ∫_0^{c_i} L_j(s) ds, b_j = ∫_0^1 L_j(s) ds
with L_j the Lagrange basis on c. Gauss-Legendre, Radau IIA and Lobatto IIIA are all collocation families, differing only in where the nodes sit, so this reconstructs any of them from the nodes alone.
Useful directly for adding a new family, and used internally for q=4, where the A matrices have no workable closed form and writing out 16 coefficients apiece would be transcription risk with no benefit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes
|
sequence or Tensor of q distinct values in [0,1]
|
|
required |
device
|
torch device for the resulting tensors
|
|
device('cpu')
|
Returns:
| Type | Description |
|---|---|
ButcherTableau, already validated.
|
|
Source code in src\pinn_rk\tableau.py
butcher_gauss_legendre_q3 ¶
Gauss-Legendre, 3 stages, classical order 6, A-stable and symplectic.
Source code in src\pinn_rk\tableau.py
butcher_radau_iia_q3 ¶
Radau IIA, 3 stages, classical order 5, L-stable and stiffly accurate.
Source code in src\pinn_rk\tableau.py
butcher_lobatto_iiia_q3 ¶
Lobatto IIIA, 3 stages, classical order 4 (Simpson's rule), A-stable.
Source code in src\pinn_rk\tableau.py
butcher_gauss_legendre_q4 ¶
Gauss-Legendre, 4 stages, classical order 8, A-stable and symplectic.
Source code in src\pinn_rk\tableau.py
butcher_radau_iia_q4 ¶
Radau IIA, 4 stages, classical order 7, L-stable and stiffly accurate.
The interior nodes are roots of the third derivative of x^3 (x-1)^4 and have no closed form worth writing down, so they are given here to full double precision. To regenerate them, take that polynomial, differentiate three times, solve, and polish with Newton; the final node is exactly 1 by definition of Radau IIA.
Source code in src\pinn_rk\tableau.py
butcher_lobatto_iiia_q4 ¶
Lobatto IIIA, 4 stages, classical order 6, A-stable and stiffly accurate.