Mathematics
Computer Science-2021.gz:143289
Computer Science
868444db217b855f738edd0cbcf052c709e35bec
Technology 4.0 with 0.0 costs: fuzzy model of lettuce productivity with magnetized water

In agriculture with 4.0 technologies, developing a decision model with a 0.0 cost is attractive to small farmers. In water management, if this approach could be used to promote sustainability and optimization, it could become a pathway to reach the sustainable development goal in 2030. The core of this work is the development of a 4.0 mathematical model (based on fuzzy concepts) to verify the benefits of the production of lettuce irrigated with magnetically treated water at different replacement rates. This approach is achieved using computational 4.0 software and manual methods. The aim of mathematical modeling is to understand or explain a natural phenomenon associated with a given area of knowledge, and fuzzy-rule-based systems have been widely used in different types of in-depth research.


Introduction
In all facets of life, the importance of water is indubitable because water is one of the most essential resources. There is tremendous concern regarding the main forms of the optimization of water use in numerous aspects of human society, e.g., in agricultural production.
In 4.0 technologies such as the Internet of Things (IoT), additive manufacturing, big data, cloud computing, and artificial intelligence, the discussion, design, and implementation are being used for agriculture 4.0, particularly in the areas of irrigation and sustainable water use.
Among the various technologies mentioned above, we highlight irrigation with magnetically treated water (MTW) as a prominent agricultural practice. This approach uses the expertise of conventional one-touch irrigation 4.0, and water is subjected to an external static magnetic field to promote the induction of proton transfer in the hydrogen bridge with the available molecules (Lopes, Kroetz, Alves, & Smiderle, 2007).
It is conjectured that this increase in production is a consequence of a set of changes caused by water magnetization, such as variations in the absorption value, pH, conductivity, and soil hardness (Ozeki, Miyamoto, Ono, Wakai, & Watanabe, 1996;Nasher, 2008;Khoshravesh, Mostafazadeh-Fard, Mousavi, & Kiani, 2011;Lyn & Yotavat, 1990). From the perspective of providing a detailed analysis of the effects of different technologies applied in agriculture, fuzzy mathematical models are being proposed as efficient and alternative methodologies for decision making, as illustrated by Gabriel Filho, Pigatto, and Lourenzani (2015), Pereira, Bighi, Gabriel Filho, and Cremasco (2008), Putti, Gabriel Filho, Silva, Ludwig, and Cremasco (2014), and Putti et al. (2017a).
Implementing a 4.0 technology in remote farming locations is not typically a reality for small farmers because of its high cost and energy efficiency issues. In this context, the objective of the present work is to develop a new model based on fuzzy modeling for the evaluation of the aerial green weight of lettuce irrigated with magnetically treated water. The objectives are to maximize the production and verify the methodology of the model for use by researchers in different areas.

Method for the elaboration of the fuzzy system
Developed with the purpose of modeling scenarios that are consistent with human reality, fuzzy sets and consequently fuzzy logic introduce flexibility and efficiency into decision-making algorithms. The option of working with models with semantic values that range between the classic 0 and 1, in addition to the aforementioned characteristics, enables the inclusion of the knowledge of experts in a given approach (Carneiro et al., 2018).
The concept of automation underlying most 4.0 devices is based on the triad of input, processing, and output. The highlight of the process is the instrument used as the processing tool, which can be a programmable logic controller (PLC), widely used in equipment for factory floors, or a microcontroller, which in addition to having a small integrated circuit, combines the functions of intelligence, memory, and control, thereby providing a low-cost system with high programming power. Alternatively, a fuzzy controller commanded by natural language terms can be used, resulting in a much more intuitive human-machine interface than those used by most classic processors.
In classical methods, the evaluation of a variable is performed based on a function of the universe of the discourse for the Z 2 field. A fuzzy evaluation fiber is a linguistic variable with values contained in fuzzy sets.
With the application of fuzzy logic, we developed a mathematical system suitable for the evaluation of lettuce crop productivity based on the analysis of two input variables: irrigation depth and water type. These variables were controlled by a set of language rules processed in a fuzzy inference method, thus generating a real number as a model response (Barros & Bassanezi, 2010). The developed system in the present study is shown in Figure 1, where the output variable returns culture productivity. With "irrigation depth" and "water type" data, the system determines the value of lettuce productivity with decision rules based on fuzzy concepts. As a starting point, we translated the above input data into fuzzy variables.
The fuzzy sets constructed for the input variables, irrigation depth L i and water type can be seen in Table  1 and Figure 2. Table 1. Definition of the membership functions of the input variable, "irrigation depth", and quartiles represented by Q1, Q2, Q3, Q4, and Q5.   In the absence of the software required to automatically determine the membership functions, the corresponding analytical expressions are developed by the traditional methodology (manually adjusted) for each partition Qi, where 0 ≤ ≤ 5, as follows: (i) For the lines with positive slope coefficients, in general, For the lines with negative slope coefficients, in general, Regarding the type of water, magnetically treated (MTW) or conventional (CW), we can establish the definitions in Table 2 and Figure 3.  The functions (membership functions) representing the fuzzy sets of the water type are described as: From the input data, the fuzzy rule-based system (FRBS) will determine the output values of the system by a set of rules based on a method that considers the percentiles of data sets, thus not requiring the knowledge of the experts (Figure 4). This method that relates the percentiles of data sets was adopted and used by Cremasco, Gabriel Filho, and Cataneo (2010), Gabriel Filho, Chacur (2011), Gabriel Filho et al. (2016), Putti, Kummer, Grassi Filho, Gabriel Filho, and Cremasco (2017b) Table 3 provides the behavior of lettuce for different irrigation depths and water types, and all possibilities are considered. Table 3. Production structure as a function of the depth and type of water.
The FRBS implements the decision process via a set of rules formalized, in general, based on the expertise of the subject to be modeled. The rules elaborated follow the scheme given below.
: If the irrigation depth is and the water type is MTW, then the productivity is 1− ; +4 : If the irrigation depth is and the water type is CW, then the productivity is 2− , with = 1,2,3,4 and = 1,2,3,4. For the construction of the fuzzy-rule-based output pertinence sets, the methodology developed by Cremasco et al. (2010) was followed. First, a descriptive statistical analysis was performed, which was used to obtain a measure for each group to analyze the median of repetitions ( = 5). Furthermore, the partitions ( , 0 ≤ ≤ 5) were determined, and therefore, it was possible to elaborate the expected productivity pertinence sets, as we can see in Figure 5 and Table 4. Thus, − ( = 1,2, = 1,2,3,4) will be equal to some (0 ≤ ≤ 5).  For the defuzzification of the system, we considered the center of mass or centroid method, which averages the areas of all the figures representing the pertinence degrees of the treated fuzzy subsets. This approach is as follows: To validate the analytical development of the Mamdani inference method used in this work, an experiment with magnetically treated water and a lettuce crop, as described in 4.1, was performed.

