Parameter calibration, data collection and simulation to control element were used to improve the accuracy of microscopic model. In order to overcome the shortage of macroscopic model, theoretical and empirical equation was adopted. The artificial neural network based on PSO method was introduced to improve simulation ability of water distribution system model from microscopic model and macroscopic model. There are two hidden layers with a maximum of 64 nodes per layer in the model. The Particle Swarm Optimization (PSO) algorithm is implemented to optimize the node numbers of the hidden layers in the model. The study indicates that the artificial neural network connecting with improved PSO method is an attractive alternative to the conventional regression analysis method in modeling water distribution systems.