Problem in @NLobjective

You cannot use > in a sum like this. To model this properly, you will need to add binary variables, transforming your problem into a mixed-integer nonlinear program (i.e., very hard to solve), and you won’t be able to use Ipopt. Are you sure you want to have a hard 0-1 jump?

A slightly relaxed approach could be to use a sigmoid centered at 1e-4.

p.s., You should read the first post of: Please read: make it easier to help you. In particular, it’s much easier to help if you post the text of your code, rather than a photo.