Modeling And Optimization Of Transients In Water Distribution Networks With Intermittent Supply