Must Number of equality constraints and decision variables in an optimization problem be equal ?
If not, how can I solve the equality constraint equations with a solver e.g. fsolve,lsqnonlin, by considering the limits of decision variables in order to get a better initial point and also check the feasibility of the problem at the first place?
I am solving an optimization problem using fmincon with many constraints and decision variables but I am getting an infeasible exit-flag. So, I've tried to solve all equality constraints as a nonlinear system with fsolve to get a better initial point and also check the feasibility of the problem. Since fsolve cannot consider lower and upper limits of the variables, it returns a solution which hits the limits of decision variables. Then I have tried to solve it with lsqnonlin function as it is able to take upper and lower limits of variables into account. But lsqnonlin cannot be run and gives an error like that,
The Levenberg-Marquardt algorithm does not handle bound
constraints and the trust-region-reflective algorithm
requires at least as many equations as variables;
aborting.
I guess it means, the number of variables and equations (equality constraints) are not equal.
Also, as an other attempt I've performed fmincon with constant zero objective function considering the varibles limits. By active-set option I am getting my original initial point. Also by interior-point option I am getting a totally different solution which is in the bounds.
opts = optimoptions(@fmincon,'Algorithm','interior-point','Display','off');
x = fmincon(@(x)0,Dat.InitialGuess,[],[],[],[],lb,ub,@(X) fminconstr(X,Dat,D),opts)
Thanks for your reply.