conatus.expert.optimal_gain

conatus.expert.optimal_gain(build, base_harmonics, kx, kz, t0, T, steps, scheme, backend='cpu', *, fields, period=1.0, rank_tol=1e-10, ncc_cutoff=None, ncc_tail_tol=1e-08)[source]

Optimal energy gain G(t0, T) of one wave (kx, kz) about a time-periodic base flow.

build(params) returns the linear IR problem of the wave (params["kx"], params["kz"]): the base flow enters through NCC fields, on the left-hand side, linearly; base_harmonics maps each of them (by name) to {m: U_m(y)} with U = Σ_m U_m e^{2πimt/period}. fields: the energy, e.g. ("u", "v", "w") for E = ½∫|u|² dy (exact Gram matrix). scheme: IMEX Runge–Kutta (RK111, RK222, RK443); dt = T / steps exactly. Every argument that changes the number is explicit; explain() restates them with the admissible-set rank decision.

Parameters:
  • build (Callable[[Mapping[str, float]], Any])

  • base_harmonics (Mapping[Any, Mapping[int, Any]])

  • kx (float)

  • kz (float)

  • t0 (float)

  • T (float)

  • steps (int)

  • scheme (str)

  • backend (str)

  • period (float)

  • rank_tol (float)

  • ncc_cutoff (float | None)

  • ncc_tail_tol (float)

Return type:

OptimalGain