Mathematical Problems in Engineering

Volume 2016 (2016), Article ID 5076879, 10 pages

http://dx.doi.org/10.1155/2016/5076879

## Optimal Control Applied to an Irrigation Planning Problem

^{1}CMAT and Departamento de Matemática e Aplicações, Universidade do Minho, Campus de Azurém, 4800-058 Guimarães, Portugal^{2}SYSTEC-ISR, Faculdade de Engenharia, Universidade do Porto, Rua Dr. Roberto Frias, 4200-464 Porto, Portugal^{3}Centro de Física, Universidade do Minho, Campus de Gualtar, 4710-057 Braga, Portugal

Received 31 December 2015; Revised 22 March 2016; Accepted 26 April 2016

Academic Editor: Jean-Christophe Ponsart

Copyright © 2016 Sofia O. Lopes et al. This 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.

#### Abstract

We propose a mathematical model to study the water usage for the irrigation of given farmland to guarantee that the field crop is kept in a good state of preservation. This problem is formulated as an optimal control problem. The lack of analytic solution leads us to turn to numerical methods to solve the problem numerically. We then apply necessary conditions of optimality to validate the numerical solution. To deal with the high degree of unpredictability of water inflow due to weather, we further propose a replan strategy and we implement it.

#### 1. Introduction

The climate system and the ecosystems are under accelerated change while human cultures, economic activities, and national interactions are undergoing dramatic and sometimes exponential changes [1]. The world population is increasing and according to some estimates it will pass 8 billion by 2030. At the same time an increasing number of people are becoming more prosperous and need more water, in the form of the liquid itself and through the use of other products, virtual water.

According to [2], the water flow needs that typically occur every year in the spring/summer period, with a marked intensity in Southern Europe, namely, Portugal, limit strongly the agriculture production. Consequently, it is appropriate to discuss the use of water in these conditions, trying to find the best technical solutions making it possible to improve the efficiency of water use, in response to the environmental concerns. Agriculture exerts pressure on the environment, especially on water, in terms of quantity and quality. An appropriate water management throughout the irrigation processes is the right way to go.

In this paper, we propose a simple mathematical model that will help to plan the water used in a field of potatoes in the Lisbon area. This model is based on a dynamic equation that can translate the hydrological balance equation.

We assume that the soil is homogeneous and that the soil has one cubic meter of volume. A first model is used as a prototype to qualitatively validate irrigation of a farm field. In the literature, there are some examples for irrigation of potatoes farm fields in the Lisbon area. Using their inputs, we are able to qualitatively reproduce the literature outputs. The next step is to calibrate and test our model in a real farm [3].

In order to characterize the solution to our problem, we guarantee the existence of solution via Clarke’s theorem [4]. Next we characterize the solution using the necessary conditions of optimality in the normal form and then we use such information to validate the numerical solution.

Although preliminary results on this subjects are presented in [5–9], here we improve them and discuss them in detail. Additionally, here we propose the implementation of the replan methodology. Due to weather unpredictability, rainfall might be difficult to estimate accurately. To account for this fact, we propose the recalculation of the optimal strategy every time we obtain new data: a replanning or receding horizon strategy.

#### 2. Characterization of the Solution of the Irrigation Problem

Our problem consists in optimizing the planning of the water used in the irrigation of farm fields by means of the optimal control, where the trajectory is the water in the soil and the control is the flow of water introduced in the soil via its irrigation system. The formulation is as follows:

OCP is as follows:where is the hydrologic balance function, is the hydrological need of the crop (according to [3]), is an initial state, is a given time, and is the maximum flow of water that comes from tap.

The dynamic function that represents the hydrologic balance is given by , where is the rainfall minus the evapotranspiration and is the percentage of losses of water due to the runoff and deep infiltration [10]. Without loss of generality, we assume that is a continuous function. This optimal control problem has inequality state constraints that can be written in the form , where .

Since our optimal control problem has inequality constraints, applying the Maximum Principle to this problem does not allow us to get the explicit analytical solution to the problem.

To guarantee that our problem is meaningful we first prove the existence of the solution. Next, we apply necessary conditions to get some characterization of the optimal solution.

##### 2.1. Existence of Solution and Normality

Here, we discuss the existence of an admissible solution, the existence of an optimal solution, and normality of the optimality conditions. The existence of solution asserts the meaningfulness of our problem. The information extracted from necessary conditions will be of use to validate the numerical results. In order to guarantee that there exists an admissible solution, we have to guarantee that we start at a feasible state and that the maximum flow of incoming water is sufficient to satisfy the needs of the crop throughout the year. We show that, in these conditions, we can also guarantee the existence of an optimal solution to the OCP and that the necessary optimality conditions for this problem can be written in a normal form.

Existence of solution was introduced by Tonelli [11] when he proposed the first theorem of existence of solution for calculus of variations problems. Even today, Tonelli’s theorem remains the central existence theorem for dynamic problems, although the hypotheses of the theorem can be relaxed: see, for example, [12]. In this section, we apply theorem 23.10 in [4] to guarantee the existence of solution for our OCP. Moreover, we also verify that our problem satisfies the constraint qualification that allows writing the Maximum Principle (MP) in the normal form: the multiplier associated with the objective function is not zero (see [13, 14] for discussion of normal forms of the MP for optimal control problems with state constraints).

