I am receiving the following error: ??? Error using ==> barrier at 14 Objective function is undefined at initial point. Fmincon cannot continue. what could be the reason?

0 |

8/28/2010 6:16:04 PM

"joseph Frank" <josephfrank1969@hotmail.com> wrote in message <i5bjp4$emm$1@fred.mathworks.com>... > I am receiving the following error: > > ??? Error using ==> barrier at 14 > Objective function is undefined at initial point. Fmincon cannot continue. > > what could be the reason? Well....? Is it true?

0 |

8/28/2010 8:36:03 PM

Joseph, Your call to fmincon probably looks something like fmincon(obj,x0, ...) The error message indicates that your objective function "obj" either errors, or returns and invalid value such as Inf, NaN or a complex number when evaluated at the point x0. You may want to evaluate your function at x0 before calling fmincon to see if it's well defined: something like >> obj(x0) -Marcelo On 8/28/2010 2:16 PM, joseph Frank wrote: > I am receiving the following error: > > ??? Error using ==> barrier at 14 > Objective function is undefined at initial point. Fmincon cannot continue. > > what could be the reason?

0 |

8/30/2010 5:00:52 PM

I have revised all my codes and I am still receiving the same error: ??? Error using ==> barrier at 14 Objective function is undefined at initial point. Fmincon cannot continue. Error in ==> fmincon at 797 [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options_ip.HessFcn, ... Error in ==> Step4base at 6 x =fmincon(@(x)fGlobal(x,Data),StartingNSb,[],[],[],[],[],[],@(x)myconstr(x,EGAM),options); Although I checked the two functions fglobal and myconstr by running fglobal(StartingNSb,Data) which results 0.2438 + 0.0000i and by running mtconstr(StartingNSb,EGAM) which is returning [] without any error. Kindly advise.

0 |

9/8/2010 2:27:09 PM

"joseph Frank" <josephfrank1969@hotmail.com> wrote in message <i686ft$hm8$1@fred.mathworks.com>... > Error in ==> Step4base at 6 > x > =fmincon(@(x)fGlobal(x,Data),StartingNSb,[],[],[],[],[],[],@(x)myconstr(x,EGAM),options); > > Although I checked the two functions fglobal and myconstr by running fglobal(StartingNSb,Data) which results 0.2438 + 0.0000i and by running mtconstr(StartingNSb,EGAM) which is returning [] without any error. > Kindly advise. ============= Your function fglobal is returning a complex-valued result. The imaginary value is obviously small, but is not zero, even if it looks that way when displayed to 4 decimal places . If this imaginary part is purely due to round-off errors, use real() to strip it away.

0 |

9/8/2010 3:30:21 PM

"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <i68a6d$pq1$1@fred.mathworks.com>... > "joseph Frank" <josephfrank1969@hotmail.com> wrote in message <i686ft$hm8$1@fred.mathworks.com>... > > > Error in ==> Step4base at 6 > > x > > =fmincon(@(x)fGlobal(x,Data),StartingNSb,[],[],[],[],[],[],@(x)myconstr(x,EGAM),options); > > > > Although I checked the two functions fglobal and myconstr by running fglobal(StartingNSb,Data) which results 0.2438 + 0.0000i and by running mtconstr(StartingNSb,EGAM) which is returning [] without any error. > > Kindly advise. > ============= > > Your function fglobal is returning a complex-valued result. The imaginary value is obviously small, but is not zero, even if it looks that way when displayed to 4 decimal places . If this imaginary part is purely due to round-off errors, use real() to strip it away. Thanks Matt. It is working now.

0 |

9/8/2010 3:57:08 PM