Please see the following link for additional information on MINLP including a MATLAB and Python interface to the Mixed Integer Nonlinear Programming solver, APOPT.
Amirhosein, there is an integer tolerance (possibly 1e-3). As long as the value is within that tolerance of an integer value, it is declared as an integer and accepted as a potential solution. Could you send me a copy of your files at firstname.lastname@example.org if this isn't the issue?
I have 2 question.
1. I tried to use my own function with 15 binary variables. In the results, the last one has a real value between 0 to 1. Why?
2. It can find the optimum solution of my function by only 1 iteration. How is it possible? that is because I have no non-integer variable?
One last question, Where exactly I should put csv_load() command in minlp.m file that you provide in your submission? I think this is why I can't retrieve the data from csv file.
I am using minlp.m file that you submitted in this page.
Thanks for your help
Below is a simple model file that demonstrates how to load in external parameters into APMonitor. You can replace the File *.csv section with loading a CSV file of your choice through MATLAB with the csv_load() function. For testing, just copy the lines below and insert into the web-interface at: http://apmonitor.com/online/view_pass.php
m = 4
c[1:m] = 1.2
intv ! integer variables start with "int"
! summation of all elements
s = 0
s[1:m] = s[0:m-1] + c[1:m]
! v to be equal to the nearest integer for summation
minimize (s[m] - intv)^2