Python based simulation of digital and analog regulatory control