def sir_dydt(t, y, beta, gamma, N):
    """
    Defines the differential equations for the SIR model system.

    Arguments:
        t :  time
        y :  vector of state variables:
                    y = [S, I, R]
        beta, gamma, N : model parameters
    """

    S, I, R = y

    # Output array of form f = (S', I', R')
    f = [- (beta * I * S)/N,
           (beta * I * S)/N - gamma * I,
           gamma * I]

    return f