  The paradigm for compartment models in epidemiology assumes exponentially
distributed incubation and removal times, which is not realistic in actual
populations. Commonly used variations with multiple exponentially distributed
variables are more flexible, yet do not allow for arbitrary distributions. We
present a new formulation, focussing on the SEIR concept that allows to include
general distributions of incubation and removal times. We compare the solution
to two types of agent-based model simulations, a spatially homogeneous one
where infection occurs by proximity, and a model on a scale-free network with
varying clustering properties, where the infection between any two agents
occurs via their link if it exists. We find good agreement in both cases.
Furthermore a family of asymptotic solutions of the equations is found in terms
of a logistic curve, which after a non-universal time shift, fits extremely
well all the microdynamical simulations. The formulation allows for a simple
numerical approach; software in Julia and Python is provided.
