## 2 Materials and Methods
### Fuzzy Logic Model (FLM)
#### 2.3.3 Rules  
The rules of the FLM are derived from the Mamdani algorithm, adhering to an IF-THEN structure. These rules serve as a meaningful representation of the universe of knowledge [29]. An example of a defined rule is  
IF **pH** IS _neutral_ AND **temperature** IS _optimal_ AND **humidity** IS _optimal_ AND **EC** IS _low_, THEN the **PQ** IS _high_. \begin{table}
\begin{tabular}{c c c c c c c} \hline \multirow{2}{*}{**Output Name**} & **Universe of Disclosure** & **Linguistic Term** & **MF Type** & \multicolumn{3}{c}{**MF Parameters**} \\  & & Low & Triangular & 0 & 0 & 1.5 \\  & & Medium-low & Triangular & 1 & 2.5 & 4 \\ Soil Quality & 0–10 & Medium & Triangular & 3.5 & 5 & 6.5 \\  & & Medium-high & Triangular & 6 & 7.5 & 9 \\  & & High & Triangular & 8.5 & 10 & 10 \\ \hline \multirow{4}{*}{\
\begin{tabular}{c} Macronutrient \\ Concentration \\ \end{tabular} } & \multirow{4}{*}{0–10} & Low & Triangular & 0 & 0 & 2 \\  & Medium-low & Triangular & 1 & 3.5 & 6 \\  & Medium-high & Triangular & 4 & 6.5 & 9 \\  & & High & Triangular & 8 & 10 & 10 \\ \hline \multirow{4}{*}{
\begin{tabular}{c} Physicochemical \\ Quality \\ \end{tabular} } & \multirow{4}{*}{0–10} & Low & Triangular & 0 & 0 & 1.5 \\  & Medium-low & Triangular & 1 & 2.5 & 4 \\  & Medium & Triangular & 3.5 & 5 & 6.5 \\  & Medium-high & Triangular & 6 & 7.5 & 9 \\  & High & Triangular & 8.5 & 10 & 10 \\ \hline \end{tabular}
\end{table} 
Table 2: Fuzzy Model Outputs. Figure 9: Visual representation of each linguistic term of (**a**) soil quality MFs; (**b**) macronutrient concentration MFs. Although theoretically feasible, defining a total of 5103 rules to cover all possible input combinations is impractical due to the significant time and effort required, as well as the potential for human error. Manual rule definition using graphical user interfaces like MATLAB's fuzzy logic toolbox or coding in Python would not be a viable solution. As a result, an alternative approach was adopted, employing a binary simplification technique where parameters are categorized as either good or bad. This simplification resulted in a substantial reduction in the number of rules, bringing it down to just 128. To implement this binary simplification, the MFs of the input parameters were mapped to the good or bad classifications. For instance, in the case of nitrogen concentration, a low concentration was classified as bad, while medium and high concentrations were classified as good. To organize and simplify the rule structure, the rules were categorized based on the desired outputs they aimed to determine. For instance, the determination of PQ focused on the inputs of pH, temperature, humidity, and electric conductivity. MC, on the other hand, relied on the inputs of nitrogen, phosphorus, and potassium. Lastly, the calculation of the SQ output considered the feedback obtained from the other two calculated outputs. Through the process of categorization and binary simplification, the total number of rules in the system was significantly reduced. For PQ and MC, the binary simplification technique led to a reduction in the number of rules. However, for SQ, the same MFs as PQ and MC are considered as inputs. As a result, there are now 16 rules for determining PQ, 8 rules for MC, and 20 rules for SQ, totaling 44 rules that govern the fuzzy inference process. It is noteworthy that the FLM consists of three sub-fuzzy models, as depicted in Figure 1. The first two sub-models calculate the PQ and MC based on the input variables. These intermediate results are then fed into the third sub-model, which determines the overall SQ. Despite its modular structure, it is important to understand that the FLM as a whole is treated as a single model. The outputs of the intermediate sub-models serve as inputs for the final sub-model, allowing for a comprehensive evaluation of the SQ. This integrated approach ensures that the relationships between the different components of SQ are properly considered and accounted for in the overall assessment. Table 3 provides an extract of these rules.