I am new with MIDCP.

I would like to use MIDCP to solve the following integer optimization problem.

Suppose the function f(x) is defined as

f(x)=cx-\sum_{n=0}^{cx-1}\left(cx-n\right)\frac{\lambda^{n}e^{-\lambda}}{n!},

where c is integer constant and \lambda is constant.

The optimization problem is:

x=\mathrm{argmax}_{x} f(x)

subject to x_{min}<x<x_{max} and x is integer

My main problem is in the upper limit of the sum since when I use for or while loop ending at cx-1, I got the following error message:

“Disciplined convex programming error:

Constraints may not appear in if/then statements.”

I do appreciate your help.

Thank you