Maybe you want to look at Modelica [1] for inspiration? It is an open modeling language standard with open source implementations. It should do what you want. maybe abit too declarative however (you can always use the algorithm block instead of the equation block though).