def rho_rhostar(M, gamma):
    """Static density ratio for flow with heat addition (eq. 3.87)

    :param <float> M: Initial Mach #
    :param <float> gamma: Specific heat ratio

    :return <float> Static density ratio r/rstar
    """

    return 1.0 / M ** 2 / (1.0 + gamma) * (1.0 + gamma * M ** 2)