zoomy_core.analysis.system_model_analysis module#
SystemModel-based analysis: linearise + dispersion + eigenvalues.
Operates directly on zoomy_core.model.models.system_model.SystemModel
— no PDESystem wrapper, no linearise-on-equation-tree machinery.
The model’s stored sympy matrices already encode the operator surface;
analysis is straightforward symbolic substitution + eigenvalue solve.
Three entry points:
linearise_system_model()— substitute a base state into the flux / NCP / source / hydrostatic-pressure / mass matrices and return a newSystemModelwhose matrices are constant in the state Symbols (only depend on coordinates and parameters).plane_wave_dispersion()— given a constant-coefficient linearised SystemModel, build the principal-symbol pencil(M_t, M_x[axis], M_0)and return the symbolic eigenvaluesω(k)(or equivalentlyλ = ω/ksolvingdet(M_x − λ M_t) = 0).hyperbolic_eigenvalues()— same pencil but returning the generalized eigenvalues of(M_x[axis], M_t)directly viazoomy_core.analysis.pencil.generalised_eigenvalues().
For shapes where the analyst wants Sum/Indexed form (linear
stability with symbolic k, parameter-sweep hyperbolicity, etc.)
the substitution dict accepts any sympy values — base_state[h] = h0
keeps h0 symbolic.
- zoomy_core.analysis.system_model_analysis.linearise_system_model(sm, base_state, *, parameters=None)#
Substitute
base_stateinto every operator matrix; return a newSystemModelwhose matrices are constant in the state.- Parameters:
sm (SystemModel) – The source operator-form system.
base_state (dict) – Map of state Symbol → base value. Missing entries are left symbolic. Aux-state Symbols may also be substituted.
parameters (dict, optional) – Additional parameter substitutions (e.g.
{ez: 1, g: 9.81}). Combined withbase_statefor the substitution.
- Return type:
SystemModel
- zoomy_core.analysis.system_model_analysis.plane_wave_dispersion(sm, base_state, *, axis=0, parameters=None, return_omega_k=True)#
Compute the dispersion of
smlinearised atbase_state.Two output modes are supported (controlled by
return_omega_k):return_omega_k=True(default, fixes G7 from the plan): assemble the full plane-wave matrixM(ω, k)from the linearised system and solvedet M(ω, k) = 0for the trueω(k)curves — symbolic functions ofkrather than just eigenvalues at a fixed base state.return_omega_k=False(legacy): return only generalised eigenvalues of(M_x, M_t)— phase velocities at the base state, nok-dependence.
Returns a dict with:
M_t— mass matrix at base state.M_x— quasilinear matrix at base state in directionaxis.M_0—-∂S/∂Qat base state.eigenvalues— generalised eigenvalues (legacy, always present).omega_solutions(only whenreturn_omega_k=True) — list of symbolicω(k)solutions ofdet M(ω, k) = 0.phase_velocity_solutions(only whenreturn_omega_k=True) —[ω/k for ω in omega_solutions].k(only whenreturn_omega_k=True) — the wavenumber symbol.omega(only whenreturn_omega_k=True) — the angular‑frequency symbol.
- Parameters:
sm (SystemModel) –
base_state (Dict[Any, Any]) –
axis (int) –
parameters (Optional[Dict[Any, Any]]) –
return_omega_k (bool) –
- Return type:
Dict[str, Any]
- zoomy_core.analysis.system_model_analysis.hyperbolic_eigenvalues(sm, base_state, *, axis=0, parameters=None)#
Convenience: return only the eigenvalues from
plane_wave_dispersion().Useful for hyperbolicity sampling: real eigenvalues = hyperbolic; complex conjugate pairs = elliptic mode = ill-posed initial-value problem.
- Parameters:
sm (SystemModel) –
base_state (Dict[Any, Any]) –
axis (int) –
parameters (Optional[Dict[Any, Any]]) –
- Return type:
List[Expr]