jeudi 12 septembre 2019

Including if statement in an optimisation problem

I have a problem that I need to use optimisation to get the results. I am using spyder and slsqp. I am trying to define the objective and the constraints but there is a variable that varies depending on other variables. How should I use an if statement to make it change its value and where should I put it(the objective or constraints)?

Here is the original question if that gives any clarity : https://math.stackexchange.com/questions/3331958/coloring-a-nn-square-grid-in-a-specific-way/3332090?noredirect=1#comment6873164_3336334

Aucun commentaire:

Enregistrer un commentaire