From: Matt J on
"MZ AM" <mazamin(a)yahoo.com> wrote in message <ht1mee$2u2$1(a)fred.mathworks.com>...
> Thanks Matt.
>
> Could you further elaborate the " If you try to piece together the 3 different constraints by padding cineq with zeros..." ?
================

If I've understood you, you are optimizing a function f(p) of pressure, p, but with different constraint functions
con1(p), con2(p), con3(p)
that are applicable on different intervals of p, e.g.

con1(p)<=0 need be satisfied if and only if p<p1
con2(p)<=0 need be satisfied if and only if p1<p<p2
con3(p)<=0 need be satisfied if and only if p>p2

You are trying to find a way to tell fmincon that for example
con3(p) is not applicable on p<=p2,
and you are trying to do this by setting con3(p)=[] for p<=p2,

Steve's suggestion (if I understood him) was to instead set
con3(p)=0 on p<=p2 (zero-padding)

However, this almost certainly means that con3(p) will not be smooth at p=p2, because it is a boundary point between two differently defined regions of con3(p).

On the other hand, the theory of fmincon requires that f(p) and all constraints cineq(p) have continuous first derivatives and some of its algorithms require continuous 2nd derivatives as well. So the non-smoothness in con3(p) from zero-padding would violate the assumptions of the underlying algorithms.


It's also possible that I've misunderstood you completely, but if so, it would be best if you reboot and give us a more careful description of the optimization problem. You haven't actually explicitly told us, for example, what variables you are optimizing over and which variables are fixed parameters, etc...
First  |  Prev  | 
Pages: 1 2 3 4
Prev: Audio - Auto level Control AGC
Next: fminsearch problem