Both nitrogen and phosphorus penalties greatly reduced the nitrogen and phosphorus excretions, indicating that nitrogen and phosphorus penalty coefficients should be introduced together in the objective function in order to reduce both excretions efficiently.