From: Steven Lord on

"MZ AM" <mazamin(a)yahoo.com> wrote in message
news:hsh9f6$en7$1(a)fred.mathworks.com...
> Thanks Steve for your reply.
>
> Actually what I am looking for is not the "lb" or "ub" (in fact I specify
> some other values that are independent of the above-mentioned
> constraints). The constraints in my case are similar to g(x) in
> description of fmincon in MATLAB manual.

I'm confused. The only instance I can see in either the function help or
the documentation reference page for FMINCON to g(x) is in the description
of the case where the objective function returns gradient information, and
if you're going to provide some of the gradient information you must provide
it all.

If you're using g(x) to refer to something else, please specify exactly the
example to which you're referring that uses g(x) in that way.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Walter Roberson on
MZ AM wrote:

> Basically I do not need any constraint under some numerical
> circumstances that's why I use null. If I understood you correctly, the
> use of realmax that you explained may simulate something like infinity
> for my constraint, which is not correct in my case.

What difference do you perceive between a constraint of infinity and no
constraint at all? Unless you want that parameter to possibly be complex
-- I haven't checked to see if fmincon handles complex parameters?
From: Matt J on
"MZ AM" <mazamin(a)yahoo.com> wrote in message <hsbu9h$h9h$1(a)fred.mathworks.com>...
> Hi,
>
> I am using a built-in function of MATLAB, which is fmincon. I have hard time providing correct data for one of the input variables. This variable can take a vector containing only double-type data. But the data I am trying to pass on it is something like:
>
> [3 2 null null 5 null 10]
============

Which one of the input variables to fmincon are you talking about?

Even if it were possible to construct a data type such as what you're after, fmincon is not designed to accept such an input. The only ways fmincon allows you to specify constraints are through function handles or box bounds in the interval [-inf inf]. The only input that are allowed to be numeric vectors are the initial vector x0, which is expected to be real-valued.
From: MZ AM on
I am sorry Steve, I did not mean g(x) in the manual I meant c(x) and ceq(x). My mistake.

> I'm confused. The only instance I can see in either the function help or
> the documentation reference page for FMINCON to g(x) is in the description
> of the case where the objective function returns gradient information, and
> if you're going to provide some of the gradient information you must provide
> it all.
>
> If you're using g(x) to refer to something else, please specify exactly the
> example to which you're referring that uses g(x) in that way.
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>
From: MZ AM on
Thanks Matt.

You are right about the way the the constraints should be applied. Actually I had defined a function that was called as an argument of fmincon and returned [cineq, ceq]. But because in my case cineq is a vector itself and ceq=[], I was just showing the cineq in my posting.
But to clear the confusion of why cineq is a vector, I should mention that the optimization should be performed in a range of data that are pressure (p) dependent. I would like the optimization use the constraints and read all from one constraint function file:

con1 for p<p1
con2=[ ] for p1<p<p2
con3 for p>p2

So with the above description I will need the cineq to be a vector like:
cineq=[-0.1 -0.2 .....[] [] []......-0.5 0.15] (and of course these []'s cause problem because they are not double-type data). Also in my case ceq=[].

On the other hand, I do not want to use three fmincon functions for the the three ranges of pressure that I have as it will yield three different optimized values which is not desired in my problem.
I don't believe a vector constraint can cause a problem, do you?

Thanks.

"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hshe84$1ui$1(a)fred.mathworks.com>...
> "MZ AM" <mazamin(a)yahoo.com> wrote in message <hsbu9h$h9h$1(a)fred.mathworks.com>...
> > Hi,
> >
> > I am using a built-in function of MATLAB, which is fmincon. I have hard time providing correct data for one of the input variables. This variable can take a vector containing only double-type data. But the data I am trying to pass on it is something like:
> >
> > [3 2 null null 5 null 10]
> ============
>
> Which one of the input variables to fmincon are you talking about?
>
> Even if it were possible to construct a data type such as what you're after, fmincon is not designed to accept such an input. The only ways fmincon allows you to specify constraints are through function handles or box bounds in the interval [-inf inf]. The only input that are allowed to be numeric vectors are the initial vector x0, which is expected to be real-valued.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Audio - Auto level Control AGC
Next: fminsearch problem