PyMPDATA_examples.utils.error_norms
1import numpy as np 2 3 4def L2(numerical, analytical, nt): 5 assert numerical.shape == analytical.shape 6 N = analytical.size 7 err2 = np.log(np.sqrt(sum(pow(numerical - analytical, 2)) / nt / N)) / np.log(2) 8 return err2 9 10 11def Smolarkiewicz_Grabowski_1990_eq21(numerical, analytical, T): 12 assert numerical.shape == analytical.shape 13 NX = analytical.size 14 err = np.sqrt(sum(pow(numerical - analytical, 2)) / NX) / T 15 return err 16 17 18def modified_Smolarkiewicz_Rasch_r0(numerical, analytical, T, g_factor): 19 NX = analytical.size 20 err = ( 21 np.sqrt(sum(pow(numerical - analytical, 2) * g_factor) / NX) 22 / np.amax(analytical) 23 / T 24 ) 25 return err
def
L2(numerical, analytical, nt):
def
Smolarkiewicz_Grabowski_1990_eq21(numerical, analytical, T):
def
modified_Smolarkiewicz_Rasch_r0(numerical, analytical, T, g_factor):