Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: nonlinear constraint help
Date: Fri, 18 Sep 2009 16:07:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <h90b75$62a$1@fred.mathworks.com>
References: <h8ufpv$2iq$1@fred.mathworks.com> <h90802$61u$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1253290021 6218 172.30.248.37 (18 Sep 2009 16:07:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 18 Sep 2009 16:07:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1317328
Xref: news.mathworks.com comp.soft-sys.matlab:571436


Thanks a lot Matt for your answer, as you probably saw I was asnswering Alan already so only when I had already posted my reply I saw yours, sorry for the double post but I thank you for your answer, but then, if adding more variables can be done, do you think can it be that MATLAB gives me an error saying that the index exceeds matrix dimension in the nonlinear constraint because I add more variables in the nonlinear constraint or am I doing something else wrong??? Like the number of columns of A should be equal to the total number of variables, does it matter???

Thanks a lot again,

Best Regards,

Simone




"Matt " <xys@whatever.com> wrote in message <h90802$61u$1@fred.mathworks.com>...
> "Simone " <simonematool@gmail.com> wrote in message <h8ufpv$2iq$1@fred.mathworks.com>...
> > Hello to all,
> > 
> > I have two maybe very dumb questions but I cannot get my head around these: I have a problem subject to 18 linear constraints and 1 nonlinear constraint. In this last one appear in part variables present also in the linear ones and other variables.
> >  Questions: 
> > 1. from the nonlinear constraint to recall the variables present in the linear constraints, I'm calling them with x(position), given the example here http://www.mathworks.com/access/helpdesk/help/toolbox/optim/index.html?/access/helpdesk/help/toolbox/optim/ug/brhkghv-7.html&http://www.mathworks.com/matlabcentral/newsreader/view_thread/256555 is this correct? 
> ====================
> 
> Yes.
> 
> 
> > 
> > 2. the second question is if I can add more variables to be solved for in the nonlinear constraint, but these would be only in this constraint
> ==============
> 
> Yes.
> 
>  (they are multiplied by the other variables present also in the linear constraints so they should be identified, isn't it?). I have seen the documentation on how to pass parameters in the nonlinear constraints but not variables, is this possible?
> ================
> 
> If your variables decompose as [x,y] where x and y are vectors, then neither your objective function f(x,y) nor your constraints Ci(x,y) have to have an explicit dependence on both x and y, even if they both take x and y as input arguments.
> 
> 
> However, if f(x,y) is independent of y, i.e. can theoretically be written f(x), that gives the algorithm more freedom in finding a y that satisfies Ci(x,y)>=0. If it's important to distinguish between more than one possible solution for y, you must of course add more constraints....