def pressure(self, temperature, volume, params): """ Returns pressure [Pa] as a function of temperature [K] and volume[m^3] EQ B7 """ return bm.birch_murnaghan(params['V_0']/volume, params) + \ self.__thermal_pressure(temperature,volume, params) - \ self.__thermal_pressure(300.,volume, params)
def volume(self, pressure,temperature,params): """ Returns volume [m^3] as a function of pressure [Pa] and temperature [K] EQ B7 """ func = lambda x: bm.birch_murnaghan(params['V_0']/x, params) + \ self.__thermal_pressure(temperature, x, params) - \ self.__thermal_pressure(300., x, params) - pressure V = opt.brentq(func, 0.5*params['V_0'], 1.5*params['V_0']) return V