Path: news.mathworks.com!not-for-mail
From: Alan_Weiss <aweiss@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Objective function or lagrangian gradient input to fmincon?
Date: Mon, 21 Jan 2013 10:58:47 -0500
Organization: MathWorks
Lines: 21
Message-ID: <kdjojn$91c$2@newscl01ah.mathworks.com>
References: <kdi3jg$bte$1@newscl01ah.mathworks.com> <kdiq1k$ni2$1@newscl01ah.mathworks.com>
Reply-To: aweiss@mathworks.com
NNTP-Posting-Host: ah-aweiss.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1358783927 9260 172.28.17.56 (21 Jan 2013 15:58:47 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 21 Jan 2013 15:58:47 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
In-Reply-To: <kdiq1k$ni2$1@newscl01ah.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:787004

On 1/21/2013 2:17 AM, Bruno Luong wrote:
> "George Shoukry" wrote in message 
> <kdi3jg$bte$1@newscl01ah.mathworks.com>...
>> So, the gradient doesn't need to be of the lagrangian; just the 
>> objective function?
>>
>
> Simple and logical:
>
> The gradient implemented of the objective function for must be the 
> objective function alone. The gradient implemented of the constraint 
> function for must be the constraint function alone.
> Bruno

To add to what Bruno said, you could check the documentation for 
objectives and constraints:
http://www.mathworks.com/help/optim/ug/writing-objective-functions.html#bsj1e55
http://www.mathworks.com/help/optim/ug/writing-constraints.html#brhkghv-16

Alan Weiss
MATLAB mathematical toolbox documentation