MATLAB: Linear Program through (FminCon,Ga,Linprog)

fmincongalinprog

I have a simple linear problem including non-linear constraints. I have tried a lot of solvers including (fmincon,ga) algorithms. But I can not achieve desired results. If I exclude nonlinear constraints only linprog can solve it to optimality. But as far as I understand fmincon and ga also can handle simple linear problems. And my question is: How to correctly configure these solvers and algorithms to solve simple linear problem and after that include nonlinear constraints to achieve feasible result. I have read User Guides for Toolboxes but I still do not understand how these solvers works. Thank you

Best Answer

I have no idea what your problem is. There are a lot of examples that use nonlinear constraints, including nonlinear inequality constraints, nonlinear equality and inequality constraints, and a host of other examples.
If you have a linear objective function then your objective function definition is
fun = @(x)f'*x;
where f is a column vector of coefficients and x0 is a column vector of initial guesses. (For ga you need x0 to be a row vector and your objective can be x*f.)
Without more detail from you I can provide only generic help. For more detailed help, provide a more detailed question.
Alan Weiss
MATLAB mathematical toolbox documentation