This post contains an implementation of the IWA's Activated Sludge Model No. 1 (ASM1) in octave. Models are a widely-used tool in the design and operation of wastewater treatment systems. For my job, I use a commercial simulator, but I thought it would be a useful exercise to write an