Linear Program through (FminCon,Ga,Linprog)

3 views (last 30 days)
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

Accepted Answer

Alan Weiss
Alan Weiss on 1 Apr 2015
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
  7 Comments
Alan Weiss
Alan Weiss on 9 Apr 2015
Sorry, Anton, I still do not understand what you are trying to do, or why you are dissatisfied. In addition, I am surprised that you seem to continue trying to use ga, when it is almost certainly not an appropriate solver for your problem. If you have a smooth set of nonlinear constraints, fmincon is the solver of choice.
Check that your linear constraints are feasible by running linprog first. Once you get that to work, then you can try including nonlinear constraints using fmincon, and using the linprog solution as the initial point, as suggested here. In fact, that documentation link might help you solve your problem. Please check it out.
I am sorry if this does not help enough, but I really don't understand in what way you are dissatisfied.
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!