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
