def mod_temp_deriv(heat_coeff: float, mass_mod: float, heat_cap_mod: float, mass_flow: float,
                   temp_fuel: float, temp_mod: float, temp_in: float) -> float:
    """Compute time derivative of moderator temperature, $\frac{dT_mod}{dt}(t)$

    Args:
        heat_coeff:
            float, heat transfer coefficient of fuel and moderator [J/K/sec]
        mass_mod:
            float, mass of moderator                               [kg]
        heat_cap_mod:
            float, specific Heat capacity of moderator             [J/kg/K]
        mass_flow:
            float, total moderator/coolant mass flow rate          [kg/sec]
        temp_fuel:
            float, temperature of fuel                             [K]
        temp_mod:
            float, temperature of moderator                        [K]
        temp_in:
            float, temperature of inlet coolant                    [K]
    """
    return (heat_coeff / (mass_mod * heat_cap_mod)) * (temp_fuel - temp_mod) - (2 * mass_flow / mass_mod) * (temp_mod - temp_in)