Optimization is a process whose purpose is to find a particular configuration of inputs and actions that leads to the best possible results. The objective of optimization may be to maximize profit from crops, minimize the cost of fertilizer consumption or, for example, minimize the probability of a plant pandemic breaking out.
Optimization is therefore a process that strives to achieve extreme results—maximum or minimum ones. In principle, a grower can specify only one optimization objective.1
The result of optimization will be a clear indication of the actions that should be taken in order to achieve the maximum level of the specified objective. Effective optimization can be performed only by means of linear programming. This method is based on mathematical equations and inequalities.
W-MOSZCZYNSKI-2023-4-46Personally, I do not know anyone who likes mathematics. Nor do I know anyone who does not use calculations to work through problems that are more or less complex. Mathematics is therefore associated with ambivalent emotions: on the one hand, we avoid it, while on the other, we cannot live without it.
Planning is the most important element in managing cereal crops. The economic result achieved in the following months depends on the quality of planning. Many unknowns arise, including the weather and future grain purchase prices. We instinctively feel that, by calculating skilfully, we can increase our earnings, shorten travel time or minimize risk. Sometimes we see our actions fail, discover our mistakes and calculate our losses. Very often, we are forced to rely on blind chance. An additional tool in the form of a better calculator or planning program would certainly be useful.
Operations research
To plan better, we must rise above intuition and our own experience and enter deeply into mathematical analysis, differential operations, formulas and charts. Who has time for that today?
Must a cereal grower also be a mathematician? As ordinary people, we are reluctant to enter unfamiliar ground—especially ground saturated with rules and equations and shrouded in a fog of abstract mathematical expressions. The truth, however, is different.
Mathematical methods for planning agricultural production are very simple and should not be feared. Optimization consists of two steps: formulating mathematical inequalities and entering them into an online calculator.
The first step appears difficult. It is indeed difficult, but if we have several good examples, we can simply copy the formulas and substitute our own values. It is also worth noting that, once we have succeeded in optimizing something, we will be able to use the same formulas in other cases or in subsequent years. Sometimes it is worth taking a step toward new technologies—especially when it does not involve any expenditure.
Thanks to this publication and the simplex calculators available online, it will be possible to introduce a new technology for production planning relatively easily and painlessly.
It is worth introducing a little mathematics in order to improve the quality of our business, increase profitability, minimize risk and generally improve the quality of processes. We will use algorithms—that is, linear programming—simple enough to be understood by anyone who has had even minimal contact with mathematics.
1 There are methods that combine several optimization objectives. This is done by defining a single objective in the form of an indicator composed of many partial objectives. Defining a single objective is the most effective optimization method.
What is linear programming and when was it created?
Linear programming was invented in 1939 by the Soviet economist Leonid Kantorovich. The method was widely used by the Allies during the Second World War. With limited resources, they had to allocate them optimally. Planners attempted to reduce the risk of convoys losing cargo, maximize the effects of carpet bombing and mathematically minimize casualties. Optimization equations reduced the risks of delays in supply deliveries and indicated how the available resources could be used most effectively. The algorithms used at that time were very complicated. Shortly after the war, in 1947, George Dantzig, an analyst with the United States Air Force, simplified optimization methods while introducing a range of analytical innovations. This made linear programming widespread in production planning and logistics across every industry throughout the world.
Planning the fertilization process using linear programming
A farm has one tonne of fertilizer N1 and half a tonne of fertilizer N2 in storage. The fertilizers remained from the previous period and must be used in the current season.
The farm grows rare plants. The use of the two artificial fertilizers mentioned above is necessary for their cultivation. In addition to nutrients, the fertilizers also contain protective substances that protect plants against disease. They are specialist fertilizers intended exclusively for use with four plant species. Without these fertilizers, there is a significant probability that the plants will not emerge. For them to emerge, both fertilizers must be used simultaneously.
The grower must use the fertilizer remaining in storage and wants to select, from among the four plant species, the one that will generate the greatest revenue.
The rows of the table below contain four plant species. The required quantities of fertilizers N1 and N2 for each plant are shown. Fertilizer consumption is stated in kilograms per tonne of yield.
| Fertilizer N1 | Fertilizer N2 | Revenue per tonne | |
|---|---|---|---|
| Plant A | 24 kg | 19 kg | PLN 200/t |
| Plant B | 15 kg | 21 kg | PLN 180/t |
| Plant C | 27 kg | 30 kg | PLN 400/t |
| Plant D | 15 kg | 8 kg | PLN 150/t |
| Input limit | ≤ 1,000 kg | ≤ 500 kg |
The estimated revenue per tonne of each plant species appears at the side of the table. Producing species C is the most profitable; revenue is PLN 400 per tonne. The least per tonne will be obtained from the sale of plant D: revenue will be just PLN 150 per tonne.
Fertilizer-consumption constraints appear at the bottom of the table. We may not use more than 1,000 kg of fertilizer N1, and no more than 500 kg of fertilizer N2.
Because of the small scale of production, the grower must choose one particular variety to cultivate.
The starting point for planning is to specify the decision variable. It is the planned number of tonnes of the plant selected for cultivation in the current season. Our constraint is the amount of fertilizer required.
Thus, if we decide to produce x₁ = 30 tonnes of plant A, the table allows us to calculate how much fertilizer we will use:
24 kg/t × x₁ tonnes (fertilizer N1)
19 kg/t × x₁ tonnes (fertilizer N2)
x₁ tonnes × PLN 200/t (revenue)
Because we assumed that x₁ = 30 tonnes:
24 kg/t × 30 tonnes = 720 kg (fertilizer N1)
19 kg/t × 30 tonnes = 570 kg (fertilizer N2)
30 tonnes × PLN 200/t = PLN 6,000 (revenue)
Unfortunately, we exceeded the limit for fertilizer N2. There are only 500 kg of that fertilizer in storage. In addition, 280 kg of fertilizer N1—which we wanted to use this season—remains in storage.
If we reduce the number of tonnes of plant A produced, we will reduce revenue and increase the amount of unused fertilizer N1.
To optimize something, we must have a specified objective. Our objective is to maximize crop revenue.
If we assume that x₁ is the sought number of tonnes of plant A, x₂ the sought number of tonnes of plant B, x₃ the sought number of tonnes of plant C, and x₄ the sought number of tonnes of plant D, we can formulate the objective function as:
F(X₁…₄) = 200x₁ + 180x₂ + 400x₃ + 150x₄ → max (1)
We have just formulated the objective function of the linear-programming model.
If we decided to produce 30 tonnes of plant A—x₁ = 30, x₂ = 0, x₃ = 0 and x₄ = 0—then:
F(X₁…₄) = PLN 200 × 30 tonnes = PLN 6,000
According to the assumptions, we cannot use more fertilizers N1 and N2 than we have in storage. With the table showing fertilizer consumption, we can easily write formulas presenting the constraints:
24x₁ + 15x₂ + 27x₃ + 15x₄ ≤ 1,000 (2)
19x₁ + 21x₂ + 30x₃ + 8x₄ ≤ 500 (3)
If we now decided to produce 30 tonnes of plant A, meaning x₁ = 30, we would obtain:
24×30 + 15×0 + 27×0 + 15×0 ≤ 1,000
19×30 + 21×0 + 30×0 + 8×0 ≤ 500
The last inequality is not satisfied, because 19 times 30 is 570, while the constraint is 500.
For the model to calculate correctly, we must also add the conditions that the numbers of tonnes we want to obtain must be greater than zero. The complete set of model inequalities is therefore:
24x₁ + 15x₂ + 27x₃ + 15x₄ ≤ 1,000 (2)
19x₁ + 21x₂ + 30x₃ + 8x₄ ≤ 500 (3)
x₁ ≥ 0 (4)
x₂ ≥ 0 (5)
x₃ ≥ 0 (6)
x₄ ≥ 0 (7)
We add objective function (1) to this set:
F(X₁…₄) = 200x₁ + 180x₂ + 400x₃ + 150x₄ → max
To calculate a linear-programming model formulated in this way, matrix calculus must be used. Calculating this task with a calculator and pen would probably take a great deal of time. It can be done more quickly by means of the graphical method.
Fortunately, many simplex calculators can be found on the Internet. We need only enter our inequalities to obtain the desired result. One is the Polish calculator at http://www.maslowski.pl.
First, we provide the number of variables and the number of constraints. We then enter our mathematical expressions.
At the bottom of the page, we find the result:
The optimal solution is:
x₁ = 0
x₂ = 0
x₃ = 0
x₄ = 62.5
x₅ = 62.5
x₆ = 0
x₇ = 0
x₈ = 0
x₉ = 0
x₁₀ = 62.5
x₁₁ = 0
x₁₂ = 0
x₁₃ = 0
x₁₄ = 0
The value of objective function z is: 9375
This calculator has a specific way of presenting results. The results of this exercise should be stated as integers. The grower therefore received the information that 62 tonnes of plant D should be cultivated. As we remember, this plant had the lowest purchase price.
Is the result correct? When we substitute x₄ = 62 into the formulas of our model, we obtain the following values:
| Fertilizer N1 | Fertilizer N2 | |
|---|---|---|
| Fertilizer consumption | 930 | 496 |
| Total revenue | 9,300 | |
| Fertilizer-consumption limit | ≤ 1,000 kg | ≤ 500 kg |
Producing 62 tonnes of plant D makes it possible to earn the most while leaving the smallest amount of fertilizers N1 and N2.
What would happen if we decided to produce other types of plants? Would total revenue be lower?
If we chose to cultivate plant C, then, in order not to exceed the fertilizer-consumption limits, we would have to assume a maximum of x₃ = 16 tonnes. Revenue would then be PLN 2,900 lower than revenue from cultivating plant D, and more than half a tonne of fertilizer N1 would remain in storage.
| Fertilizer N1 | Fertilizer N2 | |
|---|---|---|
| Fertilizer consumption | 432 | 480 |
| Total revenue | 6,400 | |
| Fertilizer-consumption limit | ≤ 1,000 kg | ≤ 500 kg |
If we chose to cultivate plant B, then, in order not to exceed the fertilizer-consumption limits, we would have to assume a maximum of x₂ = 23 tonnes. Total revenue would then be PLN 5,160 lower than revenue from cultivating plant D, and more than 600 kg of fertilizer N1 would remain.
| Fertilizer N1 | Fertilizer N2 | |
|---|---|---|
| Fertilizer consumption | 345 | 483 |
| Total revenue | 4,140 | |
| Fertilizer-consumption limit | ≤ 1,000 kg | ≤ 500 kg |
If plant A were selected, the difference in the revenue achieved would be PLN 4,100.
Summary
Today, we have learned a very simple method for optimizing agricultural-production planning. It should be understandable to everyone. In most cases, optimization is performed in more complex processes involving a dozen or even several dozen different constraints and variables. Optimization can be directed toward maximizing profits or minimizing costs; it can minimize risk or the consumption of chemicals. Optimization has no limits. The most diverse categories, monetary values, quantitative categories and degrees of probability can occur alongside one another within a single model. It is worth remembering that linear-programming algorithms always lead to extreme result values while preserving the specified constraints. In practice, it is very difficult to calculate complex economic dilemmas using conventional methods.
Wojciech Moszczyński — graduate of the Department of Econometrics and Statistics of Nicolaus Copernicus University in Toruń; specialist in econometrics, finance, data science, and management accounting. He specializes in the optimization of production and logistics processes. He conducts research in the area of the development and application of artificial intelligence. For years he has been engaged in the popularization of machine learning and data science in business environments.

Dodaj komentarz