Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Simple optimization toolbox question

Subject: Simple optimization toolbox question

From: Marco Wu

Date: 13 Sep, 2011 19:12:28

Message: 1 of 3

Dear all,
 Could you please help me on a problem? I use an example to represent my complicated case below.

Assume I need to find a quadratic equation for making a pulley arc, the equation should be close to "10 important points", and should be away from "5 MOVING dangerous points". As long as the arc of the equation is within 1 unit from any dangerous point, the quadratic equation cannot be used. (No matter how good it fit the 10 important points).

The trajectories of the moving dangerous points is based on the quadratic equation plus some other factors. I can determine it only after the quadratic parameters are known. (In other words, I think I cannot put the trajectories into quadratic equation constrict file.) I set the error to be a very large number 9999 when the quadratic arc is getting close to the dangerous point in my Objective function (which is used in optimization toolbox with the constrict function ). However, the optimization toolbox will stop after it hit the BIG number 9999 after a few times. What I can do?

THanks

Subject: Simple optimization toolbox question

From: Alan Weiss

Date: 13 Sep, 2011 19:57:44

Message: 2 of 3

On 9/13/2011 3:12 PM, Marco Wu wrote:
> Dear all,
> Could you please help me on a problem? I use an example to represent my
> complicated case below.
>
> Assume I need to find a quadratic equation for making a pulley arc, the
> equation should be close to "10 important points", and should be away
> from "5 MOVING dangerous points". As long as the arc of the equation is
> within 1 unit from any dangerous point, the quadratic equation cannot be
> used. (No matter how good it fit the 10 important points).
> The trajectories of the moving dangerous points is based on the
> quadratic equation plus some other factors. I can determine it only
> after the quadratic parameters are known. (In other words, I think I
> cannot put the trajectories into quadratic equation constrict file.) I
> set the error to be a very large number 9999 when the quadratic arc is
> getting close to the dangerous point in my Objective function (which is
> used in optimization toolbox with the constrict function ). However, the
> optimization toolbox will stop after it hit the BIG number 9999 after a
> few times. What I can do?
>
> THanks

Optimization Toolbox solvers are based on the assumption that objective
and constraint functions are smooth. This means if your objective or
constraint function jumps discontinuously, then the solvers are not
likely to work. I think this is what you mean when you say that you
"...set the error to be a very large number 9999 when the quadratic arc
is getting close to the dangerous point..."

You can probably reformulate your problem so the objective and
constraint functions are smooth. For example, make the penalty increase
smoothly from 0 to a large number depending on the distance to the
dangerous set.

But, if you cannot, then try using solvers from the Global Optimization
toolbox. patternsearch and ga do not mind if the objective and
constraint functions are not smooth.

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: Simple optimization toolbox question

From: Matt J

Date: 13 Sep, 2011 20:11:27

Message: 3 of 3

"Marco Wu" wrote in message <j4o9us$4s0$1@newscl01ah.mathworks.com>...
>
> The trajectories of the moving dangerous points is based on the quadratic equation plus some other factors. I can determine it only after the quadratic parameters are known. (In other words, I think I cannot put the trajectories into quadratic equation constrict file.)
==================

No, you would define constraints on the proximity to the dangerous points using the nonlcon argument to FMINCON.

Tags for this Thread

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.

Contact us