Hot to add constraints to non decision variables in fmicon?

8 views (last 30 days)
Hi I am using Fmincon to solve steady state optimization problem where I need to add constraints to non-decision variables how can I do this in fmincon.
regards Jayaram

Accepted Answer

Alan Weiss
Alan Weiss on 31 Jul 2014
You can write any constraints you like as nonlinear constraints.
Alan Weiss
MATLAB mathematical toolbox documentation
  4 Comments
Walter Roberson
Walter Roberson on 7 Jan 2017
Gregory:
The link Alan included leads to http://www.mathworks.com/help/optim/ug/nonlinear-constraints.html which shows using arbitrary input values as part of the constraint calculation.
For fmincon and the other optimizers that support nonlinear constraints, the values that are passed in as the first argument to the nonlinear constraint function are all of the variables being optimized over, not just the decision variables.
fmincon itself does not even know what a decision variable is -- fmincon does not have integer constraints other than through the rather clumsy mechanism of having the nonlinear constraint function check mod(x,1)
AM
AM on 4 Sep 2020
Hello, I know it's 3 years later but I have the same problem and do not know how to solve it, I do not know how to tell fmincon that the constrained variables are non decision variables.
If I define my constraints in a function called mycon and use the following syntax fmincon assumes the inputs of mycon are the decision variables.
nonlcon=@mycon
fmincon(@fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)
Thank you in advance

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!