Hi friends, I have a problem with optimization algorithm like GA, fmincon and patternsearch. When I try to add constrain to my problem error below appear:
Error using ConstrainToo many output arguments.Error in poptimfcnchk (line 58) [cineq,ceq] = feval(nonlcon,reshapeinput(Xin,X),conFcnArg{:});Error in patternsearch (line 343)[Iterate,OUTPUT.funccount] = poptimfcnchk(FUN,nonlcon,initialX,Iterate, ...Error in Main (line 30)[x,Fval,exitFlag,output]=patternsearch(@(x)Objective(x),X0,[],[],[],[],LB,UB,@Constrain,options)Caused by: Failure in initial user-supplied nonlinear constraint function evaluation. PATTERNSEARCH cannot continue.
However, when I omit the constrain from optimization it works very well. After adding adding constrain to my problem this error occur. Could anyone help???
Thanks.
Best Answer