Int. J. Dynam. Control (2018) 6:384–397 https://doi.org/10.1007/s40435-016-0283-5 An optimal control problem for a spatiotemporal SIR model Adil El-Alami Laaroussi 1 · Mostafa Rachik 1 · Mohamed Elhia 1,2 Received: 31 July 2016 / Revised: 1 November 2016 / Accepted: 2 November 2016 / Published online: 19 November 2016 © Springer-Verlag Berlin Heidelberg 2016 Abstract In this paper, an SIR spatiotemporal epidemic model is formulated as a system of parabolic partial differen- tial equations with no-flux boundary conditions. Immunity is forced through vaccine distribution considered a control vari- able. Our principal objective is to characterize an optimal control that minimizes the number of infected individuals and the costs associated with vaccination over a finite space and time domain. The existence of solutions to the state sys- tem and the existence of an optimal control is proved. An optimal control characterization in terms of state and adjoint functions is provided. Furthermore, a second condition of optimality is given. The optimality systems are solved based on an iterative discrete scheme that converges following an appropriate test similar the one related to the forward– backward sweep method. Numerical results are provided to illustrate the effectiveness of our approach for several sce- narios. Keywords Optimal control · First order optimality conditions · Parabolic SIR model · Second order optimality conditions · Dual system · Numerical method B Adil El-Alami Laaroussi adilelalamilaaroussi@gmail.com 1 Laboratory of Analysis Modeling and Simulation, Department of Mathematics and Computer Science, Faculty of Sciences Ben M’Sik, Hassan II University, Mohammedia, Sidi Othman, BP 7955, Casablanca, Morocco 2 Modelling Laboratory for economics and management, Department of Mathematics and Computer Science, Faculty of Law, Economics and Social Sciences, Beausite, Ain Sebaa, BP 2634, Casablanca, Morocco 1 Introduction In epidemiology, mathematical modelling has become an important tool in analyzing the causes, dynamics, and spread of epidemics. Indeed, mathematical models provide a deeper insight into the underlying mechanisms for the spread of emerging and reemerging infectious diseases and allow authorities to make decisions regarding the effective con- trol strategies [1]. The analysis of mathematical models describing epidemics spreading bring answers to some very important questions such as: – How many people will be infected? – What is the expected maximum number of people infected at any given time? – What is the estimated duration of the epidemic? – What is the effect of control measures (isolation, quar- antine, vaccine and treatment) on the spread of most infectious diseases? To give a full account on mathematical study of diseases would require a book in itself. However, an interesting overview on the use of mathematical models in epidemi- ology, can be found in Baily et al. [2], Anderson et al. [3], Hethcote [4], Brauer and Castillo-Chavez [5], Keeling and Rohani [6] and Huppert and Katriel [7]. One of the most basic procedures in the modelling of diseases is to use a compartmental model, in which the pop- ulation is divided into different groups based on the stage of infection, with assumptions about the nature and time rate of transfer from one compartment to another. Several diseases which confer immunity against re-infection were modeled using the susceptible-infected-recovered (SIR) model. In this model, the total population is divided into three disease-state compartments. The susceptible compartment (S) consists of 123