CohomologicalEquations
MORFE.CohomologicalEquations — Module
CohomologicalEquationsSolve the cohomological equations that arise in the parametrisation method for computing Spectral Submanifolds (SSMs) of high-dimensional dynamical systems.
Problem statement
Given a full‑order model of order ORD in FOM degrees of freedom, the parametrisation method seeks a change of coordinates
x(t) = W(z(t)), z ∈ ℂᴺᵛᵃʳsuch that the reduced dynamics ż = R(z) is simpler. Expanding both W and R as dense polynomials in the NVAR = ROM + N_EXT reduced variables (ROM master‑mode amplitudes plus N_EXT external forcing amplitudes) and matching coefficients monomial by monomial yields the cohomological equations: one linear system per multi‑index α.
System structure for multi‑index α
Let s = ⟨λ, α⟩ be the superharmonic frequency and let nR = |ℛ(α)| be the number of master modes resonant at α. The cohomological linear system is
┌ ┐ ┌ ┐ ┌ ┐
│ L(s) C(s) │ │ W[α] │ = │ RHS_inv │ FOM rows (invariance)
│ L̂(s) Ĉ(s) │ │ R_res │ │ RHS_ort │ nR rows (orthogonality)
└ ┘ └ ┘ └ ┘where:
L(s)(FOM × FOM) is the parametrisation operator,C(s)(FOM × nR) acts on the unknown resonant reduced-dynamics coefficients,L̂(s)(nR × FOM) is the orthogonality row operator,Ĉ(s)(nR × nR) is the orthogonality joint operator,W[α] ∈ ℂᶠᵒᵐis the (zeroth-order) parametrisation coefficient,R_res ∈ ℂⁿᴿare the reduced-dynamics coefficients for resonant modes.
Non-resonant master modes are trivially zero and are excluded from the system. External forcing modes are known and appear only on the right-hand side.
Module contents
| Symbol | Description |
|---|---|
CohomologicalContext | Flat struct bundling all precomputed operators, pre-allocated buffers, and the resonance set |
solve_single_monomial! | Solve the cohomological system for one multi-index |
solve_cohomological_equations! | Solve for all multi-indices in causal (ascending-degree) order |
solve_cohomological_problem | High-level driver: precompute everything and solve |
MORFE.CohomologicalEquations.CohomologicalContext — Type
CohomologicalContext{T, ORD, ORDP1, NVAR, ROM, FOM}A single flat struct that bundles all precomputed data required to solve the cohomological equations for every monomial in the parametrisation method.
Using one flat struct rather than nested containers eliminates the name collision between the invariance‑equation operators and the orthogonality‑condition operators (both previously called C_coeffs/E_coeffs) and makes the data provenance explicit at every call site.
Type parameters
| Parameter | Meaning |
|---|---|
T | Scalar type (typically ComplexF64) |
ORD | Polynomial order of the full‑order ODE |
ORDP1 | ORD + 1 — required as a separate parameter because Julia's type system does not support arithmetic on type parameters |
NVAR | Total number of reduced variables: ROM + N_EXT |
ROM | Number of master modes (dimension of the reduced model) |
FOM | Full‑order state dimension |
Fields
Full‑order linear operators
linear_terms :: NTuple{ORDP1, Matrix{T}}— coefficient matrices of the linear part of the full‑order model,(B₀, B₁, …, B_ORD), each of sizeFOM × FOM.generalised_eigenmodes :: Matrix{T}— sizeFOM × NVAR. Right generalised eigenvectors; columns1:ROMare the master modes, columnsROM+1:NVARare the external forcing modes.lambda_diag :: Vector{T}— lengthNVAR. Diagonal entriesλᵢof the Jordan matrix, used to form the superharmonic frequencys = ⟨λ, α⟩for multi‑indexα. These are read directly from the reduced‑dynamics polynomialRat the linear monomialse_i.
Invariance‑equation operators (polynomial coefficients in s)
These arrays are produced by InvarianceEquation.precompute_column_polynomials.
invariance_C_coeffs :: Vector{Matrix{T}}— lengthROM.invariance_C_coeffs[r][:, j]is the degree‑(j-1)coefficient of the column operatorC_r(s)acting on the reduced‑dynamics unknown for master moder; each matrix has sizeFOM × ORD.invariance_E_coeffs :: Vector{Matrix{T}}— lengthN_EXT.invariance_E_coeffs[e][:, j]is the degree‑(j-1)coefficient of the external‑forcing operatorE_e(s)for external variablee; each matrix has sizeFOM × ORD.
Orthogonality‑condition operators (polynomial coefficients in s)
These arrays are produced by MasterModeOrthogonality.precompute_orthogonality_operator_coefficients and MasterModeOrthogonality.precompute_orthogonality_column_polynomials.
orthogonality_J_coeffs :: Vector{Matrix{T}}— lengthROM.orthogonality_J_coeffs[r][j, :]is the degree‑(j-1)coefficient of the left row operatorL_r(s)for master moder; each matrix has sizeORD × FOM.orthogonality_C_coeffs :: Vector{Matrix{T}}— lengthROM.orthogonality_C_coeffs[r][j, :]is the degree‑(j-1)coefficient of the joint column operatorĈ_r(s)acting on the master‑mode unknowns; each matrix has size(ORD-1) × ROM.orthogonality_E_coeffs :: Vector{Matrix{T}}— lengthROM.orthogonality_E_coeffs[r][j, :]is the degree‑(j-1)coefficient of the joint column operatorÊ_r(s)acting on the external variables; each matrix has size(ORD-1) × N_EXT.
Resonance
resonance_set :: ResonanceSet— look‑up table indicating which master modes are resonant with each monomial.
Precomputed bookkeeping
linear_monomial_skip_set :: Set{Int}— indices of all unit-vector monomials (e_1, …, e_NVAR); these are initialised before the main loop and skipped.
MORFE.CohomologicalEquations.solve_cohomological_equations! — Method
solve_cohomological_equations!(W, R, ctx, model) -> nothingSolve the cohomological equations for all monomials in the multiindex set of W and R, processing them in causal order (ascending total degree so that lower‑order coefficients are available when higher‑order ones are solved).
All unit‑vector monomials eᵣ for r = 1 … NVAR (both master modes and external forcing modes) are assumed to have been initialised to the spectral data beforehand and are skipped.
Arguments
W :: Parametrisation{ORD, NVAR, T}— parametrisation (updated in‑place).R :: ReducedDynamics{ROM, NVAR, T}— reduced dynamics (updated in‑place).ctx :: CohomologicalContext— all precomputed data and the resonance set.model :: NDOrderModel— full‑order model; passed through tosolve_single_monomial!for nonlinear term evaluation.ml_cache :: MultilinearTermsCache— precomputed factorisation cache built once before the loop.
MORFE.CohomologicalEquations.solve_cohomological_problem — Method
solve_cohomological_problem(
model, mset, master_eigenvalues,
master_modes, left_eigenmodes, resonance_set;
initial_W = nothing, initial_R = nothing
) -> (W, R)High‑level driver that assembles a CohomologicalContext from raw spectral data and solves the full set of cohomological equations.
External eigenvalues are read directly from model.external_system.eigenvalues (or treated as absent when model.external_system === nothing). The linear‑operator tuple is read from model.linear_terms.
Steps
- Extract external eigenvalues from
model.external_systemand build the Jordan matrixΛ. - Create (or reuse) the
ParametrisationWandReducedDynamicsRobjects and initialise the master‑mode linear monomials frommaster_modes. - Solve the linear cohomological equations for each external forcing direction:
L(s_ext) · W_ext = compute_multilinear_terms(model, e_ext, W). This yields the particular solution at the forcing frequency and populates the external columns ofgeneralised_right_eigenmodes. - Build the
N_EXT × Lexternal‑dynamics matrix (non‑zero only at the linear forcing monomialse_{ROM+e}). - Precompute the invariance‑equation operator columns (
invariance_C_coeffs,invariance_E_coeffs) viaInvarianceEquation.precompute_column_polynomials. - Precompute the orthogonality‑condition operators (
orthogonality_J_coeffs,orthogonality_C_coeffs,orthogonality_E_coeffs) viaMasterModeOrthogonality.precompute_orthogonality_operator_coefficientsandMasterModeOrthogonality.precompute_orthogonality_column_polynomials. - Assemble a
CohomologicalContextand callsolve_cohomological_equations!.
Arguments
model :: NDOrderModel— full‑order model.model.linear_termsprovides(B₀, B₁, …, B_ORD);model.external_system(may benothing) carries the external eigenvalues.mset :: MultiindexSet{NVAR}— multiindex set over allNVARreduced variables (NVAR = ROM + N_EXT).master_eigenvalues :: SVector{ROM, ComplexF64}— eigenvalues of the master modes.master_modes :: Matrix{ComplexF64}— sizeFOM × ROM; right eigenvectors of the master modes. The external forcing directions are derived internally by solving the linear cohomological equations.left_eigenmodes :: AbstractMatrix{ComplexF64}— left eigenvectors of the master modes, sizeFOM × ROM(used in the orthogonality conditions).resonance_set :: ResonanceSet— precomputed resonance look‑up table.initial_W,initial_R— optionally supply already-initialised objects (their linear monomials must be set correctly).
Returns
(W, R) — the solved Parametrisation and ReducedDynamics.
MORFE.CohomologicalEquations.solve_single_monomial! — Method
solve_single_monomial!(W, R, idx, ctx, model) -> nothingSolve the cohomological equations for the monomial with multiindex‑set position idx, updating the coefficients of W and R in‑place.
Algorithm
- Compute the superharmonic frequency
s = ⟨λ, α⟩from the diagonal ofctx.lambda_diag. - Look up the resonance pattern
resonance ∈ {true,false}^{ROM}fromctx.resonance_set. - Compute lower‑order coupling vectors
ξ[j](lengthFOM) viaLowerOrderCouplings.compute_lower_order_couplings. - Compute the nonlinear model RHS in-place via
MultilinearTerms.compute_multilinear_terms!intoctx.ml_result_buffer. No heap allocation occurs. - Retrieve the known external dynamics at this monomial from the last
N_EXTrows ofR.poly.coefficients[:, idx]. - Assemble the stacked
(FOM + nR) × (FOM + nR)linear system directly intoctx.system_matrix_bufferandctx.rhs_buffervia the in-place variantsInvarianceEquation.assemble_cohomological_matrix_and_rhs!andMasterModeOrthogonality.assemble_orthogonality_matrix_and_rhs!, then factorctx.system_matrix_bufferin-place withlu!(view(...), check=false)and solve withldiv!. The buffer is never reused after factorisation, so no copy is needed. - Store
W[α](zeroth time‑derivative) and the resonant reduced‑dynamics coefficientsR_res. - Compute higher time‑derivative coefficients
W^(j)[α]forj = 1 … ORD-1viaParametrisationMethod.compute_higher_derivative_coefficients!.
Arguments
W :: Parametrisation{ORD, NVAR, T}— parametrisation object (updated in‑place).R :: ReducedDynamics{ROM, NVAR, T}— reduced dynamics object (updated in‑place).idx :: Int— position of the target monomial in the shared multiindex set.ctx :: CohomologicalContext{T, ORD, ORDP1, NVAR, FOM}— all precomputed data.model :: NDOrderModel— full‑order model; provides nonlinear term evaluations.ml_cache :: MultilinearTermsCache— precomputed factorisation cache; built once before the solve loop.