smbinterp/lib/tools.py

22 lines
434 B
Python

import numpy as np
class smberror(Exception):
def __init__(self, val):
self.value = val
def __str__(self):
return repr(self.value)
def rms(errors):
"""
root mean square calculation
"""
r = 0.0
for i in errors:
r += np.power(i, 2)
r = np.sqrt(r / len(errors))
return r
def exact_func(x, y):
return np.power((np.sin(x * np.pi) * np.cos(y * np.pi)), 2)
return np.sin(x * np.pi) * np.cos(y * np.pi)