Modeling, simulating and optimizing the anaerobic digestion of swine manure