Description of the experiment
The experiment was conducted at the Experimental Lageado Farm and the Rural Engineering Department, both of the School of Agriculture of São Paulo State University (UNESP), Botucatu, São Paulo State, Brazil, at geographic coordinates 22° 51' south latitude and 48° 26' west longitude, with an average altitude of 786 m. According to the Köppen classification, the climate of the region is of Cfa type: a humid warm (mesothermal) temperate climate. The average temperature in the hottest months is over 22°C, and the average annual rainfall is 945.15 mm (Cunha & Martins, 2009).
The soil of the greenhouse was classified, according to Santos et al. (2018), as dystrophic red latosol with a moderate medium/clay structure. For this research, the soil used had the following chemical characteristics: The temperature and humidity parameters were recorded by an automatic weather station (Table 5). The experiment was established with a randomized block design in a 2 × 5 factorial scheme, and the following parameters were evaluated: two types of irrigation water (magnetically treated water (MTW) and conventional water (CW)) and five irrigation depths ( , 1 ≤ ≤ 5) from the reference evapotranspiration, ETo (0.25 ETo, 0.50 ETo, 0.75 ETo, 1 ETo, and 1.25 from ETo), totaling ten treatments with five repetitions. The magnetizer used was Sylocimol Rural.
Irrigation and the reading of the class A tank were performed daily at 8:00 am, and the time required was calculated as follows: where: is the irrigation time, is the crop coefficient, is the tank coefficient, is the evaporation of tank "class A" (mm day −1 ), is the spacing between the sides (m), is the drip spacing (m), is the irrigation efficiency (%), and e is the drip flow (L h −1 ).
To calculate the total irrigation depth to be applied, we used the method proposed by Snyder (1992) based on evaporation (Kp) and defined as = 0,0482 + 0,024 ln( ) − 0,00376. + 0,0045. where: is the coefficient of the tank, is the boundary of the vegetation area around the tank (m), é is the wind speed at a height of 2 m (m s −1 ), and is the average relative humidity (%). The values used followed the guidelines of FAO 56 (Allen, Pereira, Raes, & Smith, 1998), including 0.7 at the beginning of the growing season, 1 at mid-season, and 0.95 at the end.

Results and discussion
Analytical results

Fuzzification module
To make the resolutions simpler and more intuitive, we opted to work only with triangular membership functions, considering one of the inputs (the water type) with a model that always has a membership degree of 1 (crisp input). This relation is expressed as if the water is conventional type; and ( ) = 1, if the water is magnetized.
The inference method chosen for this case study was the Mamdani inference method, and all the inputs and outputs of the fuzzy variables of the system were assigned a triangular-type membership function. This relation set was given by the following analytical expression:

0, >
Thus, it was possible to obtain the equations with the formulas, specifically, given points (u, 1) and (a, 0), as represented in Figure 6. For abscissa values less than or equal to , the equation of the line in this range is given by = 0. Because the value of denotes the degree of relevance, ( ) = 0 when ≤ . Similarly, we have ( ) = 0 when ≥ .
For the equation of the line in Figure 6, denoted by (I), we have points ( , 0) and ( , 1), which when applied to the formula above, make it possible to obtain the calculation of the angular coefficient, , as follows: Similarly, one can calculate values for points ( , 1) and ( , 0).

