def calc_air_density(theta, x=0, p=101300):
    """
    Calculates the density
    :param theta: temperature in °C
    :param x: humidity ratio [kg/kg]
    :param p: Absolute Pressure [Pa]
    :return: density wet air [kg / m³]
    """
    rho = (1 + x) / (x + 0.6222) * p / (461.40 * (theta + 273.15))  # Humid air density[kg / m³]
    return rho