## 3 Modelling and Control
### Constant Flow Stage (CFS)  
Once AFS ends at the proposed outflow height \(h_{q}\), a constant flow initiates by controlling \(\theta\) proportionally so the reference value \(h_{q}\) remains constant. This sets a steady flow at \(x_{q}\). As tilting progresses, \(h_{q}\) will eventually drop down, even though \(\theta\) increases by the control action.  
CFS is proposed to pour the largest amount of liquid volume since constant outflow can be computed with less discrete error than in a variable outflow, like in the initial stage.  
A volume limit is set to pour so the largest amount of poured liquid remains in this constant flow stage rather than in AFS. To accomplish this, a window level \(h_{q}\) should be as short as possible, so as to just clear the SPH smoothing length tolerance described earlier, in Section 2.1.  
Now that \(h_{q}\) has been reached, CFS is a straightforward stage to process. Tilting the vessel 1 can be developed by controlling the angle \(\theta\) of vessel 1 as a proportional function of the linear decrease of \(h_{q}\) in time (\(\Delta h_{q}\)).  
\[\theta_{V}(t)=arctan\bigg{(}\frac{2}{B}(h_{q}(t)+h_{e})\bigg{)}. \tag{16}\]  
One can go directly on with Equation (16): the trigonometric relation of the angle and the vessel 1 dimensions. However, this will give an angular step not a linear step in different center of rotation, so, instead, as Figure 9 illustrates, first measure a \(\Delta h_{q}\) at certain timestep of \(t_{3}\); then, assume this height as the magnitude of a vertical vector (vector \(\mathbf{b}\)) with coordinates on the tip of pouring of vessel 1. Then, calculate vector \(\mathbf{c}\) from the difference of vector \(\mathbf{a}\) and vector \(\mathbf{b}\). Vector \(\mathbf{a}\) is the vector going from the center of rotation to the tip of pouring in vessel 1.  
Finally, the angle \(\theta^{\prime}\) between the vectors \(\mathbf{a}\) and \(\mathbf{c}\) is calculated, and vessel 1 tilts at that angle in constant angular steps.  
In simulations, a pouring for full liquid volume was developed. Therefore, \(h_{q}\) will drop down as the liquid volume ceases. As will be mentioned in next section, the free fall curvature has no flaws over the course of the CFS ending. It has been tried different functions in order to handle the angle of pouring not only as a function of \(h_{q}\) but also as a function of time with relative success. That is why [3] justifies the free fall motion of fluids as a measuring device for flow. Partial pouring would be an interesting simulation job that could be tried out in further work.  
After AFS and CFS motions in vessel 1 approximate to the prospective free fall curvature, the catching motion of vessel 2 is summarized to the \(x\)-travel of the curvature motion. No special treatment to the catching task is required, but only to avoid large motion steps during filling to prevent spilling due to sloshing. In our simulations, the motion's update of solids takes place with each update of the particle's position (see Figure 2); therefore, there is a smoothed motion of vessel 2 along x axis.  
Figure 9: Vertical step of tilting in constant flow stage.