Thread Subject: question about constrained optimization

Subject: question about constrained optimization

From: luca.pamparana@gmail.com

Date: 4 Jan, 2008 11:06:44

Message: 1 of 6

Hello everyone,

Happy 2008 to all of you!

I have a question about constrained optimization.

Say, my objective function is as follows:

f=x(1)^4-x(2)^2+x(3)^2-2*x(4)+x(2);

Now, I have the following constraints:

f = 0 when x(1) <= x(2)

and the above equation only holds when x(1) > x(2).

I guess the second constraint can be specified as an inequality
constraint. So:
ceq = x(1) - x(2); Is this correct?

Can someone tell me how I can specify the first constraint... saying
the function evaluates to 0 when x(1) <= x(2)?

Cheers,
Luca

Subject: question about constrained optimization

From: Bruno Luong

Date: 4 Jan, 2008 12:49:25

Message: 2 of 6

luca.pamparana@gmail.com wrote in message
<d9f7479a-1137-4347-ba29-a27bad6d1eb9@l32g2000hse.googlegroups.com>...
> Hello everyone,
>
> Happy 2008 to all of you!
>
> I have a question about constrained optimization.
>
> Say, my objective function is as follows:
>
> f=x(1)^4-x(2)^2+x(3)^2-2*x(4)+x(2);
>
> Now, I have the following constraints:
>
> f = 0 when x(1) <= x(2)
>

To me, this does NOT describe a constraint in the sense
people know. You simply have a discontinuous function that
is defined differently in two sets of R^4.

Bruno

Subject: question about constrained optimization

From: luca.pamparana@gmail.com

Date: 4 Jan, 2008 14:33:00

Message: 3 of 6

On Jan 4, 12:49 pm, "Bruno Luong" <b.lu...@fogale.fr> wrote:
> luca.pampar...@gmail.com wrote in message
>
> <d9f7479a-1137-4347-ba29-a27bad6d1...@l32g2000hse.googlegroups.com>...
>
> > Hello everyone,
>
> > Happy 2008 to all of you!
>
> > I have a question about constrained optimization.
>
> > Say, my objective function is as follows:
>
> > f=x(1)^4-x(2)^2+x(3)^2-2*x(4)+x(2);
>
> > Now, I have the following constraints:
>
> > f = 0 when x(1) <= x(2)
>
> To me, this does NOT describe a constraint in the sense
> people know. You simply have a discontinuous function that
> is defined differently in two sets of R^4.
>
> Bruno

Hello Bruno,

Thanks for the reply. You are obviously correct. I guess I only need
that one inequality constraint.

So, the constraint that x(1) > x(2) can be coded as:
ceq = x(1) - x(2); Is this correct?

Cheers,
Luca

Subject: question about constrained optimization

From: John D'Errico

Date: 4 Jan, 2008 15:04:08

Message: 4 of 6

luca.pamparana@gmail.com wrote in message <dcc7b5d9-3074-42e3-
98a6-1cb7a7e957f3@d21g2000prf.googlegroups.com>...
> On Jan 4, 12:49 pm, "Bruno Luong" <b.lu...@fogale.fr> wrote:
> > luca.pampar...@gmail.com wrote in message
> >
> > <d9f7479a-1137-4347-ba29-
a27bad6d1...@l32g2000hse.googlegroups.com>...
> >
> > > Hello everyone,
> >
> > > Happy 2008 to all of you!
> >
> > > I have a question about constrained optimization.
> >
> > > Say, my objective function is as follows:
> >
> > > f=x(1)^4-x(2)^2+x(3)^2-2*x(4)+x(2);
> >
> > > Now, I have the following constraints:
> >
> > > f = 0 when x(1) <= x(2)
> >
> > To me, this does NOT describe a constraint in the sense
> > people know. You simply have a discontinuous function that
> > is defined differently in two sets of R^4.
> >
> > Bruno
>
> Hello Bruno,
>
> Thanks for the reply. You are obviously correct. I guess I only need
> that one inequality constraint.
>
> So, the constraint that x(1) > x(2) can be coded as:
> ceq = x(1) - x(2); Is this correct?

Asuming that your comments imply the use
of fmincon, this is a LINEAR constraint. Why
not use the ability of fmincon to apply a linear
inequality constraint directly? Look at the A
and B arguments to fmincon. (The third and
4th args.)

