solprop.translate.plasma_integration#

The plasma column’s running-integral rule, designed once per grid (SEP 18).

The production field-grid plasma source integrates the exposure and free current along t. The physical polarisation returned by PlasmaResponse.evaluate adds a third integral; production uses the held-current spectral conversion (SEP 27). The plain cumulative trapezoid integrates a Fourier component exp(i omega t) with the multiplier rho(theta) = (theta/2) cot(theta/2) times the exact -i/omega, theta = omega dt, which on the default grid leaves the top of the active band 11 % short per integral. The band rule filters each integrand with symmetric taps c_0 ... c_K before the trapezoid, chosen so that the composite multiplier H = C rho, with C(theta) = c_0 + 2 sum_k c_k cos(k theta), is one to within DESIGN_TOLERANCE on [0, theta_b], theta_b = omega_max_window dt.

The design is hand-rolled numerics – a constrained least-squares fit and a certified extremum search – so it lives here in translation, and the physics layer only carries the result (solprop.nonlinear.ionisation.RunningIntegral). The rules, the certified ladder of designs and the evidence for each choice are in SEP 18, section 4.3; the manual page is docs/guide/media/field-plasma.md.

Module Attributes

DESIGN_TOLERANCE

The bound on |H - 1| in band; the smallest K meeting it is chosen.

MAX_HALF_WIDTH

The largest K tried; a grid no design up to it can serve is refused.

ABOVE_BAND_BOUND

The bound on |H| from the band edge to Nyquist: at most 5 % amplification of content above the band relative to the exact integral.

FIT_NODES

Uniform least-squares nodes on [0, theta_b], zero included, unit weights.

CERTIFICATION_SAMPLES

Independent samples of the certified maxima, refined by a bounded scalar search.

CERTIFICATION_XATOL

Absolute tolerance in theta of the refinement of each sampled local maximum.

CONDITION_LIMIT

The largest scaled condition number of an admitted fit; no admitted grid nears it.

Functions

design_running_integral(grid, policy)

Return the running-integral rule a plasma column on grid uses.

integration_record(rule)

Return the record of a running-integral rule a saved run carries (SEP 18, Q9).

trapezoid_multiplier(theta)

Return the trapezoid's multiplier relative to the exact integral.

solprop.translate.plasma_integration.ABOVE_BAND_BOUND: Final = 1.05#

The bound on |H| from the band edge to Nyquist: at most 5 % amplification of content above the band relative to the exact integral.

solprop.translate.plasma_integration.CERTIFICATION_SAMPLES: Final = 8193#

Independent samples of the certified maxima, refined by a bounded scalar search.

solprop.translate.plasma_integration.CERTIFICATION_XATOL: Final = 1e-12#

Absolute tolerance in theta of the refinement of each sampled local maximum.

solprop.translate.plasma_integration.CONDITION_LIMIT: Final = 10000000000.0#

The largest scaled condition number of an admitted fit; no admitted grid nears it.

solprop.translate.plasma_integration.DESIGN_TOLERANCE: Final = 1e-05#

The bound on |H - 1| in band; the smallest K meeting it is chosen.

solprop.translate.plasma_integration.FIT_NODES: Final = 4097#

Uniform least-squares nodes on [0, theta_b], zero included, unit weights.

solprop.translate.plasma_integration.MAX_HALF_WIDTH: Final = 8#

The largest K tried; a grid no design up to it can serve is refused.

solprop.translate.plasma_integration.design_running_integral(grid, policy)[source]#

Return the running-integral rule a plasma column on grid uses.

The only producer of a band rule. Its taps depend on the fine sample spacing and the upper edge of the apodised window alone, so the design is cached on those two numbers and every problem on one grid shares one rule.

Parameters:
gridsolprop.grid.TimeGrid

The field grid; its dt_fine and omega_max_window set theta_b.

policy{‘band’, ‘trapezoid’}

The rule requested by the plasma responses.

Returns:
RunningIntegral

The trapezoid, or the certified band design with the smallest K.

Raises:
TranslationError

If no design up to MAX_HALF_WIDTH meets DESIGN_TOLERANCE and ABOVE_BAND_BOUND, which happens below an oversampling factor of about 3.55; the message names the achieved error and the two ways out.

Examples

>>> from solprop.grid import FieldGrid
>>> from solprop.translate.plasma_integration import design_running_integral
>>> grid = FieldGrid.from_limits(1.0, 800e-9, (90e-9, 4e-6), 400e-15)
>>> rule = design_running_integral(grid, "band")
>>> rule.half_width, rule.certified_error < 1e-5
(4, True)
solprop.translate.plasma_integration.integration_record(rule)[source]#

Return the record of a running-integral rule a saved run carries (SEP 18, Q9).

Every field of the rule at full precision – the taps as Python floats, which survive the JSON round trip bit for bit – with the derived theta_b and K, so that a saved file says how its plasma was integrated without being translated again, and a resume that would integrate differently is refused by the configuration hash.

Parameters:
rulesolprop.nonlinear.ionisation.RunningIntegral

The problem’s rule.

Returns:
dict

The record, plain Python values only.

Examples

>>> from solprop.nonlinear.ionisation import RunningIntegral
>>> from solprop.translate.plasma_integration import integration_record
>>> integration_record(RunningIntegral.trapezoid())["policy"]
'trapezoid'
solprop.translate.plasma_integration.trapezoid_multiplier(theta)[source]#

Return the trapezoid’s multiplier relative to the exact integral.

(theta/2) cot(theta/2), with its series 1 - theta^2/12 - theta^4/720 below 1e-4, where the closed form loses digits.

Parameters:
thetanumpy.ndarray

omega dt, in [0, pi].

Returns:
numpy.ndarray

The multiplier, the shape of theta; one at zero and zero at Nyquist.

Examples

>>> import numpy as np
>>> from solprop.translate.plasma_integration import trapezoid_multiplier
>>> f"{trapezoid_multiplier(np.array(np.pi / 3)):.6f}"
'0.906900'