Research Article An Optimal Control for a Two-Dimensional Spatiotemporal SEIR Epidemic Model Khalid Adnaoui 1 and Adil El Alami Laaroussi 2 1 Laboratory of Analysis Modeling and Simulation, Department of Mathematics and Computer Science, Faculty of Sciences Ben M’Sik, Hassan II University Casablanca, BP 7955, Sidi Othman, Casablanca, Morocco 2 Laboratory of Applied Sciences and Didactics, Higher Normal School Tetouan, Abdelmalek Essaadi University, Tetouan, Morocco Correspondence should be addressed to Khalid Adnaoui; khalid.adnaoui@gmail.com Received 15 September 2019; Revised 15 February 2020; Accepted 18 February 2020; Published 4 April 2020 Academic Editor: Jingxue Yin Copyright © 2020 Khalid Adnaoui and Adil El Alami Laaroussi. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. In this paper, we present an application of optimal control theory on a two-dimensional spatial-temporal SEIR (susceptible, exposed, infected, and restored) epidemic model, in the form of a partial differential equation. Our goal is to minimize the number of susceptible and infected individuals and to maximize recovered individuals by reducing the cost of vaccination. In addition, the existence of the optimal control and solution of the state system is proven. e characterization of the control is given in terms of state function and adjoint. Numerical results are provided to illustrate the effectiveness of our adopted approach. 1. Introduction In the literature, there are numerous books and articles [1–7] that deal with epidemic mathematical models. It is well established that human mobility plays an important role in the spread of an epidemic [8–13]. Mathematical modelling of the spread of infectious diseases has an important influence on disease management and control [14–16]. In general, after the initial infection, a host remains in a latency period before becoming infectious, so the population can be divided into four categories: susceptible (S), exposed (E), infected (I), and recovered (R). In this contribution, we treat a model of epidemic type SEIR in which the model takes into account the total population size as a refrain for the transmission of the disease, and it is assumed that it is constant over time. e approach used is based on the work of El Alami Laaroussi et al. [17, 18], which was applied on a SIR model. So, our goal is to characterize optimal control in the form of a vaccination program, maximizing the number of people reestablished and minimizing the number of susceptible, infected people and the cost associated with vaccination over an infinite space and in a time domain. e theory of semigroups and optimal control makes it possible to show the existence of state system solutions and optimal control and to obtain the optimal characterization of this control in terms of state functions and adjoint functions. To illustrate the solutions, based on the numerical results, we find that the use of the vaccine control strategy in the spatial region helps to fight the spread of the epidemic in this region over a period of 60 days. e structure of this article is as follows. Section 2 is devoted to the basic mathematical model and the associated optimal control problem. In Section 3, we prove the existence of a strong global solution for our system. e existence of the optimal solution is proved in Section 4. e necessary optimality conditions are defined in Section 5. As an application, the numerical results associated with our control problem are given in Section 6. Finally, we conclude the paper in Section 7. 2. The Basic Mathematical Model 2.1.eModel. In this paper, we consider the following SEIR epidemic model (susceptible (S), exposed (E), infected (I), and recovered (R)): Hindawi International Journal of Differential Equations Volume 2020, Article ID 4749365, 15 pages https://doi.org/10.1155/2020/4749365