After the objective function, all the constraints were implemented as shown below: