InternalModesSpectral
Solve the vertical internal-mode EVP with Chebyshev collocation.
Declaration
classdef InternalModesSpectral < InternalModesBaseOverview
InternalModesSpectral is the core numerical solver described in
Sections 4 and 5 of Early, Lelong, and Smith (2020). It represents
the vertical structure on a Gauss-Lobatto grid and solves the
manuscript eigenvalue problems
for fixed \(K\), or
\[\partial_{zz} G_j = \frac{\omega^2 - N^2}{g h_j} G_j\]for fixed \(\omega\), together with
\[F_j = h_j \partial_z G_j.\]The solver stores background fields on the user-facing output grid
z, but internally works with a spectral grid and exact integrals
of Chebyshev polynomials for mode normalization. Subclasses reuse
this machinery in stretched coordinates while preserving the same
public mode API.
im = InternalModesSpectral(rho=rho, zIn=zIn, zOut=zOut, latitude=latitude, nEVP=257);
[F, G, h, omega] = im.modesAtWavenumber(2*pi/1000);
Topics
- Create and initialize modes
InternalModesSpectralInitialize the spectral solver on depth coordinates.nEVPNumber of collocation points used for the generalized EVP.
- Compute modes
bottomModesAtWavenumberReturn the bottom SQG mode at fixed horizontal wavenumber.boundaryModesAtWavenumberReturn either the surface or bottom boundary mode at fixed wavenumber.eigenmatricesForFrequencyAssemble the fixed-\(\omega\) generalized EVP on the spectral grid.eigenmatricesForWavenumberAssemble the fixed-\(K\) generalized EVP on the spectral grid.modesAtQuadraturePointsReturn resolved modes on mode-adapted quadrature points.surfaceModesAtWavenumberReturn the surface SQG mode at fixed horizontal wavenumber.
Developer Topics
These items document internal implementation details and are not part of the primary public API.
- Configure normalization and boundaries
ApplyBoundaryConditionsApply the active surface and bottom conditions to an EVP pair.
- Developer topics
ChebyshevDifferentiationMatrixReturn the matrix that differentiates Chebyshev coefficients.ChebyshevInterpolationDerivativeReturn the Lobatto-grid differentiation matrix for interpolation values.ChebyshevPolynomialsOnGridEvaluate Chebyshev polynomials and derivatives on an arbitrary grid.ChebyshevTransformForGridBuild a spectral interpolation map from a Lobatto grid to an output grid.CheckIfReasonablyMonotonicTest whether a gridded density profile is monotonic enough for stretched coordinates.Diff1_xChebFirst-derivative operator in Chebyshev coefficient space.DifferentiateChebyshevVectorDifferentiate a Chebyshev series in coefficient space.EigenmatricesForGeostrophicFModesAssemble the geostrophic interiorF-mode EVP.EigenmatricesForGeostrophicGModesAssemble the geostrophic interiorG-mode EVP.EigenmatricesForGeostrophicRigidLidGModesAssemble the rigid-lid geostrophic EVP with displaced boundaries.EigenmatricesForMDAModesAssemble the MDA diagnostic EVP.EigenmatricesForRigidLidGModesAssemble the rigid-lid geostrophicG-mode EVP.EigenmatricesForSmithVannesteModesAssemble the Smith-Vanneste SQG-like EVP used by a helper workflow.FFromVChebMap Chebyshev coefficients to \(F_j\) on the active internal grid.FNorm\(\omega\)-constant normalization functional.FOutFromVChebMap Chebyshev coefficients to \(F_j(z)\) on the public output grid.FindRootsFromChebyshevVectorFind physical-domain roots of a Chebyshev series.FindSmallestChebyshevGridWithNoGapsFind the coarsest Lobatto grid that covers a target grid without gaps.FindTurningPointBoundariesAtFrequencyFind turning points and region signs for \(N^2(z)-\omega^2\).GFromVChebMap Chebyshev coefficients to \(G_j\) on the active internal grid.GNorm\(K\)-constant normalization functional.GOutFromVChebMap Chebyshev coefficients to \(G_j(z)\) on the public output grid.GaussQuadraturePointsForEigenmatricesReturn quadrature points inferred from a generalized EVP.GaussQuadraturePointsForMDAModesReturn quadrature points tailored to the diagnostic MDA modes.GaussQuadraturePointsForModesAtFrequencyReturn quadrature points tailored to fixed-\(\omega\) modes.GaussQuadraturePointsForModesAtWavenumberReturn quadrature points tailored to fixed-\(K\) modes.GeostrophicFModesAtWavenumberReturn the geostrophic interiorF-modes at fixed horizontal wavenumber.GeostrophicModesAtWavenumberReturn the geostrophic interiorG-modes at fixed horizontal wavenumber.GeostrophicNormGeostrophic normalization functional.GeostrophicRigidLidModesReturn rigid-lid geostrophic modes with displaced boundaries.GeostrophicSmithVannesteModesAtWavenumberReturn Smith-Vanneste modes at fixed horizontal wavenumber.Int_xChebExact integral weights for Chebyshev coefficients on the active domain.IntegrateChebyshevVectorIntegrate a Chebyshev series in coefficient space.IntegrateChebyshevVectorWithLimitsIntegrate a Chebyshev series between two physical limits.IsChebyshevGridTest whether a grid is a Chebyshev-Lobatto grid up to tolerance.LxTotal span of the active spectral coordinate.MDAModesReturn the diagnostic MDA modes.N2_functionBuoyancy-frequency profile represented as a function of depth.N2_xLobattoBuoyancy frequency squared sampled onxLobatto.ProjectOntoChebyshevPolynomialsWithToleranceProject a profile onto Chebyshev coefficients to a requested tolerance.T_xCheb_zOutTransform from Chebyshev coefficients to the public output grid.T_xLobattoChebyshev basis evaluated on the Lobatto grid.Tx_xLobattoFirst derivatives of the Chebyshev basis on the Lobatto grid.Txx_xLobattoSecond derivatives of the Chebyshev basis on the Lobatto grid.ValueOfFunctionAtPointOnGridEvaluate a Chebyshev series at arbitrary points in its physical domain.fInverseBisectionInvert a monotonic function by vectorized bisection.fctCompute the fast Chebyshev transform of values on a Lobatto grid.hFromLambdaSet on initialization by the subclass, these transformations areifctCompute the inverse fast Chebyshev transform.rho_functionDensity profile represented as a spline or functional object.standardChopChoose a truncation index for a Chebyshev coefficient sequence.xDomainBounds of the active spectral coordinate.xLobattoThe ‘x’ refers to the stretched coordinate being used.xMaxMaximum value of the active spectral coordinate.xMinMinimum value of the active spectral coordinate.xOutOutput locations mapped into the active spectral coordinate.x_functionActive stretched-coordinate map \(x(z)\) used by the solver.z_xLobattoPhysical depths associated withxLobatto.