spectral.utils.norms.discrete_l2_error#

spectral.utils.norms.discrete_l2_error(f_exact: ndarray, f_num: ndarray, interval_length: float) float[source]#

Compute discrete L2 error between exact and numerical solutions. #TODO: Change to use Mass Matrix instead

Parameters:
f_exactnp.ndarray

Exact function values

f_numnp.ndarray

Numerical approximation values

interval_lengthfloat

Length of the interval

Returns:
float

Discrete L2 error norm