Quantcast
Channel: MATLAB Central Newsreader - tag:"optimization"
Viewing all articles
Browse latest Browse all 130

Re: fmincon, help please

$
0
0
"Ganesh Ramkumar" wrote in message <ms7kv3$9s4$1@newscl01ah.mathworks.com>...
> Hi,
>
> I am trying to calculate the minimum of a function with multiple variables, the only constraints I have are the upper and lower bounds of the variables. The problem I am having is that fmincon does not change the input value from the initial guess value I give it.
>
> This is the output I get:
>
> initGuess =
>
> 0.6159
>
>
> x =
>
> 0.6159
>
>
> x =
>
> 0.6159
>
>
> Initial point is a local minimum that satisfies the constraints.
>
> Optimization completed because at the initial point, the objective function is non-decreasing
> in feasible directions to within the selected value of the function tolerance, and
> constraints are satisfied to within the selected value of the constraint tolerance.
>
> <stopping criteria details>
>
> This is my call to fmincon:
> A = [];
> b = [];
> Aeq = [];
> beq = [];
> lb = 0;
> ub = 1;
> initGuess = 0.6159;
> options = optimset('TolX',1e-12,'TolCon',1e-12,'TolFun',1e-12,'Algorithm','interior-point');
> [optAM,optBC] = fmincon(@(x) cmpBC(x,epochDate,epochDate2,root,rvfm),[initGuess],A,b,Aeq,beq,lb,ub,nonlcon,options);
>
> I tried multiple initial guesses and the same thing happens, please help not sure how fix this.

The parameters used to call it, as well as your
initial guess are essentially irrelevant, because we
have absolutely NO idea what your function does
or how it is written.

The crystal ball is so foggy some days.

However, a likely reason for why this might happen
is that your function is piecewise constant. Effectively,
I'd bet that somewhere inside the function, you
essentially round something to integer form, or do
something equivalently bad. Of course this must cause
fmincon to fail, since that code presumes a differentiable
objective. That requirement fails if you have done as
I expect.

Oh, one other thing. Why, for a one variable problem,
are you bothering to use fmincon, when fminbnd is far
easier to use? It too will have some issues with a
function as I conjecture you have.

John

Viewing all articles
Browse latest Browse all 130

Trending Articles