## 2 System Modeling
### Co-Simulation Platform Based on LabVIEW and AMESim
#### 2.3.1 Simulation Model Based on AMESim  
The AMESim model in the co-simulation platform consists of two parts, as shown in Figure 5. The first part is the AMESim simulation model of MCCS, which can simulate different working conditions of multi-channel concentrated water supply. The second part is the interface module,LabVIEWCosim, of the co-simulation, which provides AMEDoAstep2.VI, AMEEInitModel.VI and AMETerminate.VI, and realizes the LabVIEW and AEMSim signal transmission. In the simulation model, the pressure signal of the channel and the pressure signal of the main pipe are selected as the output of the simulation system and fed back to the controller. At the same time, the algorithm in the controller calculates the control value of the regulating ball valve and acts on the simulation system through the simulation interface. A sketch of the MCCS simulation model is shown in Part A of Figure 5. It includes the MCCS structure, pump, valve, sensors, etc., and is slightly simplified compared to the real one. The Hydraulic and Hydraulic Resistance libraries are used to model the MCCS system. Taking into account the flow characteristic curve of the ball valve, the SIGUDA01 of the signal library is used to realize the relationship between the valve opening and the flow in modeling. Besides this, the parameters of the main components have been obtained from the experimental results and technical data sheets of the manufacturer. When building the model, it is necessary to ensure the mathematical transfer relationship between the component sub-models, and realize the output and input relationship of the front and back sub-models on the same pipeline [24]. The sub-models and parameters of the main components of the MCCS are shown in Table 2. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Component** & **Parameter** & **Value** & **Component** & **Parameter** & **Value** \\ \hline Centrifugal & Pump diameter & 160 mm & Tee friction coefficient & Trunk & 0.4 \\ pump & Reference speed & 2840 r/min & (diversion) & Trunk-channel & 1.44 \\ Efficiency & 0.95 & Tee friction coefficient & Trunk & 0.4 \\ Flow rate pressure & \multirow{2}{*}{500 L/min/bar} & \multirow{2}{*}{(confluence)} & \multirow{2}{*}{Trunk-channel} & \multirow{2}{*}{1.21} \\ Check valve & & Gradient & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Sub-models and parameters of main components. Figure 5: Sketch of the AMESim simulation model: Part A is the AMESim simulation model of MCCS; Part B is interface module of the co-simulation platform. The verification of the MCCS simulation model includes two aspects: constant flow performance verification and unsteady flow performance verification. Constant flow performance refers to the pressure and flow of the main pipe when the system is stable. That is, the pressure and flow of the main pipe are recorded by turning on different numbers of centrifugal pumps and using different main pipe loads (the opening of the valve at the end of the main pipe simulates the pipe load). Unsteady flow performance verification refers to the characteristics of the main pipe pressure changing with time when the system status changes. For example, in the parallel operation of three channels and the standby of one channel, different switching signals are given to the channel control valve so that the standby channel can be switched with one of the parallel channels to obtain the time-varying characteristics of the pressure of the main pipe during the switching process, including synchronous switching, delayed switching and advanced switching. In the parallel operation of three channels, a control signal of 0-100% opening is given to the main regulating ball valve to obtain the time-varying characteristics of the pressure in the main pipe. The simulation model is set with the same parameters, and the results obtained are compared with the experimental results. The performance verification of constant flow and unsteady flow is shown in Figures 6 and 7, respectively.