Skip to content

Differential Operators

The rectangular package builds sparse nodal derivative matrices from a GBMSCApproximation.

from gbmsc_pde.operators import build_differential_operators

Mx, My, Mxx, Myy = build_differential_operators(approximation)

Returned Matrices

The matrices act on flattened source-node vectors:

ux = Mx.dot(u)
uy = My.dot(u)
uxx = Mxx.dot(u)
uyy = Myy.dot(u)

Returned matrices:

  • Mx: approximates partial_x u.
  • My: approximates partial_y u.
  • Mxx: approximates partial_xx u.
  • Myy: approximates partial_yy u.

Each matrix has shape:

(grid.N, grid.N)

Sparse Structure

Rows are evaluated at source nodes. The nonzero pattern is determined by the sampled local subgrids contributing to each source node. The resulting operators are sparse and compatible with SciPy sparse linear algebra.