def evaluate(self, state):
        P, h = state[0] * 0.1, state[1] / 18.015
        if P < Pmin:
            P = Pmin
        hmin = _Region1(273.15, P)["h"]
        if h < hmin:
            h = hmin

        region = _Bound_Ph(P, h)
        if (region == 1):
            T = _Backward1_T_Ph(P, h)
        elif (region == 4):
            T = _TSat_P(P)
        elif (region == 2):
            T = _Backward2_T_Ph(P, h)
        else:
            raise NotImplementedError("Incoming out of bound")
        return T
 def evaluate(self, state):
     P, h = state[0] * 0.1, state[1] / 18.015
     if P < Pmin:
         P = Pmin
     hmin = _Region1(273.15, P)["h"]
     if h < hmin:
         h = hmin
     region = _Bound_Ph(P, h)
     if (region == 1):
         water_enth = h
     elif (region == 4):
         T = _TSat_P(P)
         if T <= 623.15:
             water_enth = _Region4(P, 0)["h"]
         else:
             raise NotImplementedError("Incoming out of bound")
     elif (region == 2):
         water_enth = 0
     else:
         print(region)
         raise NotImplementedError("Incoming out of bound")
     return water_enth * 18.015
    def evaluate(self, state):
        P, h = state[0] * 0.1, state[1] / 18.015
        if P < Pmin:
            P = Pmin
        hmin = _Region1(273.15, P)["h"]
        if h < hmin:
            h = hmin

        region = _Bound_Ph(P, h)
        if (region == 1):
            steam_density = 0
        elif (region == 4):
            T = _TSat_P(P)
            if T <= 623.15:
                steam_density = 1 / _Region4(P, 1)['v']
            else:
                raise NotImplementedError("Incoming out of bound")
        elif (region == 2):
            To = _Backward2_T_Ph(P, h)
            T = newton(lambda T: _Region2(T, P)["h"] - h, To)
            steam_density = 1 / _Region2(T, P)["v"]
        else:
            raise NotImplementedError("Incoming out of bound")
        return steam_density / 18.015
    def evaluate(self, state):
        P, h = state[0] * 0.1, state[1] / 18.015
        if P < Pmin:
            P = Pmin
        hmin = _Region1(273.15, P)["h"]
        if h < hmin:
            h = hmin

        region = _Bound_Ph(P, h)
        if (region == 1):
            temperature = temperature_region1_evaluator()
            T = temperature.evaluate(state)
            water_density = 1 / _Region1(T, P)['v']
        elif (region == 4):
            T = _TSat_P(P)
            if (T <= 623.15):
                water_density = 1 / _Region4(P, 0)['v']
            else:
                raise NotImplementedError("Incoming out of bound")
        elif (region == 2):
            water_density = 0
        else:
            raise NotImplementedError("Incoming out of bound")
        return water_density / 18.015