Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Preventing negative values in fmincon
Replies: 10   Last Post: May 28, 2008 12:03 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 14
Registered: 2/19/08
Re: Preventing negative values in fmincon
Posted: May 28, 2008 12:03 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

John and Bruno,

I think I must be misinterpreting your suggestion. I have
tried several variations of what I think it means, but
nothing seems to work.

Did you mean to take the square root of the variables in the
original objective function without transforming the
variables in the constraints? So because X1 = Y1^2, etc,
then Obj = aX1^0.5 + ... = aY1 + ...
subject to: X1 + ... =< b.

Everything I have tried either stopped because a negative
number was passed into the square root, or has made the
problem less stable. Am I completely missing the point?


"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g16p8v$5ee$1@fred.mathworks.com>...
> "Mike " <michael.gerstREMOVE@yale.edu> wrote in message
> <g16n7a$9m8$1@fred.mathworks.com>...

> > Bruno and John, thanks for the tip.
> >
> > If I understand you correctly, the following simple LP

> >
> > Obj = a*X1 + a*X2 + a*X3
> > subject to: X1 + X2 + X3 =< b
> >
> > would transform to
> >
> > Obj = a*sqrt(X1^2) + b*sqrt(X2^2) + c*sqrt(X3^2)
> > subject to: sqrt(X1^2) + sqrt(X2^2) + sqrt(X3^2) =< b
> >
> > Is this the basic idea?

> Not exactly. Have the optimizer vary a vecotr
> with three unknowns in it [Y1,Y2,Y3]. Inside
> the objective function, transform your
> variables so that
> X1 = Y1^2
> X2 = Y2^2
> X3 = Y3^2
> So now X1, X2, X3 are assured to be positive.
> When the optimization is done, and it returns
> the vector [Y1, Y2, Y3], just square the elements
> to recover [X1, X2, X3].
> There are similar strategies to deal with variables
> that have both upper and lower bounds.
> John

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.