Abstract. In many urban areas of the developing world, piped water is supplied only intermittently, as valves direct water to different parts of the water distribution system at different times. The flow is transient, and may transition between free-surface and pressurized, resulting in complex dynamical features with important consequences for water suppliers and users. Here, we develop a computational model of transition, transient pipe flow in a network, accounting for a wide variety of realistic boundary conditions. We validate the model against several published data sets, and demonstrate its use on a real pipe network. The model is extended to consider several optimization problems motivated by realistic scenarios. We demonstrate how to infer water flow in a small pipe network from a single pressure sensor, and show how to control water inflow to minimize damaging pressure transients.1. Introduction. From the dry taps of Mumbai to the dusty reservoirs of São Paolo, urban water scarcity is a common condition of the present, and a likely feature of the future. Hundreds of millions of people worldwide are connected to water distribution systems subject to intermittency. This intermittent water supply may take many forms, from unexpected disruptions to planned supply cycles where pipes are filled and emptied regularly to shift water between different parts of the network at different times [17,33]. In Mumbai, for example, Vaivaramoorthy [33] reports that on average, residents have water flowing from their taps less than 8 out of 24 hours. Intermittent supply is often inequitable, with low-income neighborhoods experiencing lower water pressure and shorter supply durations than high-income ones [31]. Intermittent supply not only limits water availability, but also compromises water quality and damages infrastructure. With field data from urban India, Kumpel and Nelson [18] quantified the deleterious effect of intermittency on water quality, showing that both the initial flushing of water through empty pipes-as well as periods of low pressure-corresponded with periods of increased turbidity and bacterial contamination. Christodoulou [7] observed when that a drought in Cypress ushered in two years of intermittent supply, pipe ruptures increased by 30%-70% per year.Whereas intermittent water supply creates challenges for water managers and water users, the phenomenon creates opportunities for applied mathematics. It is an interesting and difficult mathematical problem to efficiently model transient pipe flow in networks-including transitions to and from pressurized states-with uncertain or complex boundary conditions. In this work we introduce a framework to not only describe intermittent water supply, but also use optimization to improve either our description of the system, or the operation of the described system in order to reduce risks such as infrastructure damage.Intermittent supply falls in somewhat of a modeling gap. Water distribution software abounds, including the free and open source software EPANET ...