# Profitability Assessment of Precision Agriculture Applications--A Step Forward in Farm Management
## 2 Materials and Methods
### Algorithms Developed  
A set of interrelated functions have been setup for ProFit, which carry out arithmetic, categorical, and logical operations and transfers of tabular data. The overall arrangement is integrated and executed in a prototype Excel spreadsheet, where all internal functions and options and the external data feed are arranged. The monetary rate unit is set to euros per hectare (\(\epsilon\)/ha), the fertilizer amounts in kilograms per hectare (kg/ha), and the yield in tons per hectare (t/ha) (Figure 3).  
Figure 3: The prototype Excel spreadsheet of the ProFit algorithm, filled with true data from the 2022 cultivation year (four indicative fields) orange colour indicates input cells, while green the output ones (not applicable in the contributing databases, on the right side); the other colours are used only to emphasize the structure of the table; numbers [1, 2], etc. refer to the cost categories, as described earlier in the manuscript.  
The basic formula for cost, earnings, and profit calculations applied per field is shown simplified below:  
Cost (per field) =  
Field Rental Cost [9] +  
Field Shared Cost for Seeds [10a] +  
Field Shared Cost for Irrigation [10b] +  
...  
Field Shared Cost for Machinery [10g] +  
Quantity of Fertilizer-1 [Input from the Fertilization Maps of PreFer database] \(\times\) Price of Fertilizer-1 (manual input in relevant table) +  
Quantity of Fertilizer-2 [Input from the Fertilization Maps of PreFer database] \(\times\) Price of Fertilizer-2 (manual input in relevant table) +  
...  
Quantity of Fertilizer-n [Input from the Fertilization Maps of PreFer database] \(\times\) Price of Fertilizer-n (manual input in relevant table)  
(n: the number of different Fertilizers)  
Earnings (per field) =  
Earnings from Cultivar-1 = Yield (t/ha) [Input From the Yield Map] \(\times\) Cultivar-1 Price (monetary unit/kg) [Input from the Crop List] +  
Earnings from Cultivar-2 = Yield (t/ha) [Input From the Yield Map] \(\times\) Cultivar-2 Price (monetary unit/kg) [Input from the Crop List] +  
...  
Earnings from Cultivar-m = Yield (t/ha) [Input From the Yield Map] \(\times\) Cultivar-m Price (monetary unit/kg) [Input from the Crop List]  
(m: the number of different Cultivars)  
Profit = Earnings - Cost (per field)  
Cost, Earnings, and Profit figures can be calculated per Cultivar if only the fields with a specific Cultivar are selected at a time. Finally, by summing up of all the fields, the entire farm's figures can be found.  
For splitting the shared cost lump sums of the different agricultural work categories into cost items per field, a stepwise procedure is followed (Figure 4):  
1. First, the rate of difficulty of each field is multiplied by the field's extent and then divided by the number of fields under consideration to give a weighted rate of difficulty;
2. Then, the weighted rate of difficulty of each field is divided by the total weighted rate of difficulty to give the cost share for the field (for each of the shared cost categories);
3. Finally, the cost share of every field is multiplied by the total cost of the category and divided by the number of fields to give the absolute cost per field (for that cost category).  
Figure 4: The prototype of the cost lump sum splitting-per-field algorithm, here applied for work category [5] Weed killers as an example (use of the same dataset as in Figure 3); orange colour indicates input cells, while green the output ones; the other colours are used only to emphasize the structure of the table.  
Therefore, for every category, the algorithm retrieves the lump sum amount for the entire cultivation from a manually filled table and the field extents from the farm's geo-database (i.e., from PreFer). Thus, the only inputs required by the algorithm are the rates of difficulty per field and for each work category. An internal control function will check if the earlier entered lump sum for the working cost category is equal to the one calculated by the algorithm.