def calc_dc_dt(v, q, c_i, c_e, e):
    """
    calculates the derivative of the co2 concentration

    :param v:       room (or zone) volume (m3)
    :param q:       flow rate of outdoor or replacement air (m³/h)
    :param c_i:     CO2 concentration in the room (mg/m³);
    :param c_e:     CO2 concentration in outdoor air or replacement air (mg/m³);
    :param e:       CO2 emission rate of indoor sources (mg/h)
    :return:        derivative d c_i / dt
    """

    return (e - (c_i - c_e) * q) / v / 3600