Optimal operating conditions for maximum biogas production in anaerobic bioreactors