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 [59], 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 [1315]. 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.

Note that the green line represents the hydrological need of the crop.

It can be seen that the value of the optimal amount of water in the soil stays at the minimum allowed value from June till September. The irrigation should start in May; the maximum value is in June and stops in September. The water needs are 0.4612 . The code produces results that are according to what is expected for this region [3].

We can observe that and since is never equal to , is never greater than , as expected from Section 3.3. From here, we can say that although the analytical explicit solution was not obtained, the numerical solution fulfils the necessary optimality conditions.

Our numerical findings suggest that the trajectory has a “boundary interval” , with and (i.e., for all and for ) and that is absolutely continuous function excepted at where it exhibits a jump. Taking these information into account we now get an analytical characterization of the solution and multiplier.

Step 1 ( for ). Since the inequality constraint is not active, then . Thus we most have and since , by the adjoint equation of the MP, we can conclude that .
Applying the Weierstrass condition of MP, we get ,  . Thus .
Replacing by zero in the dynamics, we have As , then , for .
Therefore and , for .

Step 2 ( for ). As for : , we have . Therefore And we may conclude that for .
Since for , then by the MP we also conclude that , .

Step 3 ( for ). Since , then . Again, as and , by the adjoint equation of the MP, we can conclude that .
On the other hand ; then by Weierstrass condition we get ,  . Therefore .
Consequently, our dynamics is written as follows: Since , then , for .
Therefore and , for .

Briefly,

In Figure 2, we plot the numerical and analytical solution obtained. We confirm that the numerical solution agrees with the results shown in Section 3. The analytical and estimated results of trajectory, control, and multipliers coincide.

3.5. Replan

In the previous section, we have computed optimal yearly planning for the needs of water. However, such planning is open-loop, meaning that the input used the prediction for the rainfall along the year as known in the beginning of the year. As we advance through the year, knowledge of the effective past rainfall and a better prediction of the rainfall for the coming months is available. In this section we propose to use this newly available knowledge by resolving the optimal control problem at each month using the new rainfall information, in a receding horizon framework.

In fact, due to the unpredictability of weather conditions, the numerical model presented in the previous section may not provide the real needs of water for the crop. If we have an atypical year, values obtained by the rainfall model may be a lot different from reality, meaning that there is a high probability that the results obtained may not properly describe the reality (if we use as input in our previous model the effective rainfall in each month, the estimated irrigation needs may be higher than if we use as input the rainfall model proposed in Section 3.1).

In Figure 3 we show the results for the years 2004 and 2005 which were severe drought years in Portugal.

For the year 2004, if we look at real data, one can see that the irrigation should start in the mid-April. Using the rainfall as input, the irrigation should start in May. The total amount of water used estimated using the rainfall model is and the real amount of water needed would be .

For the year 2005 if we look at real data, one can see that the irrigation should start in the beginning of March. Using the rainfall model as input, the irrigation should start in May. The real amount of water needed would be .

This is due to the unpredictability of the weather. The rainfall was much different from the expected, and, as a consequence, in such a scenario the proposed model would fail.

To overcome this drawback, we propose replan strategy: see Figure 4. To replan the systems we use model predictive control techniques. The predictive control technique generates a feedback strategy by solving a sequence of open-loop optimal control problems. In terms of the problem, this means that the irrigation strategy is frequently recomputed (replan) every time taking into account the measured system variable (previous pluviosity). In our case, we determine the optimal solution based on the OCPN and then at every time step we recalculate a new dynamic based on real data for rainfall.

We test the replan model for the last ten years and we observe that state constraint is violated in the years 2003, 2005, 2007, 2008, and 2009. For data of year 2005, the result obtained is described in Figure 5.

To avoid violation of the state constraint (because of use of real data) an improved model had to be considered. In this new model, we use soft state constraints instead of hard state constraint. Therefore, we consider an optimal control problem with penalization in the cost function:

In this case where . Note that the condition is reused at each time step considering the real value of rainfall at that time step.

Note that represents a safety margin that will guarantee that if weather conditions are very severe, the plant survives. In our case we consider meaning that the amount of water necessary is above the plants’ needs. However, should time step be smaller, this safety margin may be reduced.

Results for the improved replan strategy can be seen in Figure 6.

Figure 6 shows that for the year 2005 the state constraint is not violated and the result is very close to the optimal solution obtained knowing the rainfall a priori. The water flow needs obtained knowing the rainfall a priori were . The water flow needs estimation using the replan strategy was . Similar results were observed for the remaining years.

4. Conclusion

Our problem consists in optimizing the use of water in irrigation of a farm field by means of optimal control with inequality constraints. We proposed minimizing the irrigation (control) so that the flow of water introduced in the soil (trajectory) fulfils the cultivation water requirements. The corresponding discrete problem was then formulated and the numerical solution obtained. In order to validate the numerical results, we characterized the solution analytically. We proved the existence of solution and we characterized the solution applying the necessary conditions of optimality in the form of the Maximum Principle. We conclude that the multiplier when and when .

From the numerical solution, we determined and where the state constraints were active. With and we calculated the analytical solution. We observed that analytical and numerical results were very similar.

Due to the weather unpredictability, rainfall estimation may be far from reality. In such a case, the results obtained may not be the best. In order to overcome this difficulty we implemented a replan strategy, considering soft state constraints. Even for a severe drought year like 2005, this new strategy produced good results.

Appendix

Auxiliary Result

Here, we present an adaptation of theorem 23.10 from [4] to the particular case of our problem that can be written as follows:

OP is as follows:

Theorem A.1 ((existence) (theorem 23.10 in [4])). Let the data of optimal control problem satisfy the following hypotheses:(i) is continuous in and measurable in .(ii) is compact.(iii) has linear growth on : there is a summable function such that (iv)For each , the set is convex.(v)The sets and are closed, and is lower semicontinuous.(vi)The following set is bounded: Then, if there is at least one admissible process for the problem, it admits a solution.

Competing Interests

The authors declare that they have no competing interests.

Acknowledgments

The financial support of PTDC/EEI-AUT/2933/2014 and UID/MAT/00013/2013 is gratefully acknowledged.