Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Optimization terminated: No feasible solution found.
Replies: 5   Last Post: Jan 19, 2014 11:18 AM

 Messages: [ Previous | Next ]
 John D'Errico Posts: 9,130 Registered: 12/7/04
Re: Optimization terminated: No feasible solution found.
Posted: Jan 19, 2014 11:18 AM

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <lbgpbi\$oj2\$1@newscl01ah.mathworks.com>...
> "wan " <yg880221@126.com> wrote in message <jcpet4\$6nu\$1@newscl01ah.mathworks.com>...
> > Friends,
> > I try to run a program by fmincon,but I got an error:Optimization terminated: No feasible solution found.Search direction less than 2*options.TolX but constraints are not satisfied.and I don't know what is my mistake...
> > "myfun.m"
> > function f=myfun(x)
> > f=2.20*x(1)*(x(1)-1)^2/(x(1)-2)+2.20*x(1)*x(2)*(x(2)-1)^2/(x(2)-2)+2.42*x(1)*x(2)*x(3)*(x(3)-1)^2/(x(3)-2)+2.75*x(1)*x(2)*x(3)*x(4)*(x(4)-1)^2/(x(4)-2);
> > and "mycon2.m"
> > function[c,ceq]=mycon2(x)
> > g(1)=1-(x(2)*(x(1)-2)/(x(2)-2))^1/3*(x(2)-1)/(x(1)-1);
> > g(2)=(x(2)*(x(1)-2)/(x(2)-2))^1/3*(x(2)-1)/(x(1)-1)-1.2;
> > g(3)=1-(1.1*x(3)*(x(2)-2)/(x(3)-2))^1/3*(x(3)-1)/(x(2)-1);
> > g(4)=(1.1*x(3)*(x(2)-2)/(x(3)-2))^1/3*(x(3)-1)/(x(2)-1)-1.2;
> > g(5)=1-(1.13636*x(4)*(x(3)-2)/(x(4)-2))^1/3*(x(4)-1)/(x(3)-1);
> > g(6)=(1.13636*x(4)*(x(3)-2)/(x(4)-2))^1/3*(x(4)-1)/(x(3)-1)-1.2;
> > c=[g(1);g(2);g(3);g(4);g(5);g(6)];
> > ceq=[1590.192-x(1)*x(2)*x(3)*x(4)];
> > command window:

> > >>x0=[7.2 7.2 7.5 4.09];
> > >>lb=[4;5;5;4];
> > >>ub=[8;8;8;5.6];
> > >>options=optimset('largescale','off','maxfunevals',1000000);
> > >>[x,fval]=fmincon(@myfun,x0,[],[],[],[],lb,ub,@mycon2,options)

> > when I try to run the script, I get these messages errors:
> > Optimization terminated: No feasible solution found.
> > Search direction less than 2*options.TolX but constraints are not satisfied.
> > x =
> >
> > 15.7056 10.0989 -2.7056 -3.7056
> >
> >
> > fval =
> >
> > -9.8284e+003
> > Any help is very much appreciated.Wish you a nice day!

>
> You seem desperate here, so I took a look.
>
> Over the domain of interest defined by the lower and upper
> bounds you have posed, there are TWO inequality constraints
> that can apparently NEVER be satisfied. That is, g(2) and g(4)
> are always positive over that 4-d hyper-rectangle.
>
> There are NO feasible solutions as you have posed it.
>
> Period.
>
> Wanting a solution to exist will not help. Trying harder will not
> suffice. Using a different optimizer will be a waste of time.
>
> The only thing you can do is reformulate your problem, perhaps
> by arbitrarily widening the range of acceptability. For example,
> were you to widen the bound constraints to
>
> lb = [3 3 3 4];
> ub = [10 10 10 5.6];
>
> this MIGHT be wide enough to allow a solution to exist. I've
> not looked more deeply to know if any feasible solution does
> exist in fact, since widening those ranges might result in a
> meaningless result.
>
> John

I had a few more minutes, so I modified the problem slightly.

That is, I completely dropped the objective function, replacing
it with a simple one, and I removed the bound constraints.
The idea is to see if we can find ANY feasible solution, and to
see how far out we need go to find one.

lb = [];
ub = [];
options=optimset('largescale','off','maxfunevals',1000000);
myfun = @(x) norm(x - x0);
[x,fval,exitflag] = fmincon(myfun,x0,[],[],[],[],lb,ub,@mycon2,options)

The result still yields a no feasible solution return, suggesting
that your system of constraints is fundamentally infeasible.
While this is not conclusive, I'd take it to heart, as it agrees
with what I did find before.

John

(Note that nothing I did here required anything sophisticated.
In fact, it is all something you could, and should, have done
yourself. Learn to investigate your problems, rather than just
throwing them at an optimizer and whining at the result.)

Date Subject Author
12/20/11 wan
12/20/11 Johan Lofberg
12/20/11 Marcelo Marazzi
1/19/14 s.cahyaningtias@gmail.com
1/19/14 John D'Errico
1/19/14 John D'Errico