Generating balance equations