Added another exact function, this time from scipy website

This commit is contained in:
Stephen McQuay 2011-05-24 13:45:39 -06:00
parent 9d85053b0e
commit d7aebc7be0
1 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,10 @@ def friendly_exact_3D(X):
x,y,z = X
return 1 + x*x + y*y + z*z
def scipy_exact_2D(X):
x,y = X
return x*(1-x)*np.cos(4*np.pi*x) * np.sin(4*np.pi*y**2)**2
def improved_answer(answer, exact):
if not answer['error']:
# was probably just a linear interpolation