Good question. Actually, that 5th (varsets) argument to add_quad_cost() is only 
used to select which variable set (e.g. 'Vm' vs 'Va' or 'Pg') is being used, 
not the individual variable (Vm of bus 5). So you’d just do …

add_quad_cost('Vcost', [], Cw, k, {'Vm'});

… where Cw is a vector with all zeros except in that Cw(5) would be the desired 
cost for that voltage. The point of the varsets option is to allow you to 
specify Cw based only on the index in the voltage magnitudes, without worrying 
about where the voltage magnitudes reside in the full optimization vector, 
relative to voltage angles, real and reactive generation, etc.

Hope this helps,

    Ray



> On Nov 26, 2019, at 2:49 AM, zengxi_83 <zengxi...@163.com> wrote:
> 
> Hi,
> 
>  If I want to add a cost with voltage magnitude of the specified node , for 
> example the voltage magnitude of the 5th node, using the add_quad_cost 
> fuction:
>     add_quad_cost('Vcost', [], Cw, k, {'XXXXX'});
> 
> the item 'XXXXX' is to represent the voltage magnitude of the 5th node.
> 
> How the syntax is in the item 'XXXXX'? I cann’t find any example in the 
> manual.
> 
> add_quad_cost('Rcost', [], Cw, 0, {'VM,5'}) is correct?
> 
> Thank you very much for your attention and look forward to your reply!
> 
> 
> Best regards,
> 
>     zeng
> 
> Anhui Provincial Laboratory of Renewable Energy Utilization and Energy Saving 
> (Hefei University of Technology), Hefei 230009, China
> 
> 
> 
>  

Reply via email to