qlroms.operators
Common operator layer for all qlROM model families.
Every model family exposes the same forecast form on augmented chart-local states
apod (r+1, 1) with the cluster id in the last row:
apod^{n+1} = model.step(apod^n) # discrete map, all families
so the outer forecast workflow never depends on model-family internals. Continuous families (qlGalerkin) realize step() by an ETDRK4 integration of their da/dt = g(a).
This module owns the case-agnostic operator machinery: the contour-integration ETDRK4 coefficient builder (build_etdrk4_coeffs) and the dimension-agnostic quadratic reduced-space steppers (quadratic_etdrk4_step, quadratic_map_step).
build_etdrk4_coeffs(L, dt, M=32, R=15.0)
Unified ETDRK4 coefficients builder via contour integration.
Computes (E, E2, Q, f1, f2, f3) from an unscaled linear operator L via scipy.linalg.expm for exponentials and contour integration for resolvent integrals. Works for both reduced (r x r) and full-order (Nx x Nx) operators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
L
|
Unscaled linear operator matrix (n x n), typically a spectral matrix or reduced operator. |
required | |
dt
|
Time step size (used to scale L internally). |
required | |
M
|
Number of contour quadrature points (default 32). |
32
|
|
R
|
Contour radius for resolvent integral (default 15.0). |
15.0
|
Returns:
| Type | Description |
|---|---|
|
Tuple (E, E2, Q, f1, f2, f3), each (n x n) real numpy arrays. |
Source code in qlroms/operators.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
quadratic_etdrk4_step(a, b, B, etdrk4_coeffs)
One ETDRK4 step of da/dt = b + B(a, a) (A already folded into etdrk4_coeffs).
Dimension-agnostic: only ever reads (r,)-sized tensors, so the same function
steps quadratic 1D and 2D clusters. etdrk4_coeffs are the (E, E2, Q, f1,
f2, f3) coefficients built from the linear operator A (see
qlROMBase.get_stepping_coeffs); b, B are that cluster's affine/quadratic
parts. a is a pure (r, 1) reduced-coordinate column (no cluster-id row).
Source code in qlroms/operators.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
quadratic_map_step(a, b, A, B=None)
One DISCRETE step of the map a^{n+1} = b + A a^n + B(a^n, a^n).
The direct one-step analog of quadratic_etdrk4_step (no ODE, no integrator): the
operators ARE the map, applied as-is (QuadROM with discrete=True). a is a pure
(r, 1) reduced-coordinate column. B=None (or empty) gives the affine/linear map
b + A a -- classic DMD.
Source code in qlroms/operators.py
112 113 114 115 116 117 118 119 120 121 122 123 124 | |