InternalModesFiniteDifference

Solve the vertical eigenvalue problems with finite-difference matrices.


Declaration

classdef InternalModesFiniteDifference < InternalModesBase

Overview

InternalModesFiniteDifference discretizes the fixed-\(K\) and fixed-\(\omega\) eigenvalue problems directly on the supplied depth grid. It uses arbitrary-order finite-difference stencils generated from the Fornberg weights algorithm and optionally interpolates the resulting modes onto a separate output grid.

This class is mainly useful as a baseline against the spectral methods discussed in Section 3 of Early, Lelong, and Smith (2020), where the manuscript explains why finite differencing becomes less attractive when many frequencies or wavenumbers are required.

im = InternalModesFiniteDifference(rho=rho, zIn=zIn, zOut=zOut, latitude=latitude, orderOfAccuracy=4);
[F, G, h, omega] = im.modesAtWavenumber(2*pi/1000);

Topics

Developer Topics

These items document internal implementation details and are not part of the primary public API.

  • Developer topics
    • ApplyBoundaryConditions Apply the current lower and upper boundary conditions to an EVP pair.
    • Diff1 First-derivative finite-difference matrix.
    • Diff2 Second-derivative finite-difference matrix.
    • FiniteDifferenceMatrix Build a finite-difference differentiation matrix with boundary stencils.
    • InitializeOutputTransformation Prepare the interpolation from the differentiation grid to the public output grid.
    • ModesFromGEP Solve a generalized EVP and map its modes onto the public grid.
    • N2_z_diff Buoyancy frequency squared sampled on z_diff.
    • NormalizeModes Normalize finite-difference modes using the active convention.
    • T_out Transformation from z_diff functions to the public output grid.
    • n Number of differentiation-grid points.
    • rho_z_diff Background density sampled on z_diff.
    • weights Return Fornberg finite-difference weights for one stencil location.
    • z_diff Depth grid used for differentiation and the generalized EVP.