def test_pT_function(self): """ Tests to verify all functions with the Parameters p and T of Region 5 by comparing the Results to IF-97 Page 39 Table 42""" # % IF-97 Table 42, Page 39 T = [1500.0, 1500.0, 2000.0] p = [0.5, 8.0, 8.0] IF97 = [[1.38455354, 0.0865156616, 0.115743146], [5219.76332, 5206.09634, 6583.80291], [4527.48654, 4513.97105, 5657.85774], [9.65408431, 8.36546724, 9.15671044], [2.61610228, 2.64453866, 2.8530675], [917.071933, 919.708859, 1054.35806]] R5 = numpy.zeros((6, 3)) for i in range(0, 3): R5[0][i] = Region5.v5_pT(p[i], T[i]) R5[1][i] = Region5.h5_pT(p[i], T[i]) R5[2][i] = Region5.u5_pT(p[i], T[i]) R5[3][i] = Region5.s5_pT(p[i], T[i]) R5[4][i] = Region5.Cp5_pT(p[i], T[i]) R5[5][i] = Region5.w5_pT(p[i], T[i]) Region5_error = numpy.sum(numpy.absolute((R5 - IF97) / IF97)) self.assertLess( Region5_error, self.maxMatrixError, 'Test of p,T Function for Region 5 failed. Error was %(error)e allowed: %(max)e' % { 'error': Region5_error, 'max': self.maxMatrixError })
def test_pT_function(self): """ Tests to verify all functions with the Parameters p and T of Region 5 by comparing the Results to IF-97 Page 39 Table 42""" # % IF-97 Table 42, Page 39 T = [1500.0, 1500.0, 2000.0] p = [0.5, 8.0, 8.0] IF97 = [[1.38455354, 0.0865156616, 0.115743146], [5219.76332, 5206.09634, 6583.80291], [4527.48654, 4513.97105, 5657.85774], [9.65408431, 8.36546724, 9.15671044], [2.61610228, 2.64453866, 2.8530675], [917.071933, 919.708859, 1054.35806]] R5 = numpy.zeros((6, 3)) for i in range(0, 3): R5[0][i] = Region5.v5_pT(p[i], T[i]) R5[1][i] = Region5.h5_pT(p[i], T[i]) R5[2][i] = Region5.u5_pT(p[i], T[i]) R5[3][i] = Region5.s5_pT(p[i], T[i]) R5[4][i] = Region5.Cp5_pT(p[i], T[i]) R5[5][i] = Region5.w5_pT(p[i], T[i]) Region5_error = numpy.sum(numpy.absolute((R5 - IF97) / IF97)) self.assertLess(Region5_error, self.maxMatrixError, 'Test of p,T Function for Region 5 failed. Error was %(error)e allowed: %(max)e' % {'error': Region5_error, 'max': self.maxMatrixError})
def test_ps_function(self): """ Tests to verify all functions with the Parameters p and s of Region 5""" # %T5_ps (Iteration) p = [0.5, 8.0, 8.0] s = [9.65408430982588, 8.36546724495503, 9.15671044273249] IF97 = [1500.0, 1500.0, 2000.0] R5 = numpy.zeros(3) for i in range(0, 3): R5[i] = Region5.T5_ps(p[i], s[i]) T5_ps_error = numpy.sum(numpy.absolute((R5 - IF97) / IF97)) self.assertLess( T5_ps_error, 1E-4, 'Test of T(p,s) Function for Region 5 failed. Error was %(error)e allowed: %(max)e' % { 'error': T5_ps_error, 'max': 1E-4 })
def test_ph_function(self): """ Tests to verify all functions with the Parameters p and h of Region 5""" # %T5_ph (Iteration) p = [0.5, 8.0, 8.0] h = [5219.76331549428, 5206.09634477373, 6583.80290533381] IF97 = [1500.0, 1500.0, 2000.0] R5 = numpy.zeros(3) for i in range(0, 3): R5[i] = Region5.T5_ph(p[i], h[i]) T5_ph_error = numpy.sum(numpy.absolute((R5 - IF97) / IF97)) self.assertLess( T5_ph_error, self.maxError, 'Test of T(p,h) Function for Region 5 failed. Error was %(error)e allowed: %(max)e' % { 'error': T5_ph_error, 'max': self.maxError })