Rules and fuzzy inference
As the title suggests, the central concept of this module is to mathematically translate the relationships that constitute expert knowledge. From the developments of Boole algebra, Frege logicism, and Cantor's set theory, we can translate the formal logical system into algebraic terms, sets, or norms. Thus, we have the following relations: In terms of the rules of inferences, the Mamdani method is based on the max-min composition of each rule. Specifically, for each R rule of the system, the conditionals of type "  → " are modeled by the following process: (i) The calculation of the minimum value of the degree of pertinence of the variables based on the "and" connective is adopted; (ii) For the "or" connective, the calculation is performed using the maximum value; (iii) The conditional is also modeled by the minimal application, but with one important detail: the lowest degrees of pertinence of A and B are transposed in an area in C.
It is important to note that if two or more rules are triggered in decision making, then union operations between the partial outputs of each rule are applied, i.e., the maximum region within the rules is used.
For the application of this construction, a system with entries characterized as follows was considered: depths , where 1 ≤ ≤ 5; membership degrees equal to 1; and the magnetization water type. The objective was to obtain the productivity level achieved.
As a case study, we examine the L1 depth and formulas for calculating all the productivities in the list of choices of the expert. To make the calculations intuitive, we represent the depths based on L i instead of Q i . Figure 7 shows the first of the fifth cases considered in this the analytical description of the case study.
One-degree case: If L1 and WTM, then P1.  For all other scenarios, the methodology is analogous to that described above. Three-degree case: If L1 and MTW, then P3. From the five cases described, it can be seen that in the systems in which the pertinence values of the inputs are equal to 1, the calculation of the output reduces to the determination of the centroid of the area, which is delimited by the consequence of the rule, with the integration interval associated with the domain scope of the rule itself.
For the cases in which 0 < < 1, where 1 ≤ ≤ 5, the resulting integral is reduced to a sum of partial integrals arising from each rule that satisfies the conditions set forth by the expert. For the modulated system in this study, each output depends exclusively on two intercepted regions, as illustrated in Figure 9. In the analysis of this case study, it is considered that ∈ ( ), i.e., x is between L1 and L2. Thus, we have degrees of pertinence, 1 and 2 , associated with each depth that forms the intersection region, as shown in Figure 10.
Graphically, we have Figure 14.
Acta Scientiarum. Agronomy, v. 43, e51384, 2021 In detail, the area of integration is given by Figure 15. The manipulation of the data in MATLAB is shown in Figure 16. Similarly, the process is repeated for all the values of variable based on the irrigation depth and type of water to be used.

Results of a practical application
Based on a descriptive analysis of the data collected in the experiment, relevant significant differences were observed for different types of water and irrigation depths, as listed in Table 6. After the descriptive analysis, we proceeded to perform, automatically and manually, the fuzzy modeling of the output variable, "Green weight = Productivity", as shown in Figure 17 and Table 7.  At this point, it was possible to obtain the rule base of the system by associating the value of the highest degree of pertinence with the matched pair, as listed in Table 8. According to the data modeled, MATLAB software performed all the mathematical operations required to produce the output. Our goal in this study is to perform the same computations manually, i.e., by performing calculations by hand.
The importance of this approach is manifested in scenarios with computational problems or a lack of resources, as experienced by a researcher. In such cases involving various diverse areas of knowledge, efficient and simple problem modeling mechanisms are required. This approach provides simple theoretical subsidies for the development of mobile apps and free software.
For the evaluation of a specific case, lamina L1 and treatment with magnetized water were selected for consideration ( Figure 18). By rule R1, if L1 and AM, then P3, and a triangle is generated, as shown in Figure 19. In (II), we have: In this context, the value of productivity is determined by: Currently, the main tool for implementing fuzzy logic is MATLAB software. Developed by the American company MathWorks, which specializes in developing computational and mathematical solutions, MATLAB is used in conjunction with Simulink, another software to perform various types of work in mathematics and engineering.
This work explicitly analyzes the relevant inference mechanisms to demonstrate the excellence of the method used. We compare the fuzzy modeling results with those of experiments performed in the field according to the methodology and analytical results presented. Table 9 lists the values of the observed variables and those modeled by the fuzzy system. From the above data, the values of the fuzzy model and fresh weight in air observed in the experiment are strongly correlated with those for the irrigation treatments, with a CW value of 0.95 and an MTW value of 0.98, reflecting insignificant differences.

Conclusion
The focus of this study was to use a 0.0 (no-cost methodology that uses only elementary math) methodology to model a 4.0 cost system. In a world where time and technology are fundamental, exploring and explaining the theoretical foundations inherent to a method embedded in high-cost software can be an alternative to understanding complex models and reducing costs and power consumption.
In this article, we highlight only one application of fuzzy modeling in agrarian science, but the method can be applied over a wider range by various researchers. Moreover, in numerous remote locations, there is a shortage of electricity, highlighting the relevance of this work.
In agricultural terms, irrigation performed with magnetized water yields positive results by increasing the aerial green weight, thereby enabling the proposed method to be used to estimate production under other management conditions.
In this way, the present model helps to determine the best lettuce harvesting time depending on the type of irrigation water and irrigation depth, thus optimizing production.