If your function is truly discontinuous, an
optimizer like fmincon is not the correct tool
anyway, unless you do intend to constrain it
from looking in that part of the domain.

John

Subject: question about constrained optimization

From: Charles Cuell

Date: 4 Jan, 2008 18:45:15

Message: 5 of 6

luca.pamparana@gmail.com wrote in message <dcc7b5d9-3074-
42e3-98a6-1cb7a7e957f3@d21g2000prf.googlegroups.com>...
> On Jan 4, 12:49 pm, "Bruno Luong" <b.lu...@fogale.fr>
wrote:
> > luca.pampar...@gmail.com wrote in message
> >
> > <d9f7479a-1137-4347-ba29-
a27bad6d1...@l32g2000hse.googlegroups.com>...
> >
> > > Hello everyone,
> >
> > > Happy 2008 to all of you!
> >
> > > I have a question about constrained optimization.
> >
> > > Say, my objective function is as follows:
> >
> > > f=x(1)^4-x(2)^2+x(3)^2-2*x(4)+x(2);
> >
> > > Now, I have the following constraints:
> >
> > > f = 0 when x(1) <= x(2)
> >
> > To me, this does NOT describe a constraint in the sense
> > people know. You simply have a discontinuous function
that
> > is defined differently in two sets of R^4.
> >
> > Bruno
>
> Hello Bruno,
>
> Thanks for the reply. You are obviously correct. I guess
I only need
> that one inequality constraint.
>
> So, the constraint that x(1) > x(2) can be coded as:
> ceq = x(1) - x(2); Is this correct?
>
> Cheers,
> Luca
>

Luca,

I'm looking at this, and am still a little confused as to
what you need. Are trying to find a minimum (or maximum)
of the f that you've given, subject to a constraint? Or
are you trying to solve f = 0 subject to a constraint?

Also, is this the actual function you're interested in, or
is it an example to illustrate your problem? I ask,
because if your intention is to find a max or min of the
given f, it's extremely simply to do so by hand, without
having to use Matlab.

Charles.

Subject: question about constrained optimization

From: luca.pamparana@gmail.com

Date: 5 Jan, 2008 00:43:00

Message: 6 of 6

On Jan 4, 6:45 pm, "Charles Cuell" <cu...@math.usask.ca> wrote:
> luca.pampar...@gmail.com wrote in message <dcc7b5d9-3074-
>
> 42e3-98a6-1cb7a7e95...@d21g2000prf.googlegroups.com>...> On Jan 4, 12:49 pm, "Bruno Luong" <b.lu...@fogale.fr>
> wrote:
> > > luca.pampar...@gmail.com wrote in message
>
> > > <d9f7479a-1137-4347-ba29-
>
> a27bad6d1...@l32g2000hse.googlegroups.com>...
>
>
>
>
>
> > > > Hello everyone,
>
> > > > Happy 2008 to all of you!
>
> > > > I have a question about constrained optimization.
>
> > > > Say, my objective function is as follows:
>
> > > > f=x(1)^4-x(2)^2+x(3)^2-2*x(4)+x(2);
>
> > > > Now, I have the following constraints:
>
> > > > f = 0 when x(1) <= x(2)
>
> > > To me, this does NOT describe a constraint in the sense
> > > people know. You simply have a discontinuous function
> that
> > > is defined differently in two sets of R^4.
>
> > > Bruno
>
> > Hello Bruno,
>
> > Thanks for the reply. You are obviously correct. I guess
> I only need
> > that one inequality constraint.
>
> > So, the constraint that x(1) > x(2) can be coded as:
> > ceq = x(1) - x(2); Is this correct?
>
> > Cheers,
> > Luca
>
> Luca,
>
> I'm looking at this, and am still a little confused as to
> what you need. Are trying to find a minimum (or maximum)
> of the f that you've given, subject to a constraint? Or
> are you trying to solve f = 0 subject to a constraint?
>
> Also, is this the actual function you're interested in, or
> is it an example to illustrate your problem? I ask,
> because if your intention is to find a max or min of the
> given f, it's extremely simply to do so by hand, without
> having to use Matlab.
>
> Charles.

Hey Charles,

Thanks for the reply.

The function that I gave was just meant to serve as an example. My
real function is a set of observations measured at different times
which should follow a certain model. However, of course because of
noise and all that I have to do this regression.

Cheers,
Luca

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com