## Appendix A Hydrogenic System and Formulation of the Mass Balance Model  
The hydroponic system of the work in [28] comprises three vertical cultivation beds with grown tomatoes, a nutrient solution tank (mixing tank), a closed nutrient solution circulation system, and a lighting system. An electric pump drives a fraction of the nutrient solution from the mixing tank to the cultivation beds, and the drainage solution is conveyed back to the mixing tank. The mixing tank is eventually replenished with new nutrient solution in order to maintain a high EC, near 1.5 mS/cm. The nutrient solution in the mixing tank exhibits decrease of electrical conductivity (EC) and concentration of major ions during time periods with no addition of fresh nutrient solution, whereas there is an increase of EC during addition of nutrient solution [28].  
We consider the control of concentration of some major ion in the cultivation bed, by manipulation of the flow of fresh nutrient solution to the mixing tank \((Q_{ad})\), considering constant flows \(Q_{i}\) and \(Q_{e}\). To this end, the mass balance model is developed for the concentration of some general nutrient ion, but in the simulation example the \(NO_{3}-N\) ion is considered, because its behavior is quite similar to that of the electrical conductivity (EC). We consider the mixing tank, the cultivation beds with plants, the flow of addition of fresh nutrient solution to the mixing tank, and the flows of nutrient solution between the mixing tank and the cultivation beds. We assume that the system can be represented by two linked continuous stirred tank reactors (CSTR), see Figure 11:  
* The upper CSTR corresponds to the nutrient solution in the cultivation beds. The nutrient concentration is denoted as \(P_{e}\), the water volume is denoted as \(V_{u}\), the rate of nutrient removal is denoted as \(r_{x1}\), and the evapotranspiration rate is denoted as \(Q_{ET}\). Nutrient removal occurs via sorption and plant uptake. We assume that the water volume \(V_{u}\) is constant.
* The lower CSTR corresponds to the nutrient solution in the mixing tank. The nutrient concentration is denoted as \(P_{i}\) and the water volume is denoted as \(V_{l}\). The nutrient solution mixes with the incoming flow, which is in turn the flow leaving the upper CSTR. We assume that \(V_{l}\) is varying because of water evaporation losses and varying nature of flow \(Q_{ad}\).  
In addition, \(Q_{i}\) is the flowrate that leaves the lower CSTR and enters the upper CSTR, and \(Q_{e}\) is the flowrate that leaves the upper CSTR and enters the lower CSTR. The outflow \((Q_{e})\) is lower than the inflow \((Q_{i})\), due to evapotranspiration and constant nature of volume \(V_{u}\). We assume that flows \(Q_{i}\) and \(Q_{e}\) are constant. The development of the mass balance model gives as result the model (1) to (3).  
This model with the reaction rate expression  
\[r_{x1}=\mu_{mx}\frac{P_{e}}{K+P_{e}}+\mu_{o}\] (A1)  
was fitted to the experimental data of \(NO_{3}-N\) shown in [28], time interval 20-33 days, which corresponds to stage II (adaptation). This was performed by minimization of the squares of the errors between experimental and simulated values of \(NO_{3}-N\) (\(P_{i}\)) [29]. The obtained model parameters are \(a_{1}=3.55\,\mathrm{days}^{-1}\), \(a_{2}=3.485\,\mathrm{days}^{-1}\), \(a_{3}=3.254\,\mathrm{L}/\mathrm{day}\), \(a_{4}=0.1066\,\mathrm{L}/\mathrm{day}\), \(P_{ad}=110\,\mathrm{mg}/\mathrm{L}\), \(\mu_{mx}=1051.6\,\mathrm{mg}/(\mathrm{Ld})\), \(K=1509.8\,\mathrm{mg}/\mathrm{L}\), and \(\mu_{o}=6.903\,\mathrm{mg}/(\mathrm{Ld})\).