I have a complicated non-linear objective function of positive integer variables subject to linear constraints:
$\mathop {Min}\limits_{\underline x} f(\underline x)$
s.t.
$A\underline x\leq \underline b$
$\underline x \in \mathbb{Z}$, $\underline x \geq 0$. $f(\underline x)=g(\underline x)+h(\underline x)+p(\underline x)+q(\underline x)$.
For the small version of the problem where A is 17×48, $g$ is defined as follows.
\begin{equation}\label{Ca1} C_a^1=\frac{1}{\frac{1}{\sum_{i=1}^{4} x_{i}C_i+(3-\sum_{i=1}^{4} x_{i})C_5}+\frac{1}{\sum_{i=5}^{8} x_{i}C_i+(3-\sum_{i=5}^{8} x_{i})C_5}} \end{equation}
\begin{equation}\label{Ca2} C_a^2=\frac{1}{\frac{1}{\sum_{i=9}^{12} x_{i}C_i+(3-\sum_{i=9}^{12} x_{i})C_5}+\frac{1}{\sum_{i=13}^{16} x_{i}C_i+(3-\sum_{i=13}^{16} x_{i})C_5}} \end{equation}
\begin{equation}\label{Cb1} C_b^1=\frac{1}{\frac{1}{\sum_{i=17}^{20} x_{i}C_i+(3-\sum_{i=17}^{20} x_{i})C_5}+\frac{1}{\sum_{i=21}^{24} x_{i}C_i+(3-\sum_{i=21}^{24} x_{i})C_5}} \end{equation}
\begin{equation}\label{Cb2} C_b^2=\frac{1}{\frac{1}{\sum_{i=25}^{28} x_{i}C_i+(3-\sum_{i=25}^{28} x_{i})C_5}+\frac{1}{\sum_{i=29}^{32} x_{i}C_i+(3-\sum_{i=29}^{32} x_{i})C_5}} \end{equation}
\begin{equation}\label{Cc1} C_c^1=\frac{1}{\frac{1}{\sum_{i=33}^{36} x_{i}C_i+(3-\sum_{i=33}^{36} x_{i})C_5}+\frac{1}{\sum_{i=37}^{40} x_{i}C_i+(3-\sum_{i=37}^{40} x_{i})C_5}} \end{equation}
\begin{equation}\label{Cc2} C_c^2=\frac{1}{\frac{1}{\sum_{i=41}^{44} x_{i}C_i+(3-\sum_{i=41}^{44} x_{i})C_5}+\frac{1}{\sum_{i=45}^{48} x_{i}C_i+(3-\sum_{i=45}^{48} x_{i})C_5}} \end{equation}
\begin{equation}\label{Ca} C_a=C_a^1+C_a^2 \end{equation} \begin{equation}\label{Cb} C_b=C_b^1+C_b^2 \end{equation} \begin{equation}\label{Cc} C_c=C_c^1+C_c^2 \end{equation} \begin{equation}\label{g} g(\underline{x})=(C_a+C_b+C_c)\sqrt{[C_a-\frac{1}{2}(C_b+C_c)]^2+(C_b-Cc)^2} \end{equation}
where $C_1$...$C_{48}$ are constant and known. $h$, $p$ and $q$ are as complicated.
In Matlab,each of $g,h,p,q$ is defined by a function which employs various other functions which contain many loops for different elements of $\underline x$.
Size of $A$ is in the order of 100 $\times$ 2000. I tried first to solve the problem in Matlab, using the ga function. Unfortunately, the solutions obtained for several runs never satisfied the constraints.
I have successfully implemented an algorithm in Matlab where in each iteration a random solution that satisfies the constraints is generated and $f(\underline x)$ is evaluated using multiple functions defined. Using a large number of iterations, say 1e6, I could find a reasonable yet not a globally optimal solution. My next plan was to use the CPLEX solution pool. For small $A$ and $b$, it was possible to have all the solutions of inequality $A\underline x\leq \underline b$, import these solutions as a CSV file in Matlab and evaluate them one by one so that the least objective function gives the globally optimal solution. This, however, does not work for actual $A$ and $b$ which make the CPLEX out of memory. My idea was to use an incumbent filter so that non-optimal solutions of $A\underline x\leq \underline b$ get discarded and therefore the memory problem gets resolved. For example the solutions for which $f(\underline x)>c$, where constant $c$ is heuristically defined, can be discarded. My question is:Is there a way to define my complicated objective function in GAMS environment the way I did in Matlab? Have you faced a similar situation which can be referred to so that I have a clue?