solprop.backends.numpy_ref.adams_tables#
The coefficient tables of an Adams trial (SEP 13, SEP 16, ADR-042).
Every weight an Adams trial applies depends only on the history’s normalised nodes and
the orders it scores, never on the state. The interaction formulation integrates its
interpolants: defect_rows() (each scored order’s corrector less predictor, and the
step’s own corrector) and fused_tables(). The exponential formulation works in the
monomial basis of its moments: exponential_corrector() and
exponential_rows(), and for native’s factored defects
factored_defect_rows(); compensation_tables() are a varying operator’s
transported compensation, and exponential_tables() and trial_tables() gather
them as native’s march forms them in C++. The reference’s engines
(multistep) read these with the plain basis; native’s
parity tests read them with its own (helpers).
Functions
|
Return a trial's transported-compensation tables. |
|
Return each order's defect weights and the step's own corrector weights. |
|
Return the step's own corrector's Lagrange coefficients, padded to width. |
|
Return each order's defect coefficients in the monomial basis. |
|
Return an exponential trial's coefficient tables. |
|
Return each exponential defect factored: a divided difference and a polynomial. |
|
Return an interaction-formulation trial's coefficient tables, as one record. |
|
Return all of an exponential trial's coefficient tables, as native reads them. |
- solprop.backends.numpy_ref.adams_tables.compensation_tables(nodes, order, orders, *, helpers=Helpers(name='plain'))[source]#
Return a trial’s transported-compensation tables.
The weights the reference’s compensation applies (SEP 16 section 4.2, ADR-042), over the carried rows
exp((1 - theta_j) x) (D(z_j) - x / h) u_jof the history samples and the endpoint term(D(z + h) - x / h) u_pred, each sum still to be multiplied by the step.- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderint
The step’s order.
- orderslist of int
The orders scored, the step’s own first.
- helperssolprop._helpers.Helpers, optional
The implementation of the Adams basis; the plain forms by default.
- Returns:
- tuple
The spans
1 - theta_jof thewidth - 1carried samples; the predictor’s weights over theordernewest of them; the corrector’s over(endpoint, newest, ...); and each scored order’s defect weights over the same, shape(len(orders), width), withwidth = 1 + max(orders).
- solprop.backends.numpy_ref.adams_tables.defect_rows(nodes, orders, *, helpers=Helpers(name='plain'))[source]#
Return each order’s defect weights and the step’s own corrector weights.
Over
(source, newest, ...), orderk’s defect is itsk + 1-node corrector through the new source less itsk-node predictor, as integrated weights of the interaction formulation.- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderslist of int
The orders scored, the step’s own first.
- helperssolprop._helpers.Helpers, optional
The implementation of the Adams basis; the plain forms by default.
- Returns:
- rowsnumpy.ndarray
The defect rows, shape
(len(orders), 1 + max(orders)).- correctornumpy.ndarray
The step’s own corrector weights, zero past its nodes.
- solprop.backends.numpy_ref.adams_tables.exponential_corrector(nodes, order, width, *, helpers=Helpers(name='plain'))[source]#
Return the step’s own corrector’s Lagrange coefficients, padded to width.
- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderint
The step’s order.
- widthint
1 + max(orders).- helperssolprop._helpers.Helpers, optional
The implementation of the Adams basis; the plain forms by default.
- Returns:
- numpy.ndarray
The coefficients over
X = (source, newest, ...), shape(width, width), zero past its nodes.
- solprop.backends.numpy_ref.adams_tables.exponential_rows(nodes, orders, width, *, helpers=Helpers(name='plain'))[source]#
Return each order’s defect coefficients in the monomial basis.
Over
X = (source, newest, ...)in the monomial basis of the moments, orderk’s defect is itsk + 1-node corrector through the new source less itsk-node predictor, as fordefect_rows(); the weights are the Lagrange coefficients, which the trial’s moments turn into exponential weights.- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderslist of int
The orders scored, the step’s own first.
- widthint
1 + max(orders).- helperssolprop._helpers.Helpers, optional
The implementation of the Adams basis; the plain forms by default.
- Returns:
- numpy.ndarray
The defect rows, shape
(len(orders), width, width).
- solprop.backends.numpy_ref.adams_tables.exponential_tables(nodes, order, orders, *, helpers=Helpers(name='plain'))[source]#
Return an exponential trial’s coefficient tables.
What
ExponentialHistory’s trial forms, but for the defects, which the reference applies in the monomial basis (exponential_rows()) and native in the factored form.- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderint
The step’s order.
- orderslist of int
The orders scored, the step’s own first.
- helperssolprop._helpers.Helpers, optional
The implementation of the Adams basis; the plain forms by default.
- Returns:
- tuple
The predictor’s Lagrange coefficients over the
ordernewest rows, shape(order, order); the corrector’s over(source, newest, ...), shape(width, width)withwidth = 1 + max(orders); and the factored defect rows offactored_defect_rows().
- solprop.backends.numpy_ref.adams_tables.factored_defect_rows(nodes, orders, width)[source]#
Return each exponential defect factored: a divided difference and a polynomial.
Order
k’s defect, itsk + 1-node corrector through the new sample less itsk-node predictor, vanishes at the predictor’s nodes, so it isf[1, theta_0, ..., theta_{k-1}] prod_{j<k} (theta - theta_j): one divided difference of the samples times one polynomial, whose integral against the flow is one combination of the moments. That is2 (k + 1)products an element instead of(k + 1) n_k, the monomial rows ofexponential_rows().- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderslist of int
The orders scored, the step’s own first.
- widthint
1 + max(orders): the samples and the moments of the trial.
- Returns:
- numpy.ndarray
Shape
(len(orders), 2 width): the divided-difference coefficients over(source, newest, ...), then the node polynomial’s ascending monomial coefficients.
- solprop.backends.numpy_ref.adams_tables.fused_tables(nodes, order, orders, *, helpers=Helpers(name='plain'))[source]#
Return an interaction-formulation trial’s coefficient tables, as one record.
What
InteractionHistory’s trial forms; native’s march forms the same tables in C++, and its parity tests read them here.- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderint
The step’s order.
- orderslist of int
The orders scored, the step’s own first.
- helperssolprop._helpers.Helpers, optional
The implementation of the Adams basis; the plain forms by default.
- Returns:
- tuple
The predictor’s integrated weights over the
ordernewest rows; the corrector’s weights over(source, newest, ...), zero past its nodes; and one defect row per scored order over the same samples.
- solprop.backends.numpy_ref.adams_tables.trial_tables(nodes, order, orders, *, compensated, helpers=Helpers(name='plain'))[source]#
Return all of an exponential trial’s coefficient tables, as native reads them.
exponential_tables()’ three and, compensated,compensation_tables()’ four, composed over the record’s basis, read once a trial instead of from a dozen small calls. The native march forms the same tables in C++ with the same operations in the same order.- Parameters:
- nodeslist of float
The history’s normalised positions, newest first.
- orderint
The step’s order.
- orderslist of int
The orders scored, the step’s own first.
- compensatedbool
Whether the trial carries a varying operator’s transported compensation.
- helperssolprop._helpers.Helpers, optional
The implementation of the Adams basis; the plain forms by default.
- Returns:
- tuple
The predictor, the corrector and the factored defect rows; then the compensation’s spans, predictor, corrector and defect rows, shapes
(0,)and(0, 0)when not compensated.