Skip to content

Compare global collocation, LHI, and RBF-FD

This supplementary comparison brings together global collocation, RBF-FD, and LHI. Work through their individual constructions first; then use this page to compare the objects they produce.

Method Global unknowns Local information Field evaluation
Global asymmetric Ordinary trial coefficients All centers Global radial expansion
Global symmetric Source-functional trial coefficients All functional centers Global Hermite expansion
RBF-FD Nodal solution values Local value interpolants Local reconstruction
LHI Interior solution-center values Values, boundary data, PDE data Local Hermite reconstruction

Solve \(-\Delta u=2\pi^2\sin(\pi x)\sin(\pi y)\) with zero Dirichlet data on the unit square. Symmetric global collocation applies PDE/boundary functionals to both kernel arguments. Asymmetric global collocation uses ordinary kernel translates as its trial basis. LHI forms local Hermite weight systems with solution, boundary, and PDE centers. RBF-FD uses local value-interpolation weights. See the separate global and LHI derivations before interpreting their matrices.

LHI schematic with blue circles for solution values, teal triangles for PDE data, orange squares on the boundary, and a target that has no PDE-data triangle
An illustrative LHI neighborhood. A circle and triangle can occupy the same location while representing different functionals. The target belongs to the solution centers and is excluded from the PDE-data centers. Marker counts are schematic, not a recommended stencil size.

What each matrix represents

If \(F_i\) is a PDE or boundary row, asymmetric global collocation uses \(A_{ij}=F_i^xK(x_i,x_j)\), while symmetric Hermite collocation uses \(G_{ij}=F_i^xF_j^yK(x_i,x_j)\). Their solved vectors are coefficients of different trial functions. LHI instead writes one local functional identity at each interior center and keeps only solution-center weights in its sparse global row. RBF-FD keeps weights obtained from local value interpolation. The script uses one PDE and cloud, constructs each method object, solves its system, and samples all four results at the same seeded off-node points.

Run the comparison

Complete runnable script
"""Compare global symmetric/asymmetric, LHI, and RBF-FD on one Poisson PDE.

Run: python -m examples.tutorials.compare_methods
"""
import numpy as np
import sympy as sp
import rbflab as rbf


def run(cells=5):
    model = rbf.SymbolicScalar(2)
    u = model.field
    x, y = model.coordinates
    exact = sp.sin(sp.pi*x)*sp.sin(sp.pi*y)
    lhs = -model.laplacian(u)
    problem = model.stationary(
        sp.Eq(lhs, lhs.subs(u, exact).doit()),
        boundary=[model.bc("boundary", sp.Eq(u, 0))],
    )
    cloud = rbf.geometry.unit_box_grid(cells)
    query = np.random.default_rng(19).uniform(.1, .9, (40, 2))
    target = np.sin(np.pi*query[:, 0])*np.sin(np.pi*query[:, 1])
    methods = {
        "global_symmetric": rbf.GlobalCollocation(rbf.IMQ(2), scheme="symmetric"),
        "global_asymmetric": rbf.GlobalCollocation(rbf.IMQ(2), scheme="asymmetric"),
        "lhi": rbf.LHI(rbf.PHS(5), min(20, len(cloud.points)), polynomial_degree=2),
        "rbffd": rbf.RBFFD(rbf.PHS(5), min(20, len(cloud.points)), polynomial_degree=2),
    }
    results = {}
    for name, method in methods.items():
        system = method.assemble(problem, cloud)
        solution = system.solve()
        error = float(np.max(np.abs(solution.evaluate(query)-target)))
        results[name] = error
        print(f"{name}: matrix={system.matrix.shape}, "
              f"off_node_max_error={error:.3e}")
    return results


if __name__ == "__main__":
    run()

Download the runnable script.

Run python -m examples.tutorials.compare_methods. All methods solve the same Poisson equation on the same 36-node cloud. The global and RBF-FD matrices have 36 rows; LHI has 16 interior equations because boundary data are eliminated through the local identities. Different matrix dimensions do not by themselves compare the total work: LHI also builds local Hermite systems.

The global examples use IMQ(2); local examples use PHS5 with quadratic augmentation. The script's brief solution checks describe these recipes, not a matched method ranking. To adapt it, first choose which local information and which unknown vector your mathematical idea requires, then select the corresponding construction.