zoomy_core.analysis.reduce_pencil module#
Generic singular-pencil reduction for the principal-symbol problem.
When a linearised PDE system has algebraic constraint rows (M_t row =
zero), the principal-symbol pencil (M_x, M_t) is singular —
det(M_x − λ M_t) ≡ 0 and standard generalised-eigenvalue solvers
return garbage.
This module reduces a singular pencil to a regular one by repeatedly:
Picking an algebraic row (
M_trow identically zero).Solving its M_x-row for one field (the field with the simplest non-zero coefficient in that row).
Substituting that field’s expression into every other row of
M_xandM_t, then dropping the row + the eliminated column.
After reduction (when no all-zero M_t row remains), the pencil is
regular and standard generalised-eigenvalue routines work.
The algorithm is generic — it works for any system with algebraic constraints, regardless of the model. It chooses elimination order by “simplest coefficient first”, which is deterministic but not unique; the finite eigenvalues are basis-invariant under valid elimination choices, so the result is independent of the order.
- zoomy_core.analysis.reduce_pencil.reduce_singular_pencil(M_x, M_t, fields, M_0=None, *, verbose=False)#
Eliminate algebraic-constraint rows + the corresponding fields.
Three classes of “algebraic” rows are handled:
M_t row = 0andM_x row != 0— principal-symbol algebraic constraint at high k. Use the M_x row to solve for one field and substitute into all remaining rows (M_x, M_t and M_0 if provided).M_t row = 0andM_x row = 0andM_0 row != 0— zeroth-order algebraic constraint (k-independent). Use the M_0 row to solve. REQUIRESM_0argument.All three rows zero — redundant; drop the row.
Returns
(M_x_reduced, M_t_reduced, fields_reduced)with no all-zeroM_trows. IfM_0was provided it is also reduced; access via the returned tuple’s caller side-effect (the matrix is mutated in place — pass a copy if you need the original).- Parameters:
M_x (MutableDenseMatrix) –
M_t (MutableDenseMatrix) –
fields (List) –
M_0 (Optional[MutableDenseMatrix]) –
verbose (bool) –
- Return type:
Tuple[MutableDenseMatrix, MutableDenseMatrix, List]