Normal forms of the Maximum Principle can be established if the problem satisfies suitable constraint qualification [13–15]. In this section, we verify that constraint qualification in [14] is satisfied for our problem.

Let function represent the unmaximized Hamiltonian function:where and are multipliers.

We note that the function is mensurable.

Proposition 1 (existence of solution and normality). *If and for all , then*(i)*there exits an admissible solution;*(ii)*there exists an optimal solution;*(iii)*the Maximum Principle can be written with .*

*Proof. * *Existence of an Admissible Solution*. It is easier to see that an admissible solution to OCP is where .

We note that since , then . As , then .*Existence of an Optimal Solution*. Let us verify the conditions of theorem 23.10 in [4]; see Theorem A.1 (in Appendix).

To apply theorem 23.10, the OCP is written as follows:

is as follows: where .

Let us verify the conditions of theorem 23.10 to :(i)The dynamic function is continuous with respect to the states and control variable and measurable in .(ii) is a compact set.(iii)In this condition, we have to verify that there is a summable function such that : We note that . As and is a continuous function on , then Let ; then (iv)For each and , the set is convex.(v)The sets and are closed and the cost function is continuous.(vi)The set is bounded.The assumptions of theorem 23.10 in [4] are verified; therefore there exists one admissible for OCP with a finite value on the cost functional; then there is a solution to OCP.*The Maximum Principle Can Be Written with *. In Rampazzo and Vinter [14], the MP can be written with , if there exists continuous feedback such thatfor some positive , whenever is close to the graph of the optimal trajectory, , and is near to the state constraint boundary. There should exist a control (flow of water provided by the irrigation systems) pulling the state variable away from the state constraint boundary (this guarantees that the crop survives).

In our problem and, from (8), we writewhere . For on a neighbourhood of , we can always choose sufficiently large so that (9) is satisfied, as long as , a condition we can impose with loss of generality.

Thus the inward pointing condition (9) is satisfied and normality follows.

*2.2. Necessary Conditions*

*In this section, we apply the MP in the normal form.*

*Proposition 2 (necessary conditions). If the pair is a minimizer for the OCP, then there exists an absolutely continuous function and such that where is defined as follows: *

*Proof. *A known form of the normal MP for smooth problems with state constraints [1, 3, 15] is as follows.

Let be a minimizer for OCP. Then there exists an absolutely continuous function and such thatApplying these conditions to our problem, we have

*2.3. Characterization*

*Now, we characterize the optimal solution for OCP studying the Weierstrass condition of the MP for , , and .*

*Proposition 3 (characterization of the optimal solution). Let be the optimal control to OCP and let be the multiplier associated with the dynamic function on the MP. Then the bounded variation function in Proposition 2 satisfies *

*Proof. *If , we have that, for all , If , we have that, for all , In the remaining case (i.e., ), we have

*We will use all the above information to validate the numerical solution (already presented in [7]) of our problem. In order to obtain this numerical solution, we consider next a discretized version of our problem.*

*3. Numerical Model for the Irrigation Problem*

*In this section, we obtain the numerical solution to our problem using sequence of finite dimensional nonlinear programming problems. From now on, we consider the following corresponding discrete-time model:*

*OCPN is as follows:where is the trajectory, is the control, is balance water function, is the hydrological need of the crop, is an initial state, is the time step discretization, and . The dynamic equation implements the water balance in the soil:where the evapotranspiration is the evaporation of the soil and the transpiration of the crop and the losses are the losses of water due to the runoff and deep infiltration. The rainfall, evapotranspiration, and losses models are described next, as presented in [10].*

*3.1. Rainfall Models*

*To estimate rainfall, we use the monthly rainfall data from Instituto Português do Mar e da Atmosfera (http://www.meteo.pt/), in the Lisbon area. We defined average (using the 10-year data) rainfall for each month of the year; the rain monthly average is as follows:*

*To create the possibility of different weather scenarios, the rain monthly average is multiplied by a precipitation factor. That means where the precipitation factor allows us to consider a typical year if this factor is 1, a drought year if it is less than 1, and a rainy year if it is above 1. This model is based on rain monthly average, so it is interesting if we are solving the yearly problem, for instance, if we want to design a reservoir [6] that can provide the necessary amount of water to our culture.*

*3.2. Evapotranspiration Model*

*We used the Pennman-Monteith methodology [16] to calculate evapotranspiration of our culture along the year. In order to do so, we use the following formulation: where is the culture coefficient for the evapotranspiration (in our case potatoes) and is the tabulated reference value of evapotranspiration that we consulted in [3] for the Lisbon region. The evapotranspiration of our culture in Lisbon is given by the following table: *

*3.3. Modeling “Losses” of Water*

*Our model of infiltration is based on the postulate of Horton’s equation that says that infiltration decreases exponentially with time [17]. That means the dynamical equation iswhere . Note that we have a first-order linear ordinary differential equation with integrating factor equal to .*

*From (19) and (24), one may say that , where depends on the type of soil.*

*3.4. Results and Validation*

*We consider a field of potatoes in the region of Lisbon, Portugal. We assume that*

*To obtain the numerical solution for the optimal control problem we have approximated the problem by a sequence of finite dimensional nonlinear programming problems (see [18]).*

*To implement this optimization problem, we use fmincon function of MatLab with the algorithm “active set,” by default, and the parameter “Tolfun” is considered . The numerical solution and the expected multipliers are plotted in Figure 1.*