Hi Viswanath,

Since your constraint is an inequality, let’s call it h(x). And since, h(x) <= 
0, you need to define it as …

h(x) = x'Hx + e'x + C – N

1. The function you need to implement computes the Hessian of lambda’ * h(x) 
for a given value of lambda and x. Both lambda and x are provided as inputs, 
you provide the Hessian of lambda’ * h(x) as output. Since h(x) (and also 
lambda) is a scalar in your case, the Hessian is simply lambda * H.

2. I assume N is a constant that is entered as part of your definition of h(x).

    Ray


> On Oct 18, 2017, at 3:10 PM, Viswanath Hariharan <[email protected]> wrote:
> 
> Sir
> I have a doubt about the method you asked me to try to add non-linear 
> constraints.
> The constraint I want to add is x'Hx + e'x + C < = N (where N is cost let's 
> say 20000 or 15000).
> 
> The above method asks me to create 2 functions, one that calculates gradient 
> values and constraint values and the other that calculates Hessian of one of 
> the lagrangian term that consists of lambda. 
> 
> 1. Say f = x'Hx + e'x + C < = N, Should I be computing the hessian of 
> lambda*f ? How do I compute lambda? 
> 2. Also, could you guide me as to where should I be inputting N? 
> 
> Thank you.
> 
> Regards
> Viswanath
> 
> On Thu, Oct 5, 2017 at 10:41 AM, Ray Zimmerman <[email protected] 
> <mailto:[email protected]>> wrote:
> (Btw, simply reply to the list, no need to copy the list owner)
> 
> MATPOWER 6.0 and earlier does not have the capability to add nonlinear 
> constraints to the OPF. However, this feature was just added to the master 
> branch in GitHub <https://github.com/MATPOWER/matpower/>. See options 2 or 3 
> under “Getting MATPOWER” in the README 
> <https://github.com/MATPOWER/matpower/blob/master/README.md>. The PDF manual 
> for the latest development version of MATPOWER can typically be found here:
> 
>    https://www.dropbox.com/s/3qkji1cuyi075uj/MATPOWER-manual.pdf?dl=0 
> <https://www.dropbox.com/s/3qkji1cuyi075uj/MATPOWER-manual.pdf?dl=0>
> 
> You’ll probably want to use the method described in Section 7.1.2 for 
> Nonlinear Constraints. In particular, you’ll want to look at the example 
> mentioned in t_opf_mips().
> 
> Hope this helps,
> 
>    Ray
> 
> 
> 
>> On Oct 4, 2017, at 5:59 PM, Viswanath Hariharan <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hello Sir
>> I want to add non linear cost constraints to the opf solver.
>>     cost = x'Hx + C'x + constant <= 20000
>>     
>> How do I use the add_constraints function to add this constraint? Should I 
>> be adding new fields to    om and then should I be passing it to 
>> add_constraints?
>> 
>> Regards
>> Viswanath Hariharan
>> 
> 
> 

Reply via email to