solprop.backends.numpy_ref.engines#

The reference’s Runge-Kutta engine over its workspace (SEP 52 section 5.2).

NumpyRungeKutta is the reference’s RungeKuttaEngine, the counterpart of native’s engines::ResidentRungeKutta: it forms an interaction-picture embedded Runge-Kutta trial from the workspace’s committed state and keeps the trial’s stages and end state until accept() finishes and commits it. A rejected trial leaves the committed state as it was. The reference’s other engines are the low-storage step (solprop.backends.low_storage.HostLowStorage) and the Adams history (solprop.backends.numpy_ref.multistep.HostHistory).

Classes

NumpyRungeKutta(workspace, tableau)

The interaction-picture embedded Runge-Kutta trial over a workspace.

class solprop.backends.numpy_ref.engines.NumpyRungeKutta(workspace, tableau)[source]#

Bases: object

The interaction-picture embedded Runge-Kutta trial over a workspace.

Every stage is evaluated. The tableau’s first-same-as-last property would let the last stage of one step serve as the first of the next, after rebasing it by exp(dPhi) because the interaction picture is re-anchored every step; the reference does not take that saving, so that no stage it uses depends on the bookkeeping of the step before (docs/dev/stepper.md section 10, trap 10).

Parameters:
workspacesolprop.backends.numpy_ref.workspace.NumpyWorkspace

The workspace whose state is stepped.

tableausolprop.stepper.tableau.Tableau

The embedded pair.

Attributes:
evaluationsint

Physical source evaluations of the trials since the engine was built, for one run, rejected trials included (SEP 30 records work rather than estimating it from steps).

accept(dz)[source]#

Finish the held trial and commit it as the workspace’s state.

Parameters:
dzfloat

The accepted step, m.

Returns:
solprop.backends.engines.AcceptRecord

The finish’s split collar’s sums.

extend(z, dz)[source]#

Hold the held trial’s continuous extension, before it is accepted.

With v0 the state at the step’s anchor, k_i its stage derivatives in the anchor’s frame and v1 = v0 + h sum_i b_i k_i, the coefficients are DOPRI5’s (Hairer, Noersett and Wanner, II.6): v0, v1 - v0, h k1 - (v1 - v0), (v1 - v0) - h k7 - (h k1 - (v1 - v0)) and h sum_i d_i k_i.

Parameters:
zfloat

Where the trial started, m.

dzfloat

The step, m.

property extension: tuple[float, float, list[ndarray]] | None[source]#

The held extension: its step’s start and length, m, and its coefficients.

property in_flight: bool[source]#

Whether a trial overwrote the committed state; never, on this engine.

reading()[source]#

Return the committed state’s boundary reading.

Returns:
solprop.backends.engines.BoundaryReading

The workspace’s reading.

property stages: list[Complex[ndarray, 'n_modes n_pol n_omega']][source]#

The held trial’s stage derivatives, in its anchor’s frame.

trial(z, dz)[source]#

Form a trial from the committed state at z over dz; return its norm.

A problem carrying linear.coupled_flow multiplies each stage’s scalar propagator by the section’s Schur matrix-function action; the two factors commute, so their product is the flow of the sum. A "frozen_residual" flow adds the explicit residual to each stage’s lab-frame source, before the interaction picture’s own factors carry it back, so it is integrated by the embedded pair exactly as the material response is.

Parameters:
zfloat

Where the trial starts, m.

dzfloat

The step, m, positive.

Returns:
float

The scaled error norm of the step’s embedded difference.

property trial_state: Complex[ndarray, 'n_modes n_pol n_omega'][source]#

The held trial’s raw end state, before the accepted step’s finish.