def mix(parcel, environment, rate, dz):
    """
    Mix parcel and environment variables (for entrainment).

    Args:
        parcel: Parcel value.
        environment: Environment value.
        rate: Entrainment rate.
        dz: Distance descended.

    Returns:
        Mixed value of the variable.
    """
    return parcel + rate * (environment - parcel) * dz