Deng,
There is some additional information on using conditional statements in APM models here:
Below is the code for your problem that you described. The example below directs has a solution with m[1:3] = 0, m[4:7] = 1, and m[8:10] = 0. You’ll notice that I needed to declare m as an integer variable with the int prefix. In the past, I’ve
also found that it mostly returns an integer value even when m is not declared as an integer type.
Best regards,
John Hedengren
Dear Prof. John Hedengren,
Thanks so much for your work on APM. However, I meet a problem when building a MINLP problem now. I want get a solution for x1,x2..xN, which are all nonintegers, and m1,m2..mN are all integers. There exists a relationship between one pair of xi and
mi, while xi > 10e-5, m1 equals to 1, otherwise, m1 equals to 0. I am a fresher for APM, I do not know how to describe it in .apm file. Would you please give me some tips or demos for such kind of problem? Thanks a lot for time.
Best wishes,
Deng Jian.
Bachelor
School of Microelectronics
Shanghai Jiao Tong University
800 Dongchuan Rd, Shanghai 200240, China