def _Region2(T, P):
    """Basic equation for region 2

    Parameters
    ----------
    T : float
        Temperature, [K]
    P : float
        Pressure, [MPa]

    Returns
    -------
    prop : dict
        Dict with calculated properties. The available properties are:

            * v: Specific volume, [m³/kg]
            * h: Specific enthalpy, [kJ/kg]
            * s: Specific entropy, [kJ/kgK]
            * cp: Specific isobaric heat capacity, [kJ/kgK]
            * cv: Specific isocoric heat capacity, [kJ/kgK]
            * w: Speed of sound, [m/s]
            * alfav: Cubic expansion coefficient, [1/K]
            * kt: Isothermal compressibility, [1/MPa]

    References
    ----------
    IAPWS, Revised Release on the IAPWS Industrial Formulation 1997 for the
    Thermodynamic Properties of Water and Steam August 2007,
    http://www.iapws.org/relguide/IF97-Rev.html, Eq 15-17

    Examples
    --------
    >>> _Region2(700,30)["v"]
    0.00542946619
    >>> _Region2(700,30)["h"]
    2631.49474
    >>> _Region2(700,30)["h"]-30000*_Region2(700,30)["v"]
    2468.61076
    >>> _Region2(700,0.0035)["s"]
    10.1749996
    >>> _Region2(700,0.0035)["cp"]
    2.08141274
    >>> _Region2(700,0.0035)["cv"]
    1.61978333
    >>> _Region2(300,0.0035)["w"]
    427.920172
    >>> _Region2(300,0.0035)["alfav"]
    0.00337578289
    >>> _Region2(300,0.0035)["kt"]
    286.239651
    """
    if P < 0:
        P = Pmin

    Tr = 540/T
    Pr = P/1

    go, gop, gopp, got, gott, gopt = Region2_cp0(Tr, Pr)

    Ir = [1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 6, 6, 6, 7,
          7, 7, 8, 8, 9, 10, 10, 10, 16, 16, 18, 20, 20, 20, 21, 22, 23, 24,
          24, 24]
    Jr = [0, 1, 2, 3, 6, 1, 2, 4, 7, 36, 0, 1, 3, 6, 35, 1, 2, 3, 7, 3, 16, 35,
          0, 11, 25, 8, 36, 13, 4, 10, 14, 29, 50, 57, 20, 35, 48, 21, 53, 39,
          26, 40, 58]
    nr = [-0.0017731742473212999, -0.017834862292357999, -0.045996013696365003,
          -0.057581259083432, -0.050325278727930002, -3.3032641670203e-05,
          -0.00018948987516315, -0.0039392777243355001, -0.043797295650572998,
          -2.6674547914087001e-05, 2.0481737692308999e-08,
          4.3870667284435001e-07, -3.2277677238570002e-05, -0.0015033924542148,
          -0.040668253562648998, -7.8847309559367001e-10,
          1.2790717852285001e-08, 4.8225372718507002e-07,
          2.2922076337661001e-06, -1.6714766451061001e-11,
          -0.0021171472321354998, -23.895741934103999, -5.9059564324270004e-18,
          -1.2621808899101e-06, -0.038946842435739003, 1.1256211360459e-11,
          -8.2311340897998004, 1.9809712802088e-08, 1.0406965210174e-19,
          -1.0234747095929e-13, -1.0018179379511e-09, -8.0882908646984998e-11,
          0.10693031879409, -0.33662250574170999, 8.9185845355420999e-25,
          3.0629316876231997e-13, -4.2002467698208001e-06,
          -5.9056029685639003e-26, 3.7826947613457002e-06,
          -1.2768608934681e-15, 7.3087610595061e-29, 5.5414715350778001e-17,
          -9.4369707241209998e-07]

    gr = grp = grpp = grt = grtt = grpt = 0
    for i, j, ni in zip(Ir, Jr, nr):
        gr += ni * Pr**i * (Tr-0.5)**j
        grp += ni*i * Pr**(i-1) * (Tr-0.5)**j
        grpp += ni*i*(i-1) * Pr**(i-2) * (Tr-0.5)**j
        grt += ni*j * Pr**i * (Tr-0.5)**(j-1)
        grtt += ni*j*(j-1) * Pr**i * (Tr-0.5)**(j-2)
        grpt += ni*i*j * Pr**(i-1) * (Tr-0.5)**(j-1)

    propiedades = {}
    propiedades["T"] = T
    propiedades["P"] = P
    propiedades["v"] = Pr*(gop+grp)*R*T/P/1000
    propiedades["h"] = Tr*(got+grt)*R*T
    propiedades["s"] = R*(Tr*(got+grt)-(go+gr))
    propiedades["cp"] = -R*Tr**2*(gott+grtt)
    propiedades["cv"] = R*(-Tr**2*(gott+grtt)-(1+Pr*grp-Tr*Pr*grpt)**2 /
                           (1-Pr**2*grpp))
    propiedades["w"] = (R*T*1000*(1+2*Pr*grp+Pr**2*grp**2)/(1-Pr**2*grpp+(
        1+Pr*grp-Tr*Pr*grpt)**2/Tr**2/(gott+grtt)))**0.5
    propiedades["alfav"] = (1+Pr*grp-Tr*Pr*grpt)/(1+Pr*grp)/T
    propiedades["kt"] = (1-Pr**2*grpp)/(1+Pr*grp)/P
    propiedades["region"] = 2
    propiedades["x"] = 1
    return propiedades
Basic equation for region 2

    Parameters
    ----------
    T : float
        Temperature, [K]
    P : float
        Pressure, [MPa]

    Returns
    -------
    prop : dict
        Dict with calculated properties. The available properties are:

            * v: Specific volume, [m³/kg]
            * h: Specific enthalpy, [kJ/kg]
            * s: Specific entropy, [kJ/kgK]
            * cp: Specific isobaric heat capacity, [kJ/kgK]
            * cv: Specific isocoric heat capacity, [kJ/kgK]
            * w: Speed of sound, [m/s]
            * alfav: Cubic expansion coefficient, [1/K]
            * kt: Isothermal compressibility, [1/MPa]

    References
    ----------
    IAPWS, Revised Release on the IAPWS Industrial Formulation 1997 for the
    Thermodynamic Properties of Water and Steam August 2007,
    http://www.iapws.org/relguide/IF97-Rev.html, Eq 15-17

    Examples
    --------
    >>> _Region2(700,30)["v"]
    0.00542946619
    >>> _Region2(700,30)["h"]
    2631.49474
    >>> _Region2(700,30)["h"]-30000*_Region2(700,30)["v"]
    2468.61076
    >>> _Region2(700,0.0035)["s"]
    10.1749996
    >>> _Region2(700,0.0035)["cp"]
    2.08141274
    >>> _Region2(700,0.0035)["cv"]
    1.61978333
    >>> _Region2(300,0.0035)["w"]
    427.920172
    >>> _Region2(300,0.0035)["alfav"]
    0.00337578289
    >>> _Region2(300,0.0035)["kt"]
    286.239651