Development of a mathematical model for the prevention of epidemics and pandemics