f

problem with a minimazition problem.

```Hello, I have a problem with a minimazition problem:

Let my aim is to find x and a where f(x,a) is minimized with the constraint g(x,a)=0. Here "a" is parameter.

It is known that for some values of x and a, function g does not have real roots of x.

In matlab, I use fmincon function to solve this minimazition problem with "interior-point" algorithm.

However, even in situations where g doesnt have real x roots
, somehow Fmincon finds solution. I want to determine which solutions have real roots  which are not. How can I do that? To which criterian do I have to look.

I dont have optimization theory background. So if you help me, I will be very very glad. Thanks a lot.
```
 0
oercim (67)
8/23/2012 10:19:04 AM
comp.soft-sys.matlab 211266 articles. 25 followers. lunamoonmoon (257) is leader.

5 Replies
1307 Views

Similar Articles

[PageSpeed] 2

```hagii <oercim@yahoo.com> wrote in message <c541e3ed-7416-4873-982b-23e93c4612fc@googlegroups.com>...
>
> However, even in situations where g doesnt have real x roots
> , somehow Fmincon finds solution

I don't believe it. That means, either
1) the setup of fmincon is not right,
2) you didn't not check carefully at the output flag of fmincon

Bruno
```
 0
b.luong5955 (6401)
8/23/2012 10:29:07 AM
```On Thursday, August 23, 2012 1:29:07 PM UTC+3, Bruno Luong wrote:
> hagii <oercim@yahoo.com> wrote in message <c541e3ed-7416-4873-982b-23e93c=
>=20
> >=20
>=20
> > However, even in situations where g doesnt have real x roots
>=20
> > , somehow Fmincon finds solution
>=20
>=20
>=20
> I don't believe it. That means, either
>=20
> 1) the setup of fmincon is not right,
>=20
> 2) you didn't not check carefully at the output flag of fmincon
>=20
>=20
>=20
> Bruno

The same thing is valid for "fsolve" function. Fsolve finds solution(in out=
put flag of fsolve gives warning, but I didnt see any warning for fmincon).=
But when I look at to fval, I can understand the situation. If fval is not=
close to zero, that means the solutions are not valid. However, for fminco=
m, I dont know what to do.=20

```
 0
oercim (67)
8/23/2012 10:39:26 AM
```
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message
news:k150lj\$run\$1@newscl01ah.mathworks.com...
> hagii <oercim@yahoo.com> wrote in message
>>
>> However, even in situations where g doesnt have real x roots
>> , somehow Fmincon finds solution
>
> I don't believe it. That means, either
> 1) the setup of fmincon is not right,
> 2) you didn't not check carefully at the output flag of fmincon

or perhaps 3) the value of the nonlinear equality constraint g evaluated at
the solution returned by FMINCON is smaller than the termination tolerance
on the constraints, TolCon.

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com

```
 0
slord (13689)
8/23/2012 1:14:18 PM
```> or perhaps 3) the value of the nonlinear equality constraint g evaluated at
>
> the solution returned by FMINCON is smaller than the termination tolerance
>
> on the constraints, TolCon.
>
How can I see the value of the nonlinear equality constraint at the solution? Do I have to calculate it by substituting the solution values to g? Or is there an easier way? Thanks a lot.

```
 0
oercim (67)
8/23/2012 2:09:34 PM
```On 23 Aug., 16:09, hagii <oer...@yahoo.com> wrote:
> > or perhaps 3) the value of the nonlinear equality constraint g evaluated at
>
> > the solution returned by FMINCON is smaller than the termination tolerance
>
> > on the constraints, TolCon.
>
> How can I see the value of the nonlinear equality constraint at the solution? Do I have to calculate it by substituting the solution values to g? Or is there an easier way? Thanks a lot.

Call the function in which you defined your constraint after fmincon
has finished.

Best wishes
Torsten.
```
 0
8/24/2012 6:27:13 AM