Re: [get_losses] Different overall value for active losses

2018-12-13 Thread Ray Zimmerman
Hi José,It looks like there are two things that you are missing.1. The values in the GS and BS columns of the bus matrix are admittances conductance and susceptance values, which correspond to power at 1 p.u. voltages. To get the actual power you must compute it at the solved bus voltage.2. The branch series losses and line charging reactive injections are handled separately by get_losses(). See help get_losses for details. Put the attached display_power_balance.m in your MATLAB path and try the following. Here’s what I get …>> load test_network                                             >> mpc = loadcase(test_network);                                 >> mpopt = mpoption('out.bus', 0, 'out.branch', 0, 'verbose', 0);>> r = runpf(mpc, mpopt);                                        Converged in 0.01 seconds|     System Summary                                                           |How many?                How much?              P (MW)            Q (MVAr)-    ---  -  -Buses             41     Total Gen Capacity    .0       -.0 to .0Generators         1     On-line Capacity      .0       -.0 to .0Committed Gens     1     Generation (actual)      5.4              -4.3Loads              7     Load                     4.9               0.0  Fixed            7       Fixed                  4.9               0.0  Dispatchable     0       Dispatchable          -0.0 of -0.0      -0.0Shunts             9     Shunt (inj)             -0.1               3.6Branches          41     Losses (I^2 * Z)         0.39              1.56Transformers       8     Branch Charging (inj)     -                2.3Inter-ties         0     Total Inter-tie Flow     0.0               0.0Areas              1                          Minimum                      Maximum                 -  Voltage Magnitude   0.893 p.u. @ bus 18         1.098 p.u. @ bus 3   Voltage Angle      -4.61 deg   @ bus 18         1.46 deg   @ bus 17  P Losses (I^2*R)             -                  0.13 MW    @ line 17-27Q Losses (I^2*X)             -                  0.43 MVAr  @ line 14-12>> display_power_balance(r)                                      Active Power Generation      (Pg)    =  5.366418 Load            (Pd)    =  4.882000 Shunt Inj       (Psh)   = -0.094979 Branch Loss     (Ploss) =  0.389439Reactive Power Generation      (Qg)    = -4.312679 Load            (Qd)    =  0.036000 Shunt Inj       (Qsh)   =  3.640204 Branch Loss     (Qloss) =  1.559847 Branch Charging (Qchg)  =  2.268322Active Power Mismatch,     | Pg - Pd + Psh - Ploss |        = 0.00Reactive Power Mismatch,   | Qg - Qd + Qsh - Qloss + Qchg | = 0.00Individual Branch Balance, max(| Sf + St + Schg - Sloss |)  = 0.00Everything is consistent. Feel free to look at how I’m computing things “by hand” in the attached function.Hope this clears everything up for you,    Ray

display_power_balance.m
Description: Binary data
On Dec 11, 2018, at 4:20 AM, José Paulos  wrote:
  

  
  Hi Ray, thanks for your input, however, the question remains
  unaddressed. We are not seeing only the system summary as the
  values are rounded. We must compare those values with the ones
  found "by hand" via branches and buses. We have some questions
  below.
Using the formula you described, and based only on the system
  summary report, everything goes well:
Active        | Generation + Shunt_Inj = Loads + Losses   
                   |  5.4 – 0.1    = 4.900 + 0.39
Reactive    | Generation + Shunt_Inj + Transf_Inj = Loads +
Losses | -4.3 + 3.6 + 2.3  = 0.036 + 1.56
(reactive load added by hand - the summary was rounding it to 0)However, when analyzing it "by hand" via powerflow.bus,
  we are not understanding the differences:get_losses gives us the active and reactive losses via 

 

  Active Losses
  sum(abs(real(losses)))
   
  0.3894


  sum(real(losses))
   
  0.3894


  Reactive Losses
  sum(abs(imag(losses)))
   
  1.5598


  sum(imag(losses))
   
  1.5598

  


powerflow.gen gives us the Generation (both Active and Reactive)
powerflow.bus gives us the Loads and Shunts 

 

  Active Generation
  powerflow.gen(1,2)
   
  5.3664


  Reactive Generation
  powerflow.gen(1,3)
   
  -4.3127


  Active Shunts
  sum(powerflow.bus(:,5))
   
  0.0865


  

Re: [get_losses] Different overall value for active losses

2018-12-11 Thread José Paulos
Hi Ray, thanks for your input, however, the question remains 
unaddressed. We are not seeing only the system summary as the values are 
rounded. We must compare those values with the ones found "by hand" via 
branches and buses. We have some questions below.


Using the formula you described, and based only on the system summary 
report, everything goes well:


*Active*        | Generation + Shunt_Inj = Loads + Losses             
       |  5.4 – 0.1    = 4.900 + 0.39
*Reactive *| Generation + Shunt_Inj + Transf_Inj = Loads + Losses | -4.3 
+ 3.6 + 2.3  = /0.036/ + 1.56

(reactive load added by hand - the summary was rounding it to 0)

However, when analyzing it "by hand" via *powerflow.bus*, we are not 
understanding the differences:


get_losses gives us the active and reactive losses via

*Active Losses* /sum(abs(real(losses)))/0.3894
/sum(real(losses))/ 0.3894
*Reactive Losses*   /sum(abs(imag(losses)))/1.5598
/sum(imag(losses))/ 1.5598


powerflow.gen gives us the Generation (both Active and Reactive)
powerflow.bus gives us the Loads and Shunts

*Active Generation* /powerflow.gen(1,2)/5.3664
*Reactive Generation*   /powerflow.gen(1,3)/-4.3127
*Active Shunts* /sum(powerflow.bus(:,5))/   0.0865
*Reactive Shunts*   /sum(powerflow.bus(:,6))/   4.3080
*Active Loads*  /sum(powerflow.bus(:,3))/   4.8820
*Reactive Loads***  /sum(powerflow.bus(:,4))/   0.0360


When comparing this values with the system summary, the shunts values 
are different, _*why?*_


*System Summary**sum in powerflow.bus*
*Active Shunts* -0.10.0865
*Reactive Shunts*   3.6 4.3080


*Active*        | Generation + Shunt_Inj = Loads + Losses | 5.3664 + 
0.0865  = 4.8820 + Act_Losses | *Act_Losses = 0.5709 != **0.3894 (Why?)

*

*Active**_Alt *| Generation + Shunt_Inj = Loads + Losses |  5.3664 - 
0.0865  = 4.8820 + Act_Losses |*Act_Losses = 0.3979 **!=**0.3894 *

**(Why?)**

*Reactive *| Generation + Shunt_Inj + Transf_Inj = Loads + Losses | 
-4.3127 + 4.3080  + ? = 0.0360 + React_Losses | *Is it possible **to 
check the Transf_Inj Manually?*


---

Also, when summing the branches PF/PT and QF/QT, the results are 
inconsistent:


PF+PT = sum(powerflow.branch(:,14))+sum(powerflow.branch(:,16)) = 0.3894 
= active_losses_by_get_losses


QF+QT = sum(powerflow.branch(:,15))+sum(powerflow.branch(:,17)) = 
-0.7085 != reactive_losses_by_get_losses



INESC TEC

*José Paulos*
Centro de Sistemas de Energia
Centre for Power and Energy Systems

*INESC TEC*
Campus da FEUP
Rua Dr Roberto Frias
4200-465 Porto
Portugal

T +351 91 424 1519
F +351 22 209 4050
jose.pau...@inesctec.pt 
www.inesctec.pt 

On 10-Dec-18 17:04, Ray Zimmerman wrote:
The shunts are not included in the loss numbers, so everything does 
add up.


Generation = 5.4 MW
Loads = 4.9 MW
Losses = 0.4 MW
Shunt Inj = –0.1 MW

Generation + Shunt Inj  = Loads + Losses
5.4 – 0.1 = 4.9 + 0.4

    Ray


On Nov 29, 2018, at 10:06 AM, José Paulos > wrote:


Hi Ray, thanks for your input.

In fact, we weren't considering that. However:

When analyzing the case_info we get:

Shunt Injections
    active (MW)    -0.1
    reactive (MVAr) 3.6

I'm assuming that those are simplified values, but in our network, we 
have:


Sum of the GS Shunt Conductances = *0.0865 MW*
Difference between calculated losses vs. get_losses = *0.095 MW 
*(that were supposedly due to the missing GS values)
Resulting a difference of *0.0085 MW *(even this is different from 
the *-0.1 MW* active shunt injections).




INESC TEC

*José Paulos*
Centro de Sistemas de Energia
Centre for Power and Energy Systems

*INESC TEC*
Campus da FEUP
Rua Dr Roberto Frias
4200-465 Porto
Portugal

T +351 91 424 1519
F +351 22 209 4050
jose.pau...@inesctec.pt 
www.inesctec.pt 

On 27-Nov-18 20:03, Ray Zimmerman wrote:
You are missing contribution of the shunt elements defined in the GS 
and BS columns of the bus matrix. These also contribute to the 
overall power balance. Have a look at …


case_info(powerflow)

… after running your test_file.

    Ray


On Nov 27, 2018, at 11:53 AM, José Paulos > wrote:


Hi,

We have a network with the following configuration:

*%% system MVA base*
mpc.baseMVA = 100;

*%% system voltage levels (kV)*
mpc.V_levels = [
      0.4     15.0     30.0  60.0
];

*%% system summary*
% number of buses:     41 (1 REF | 1 PV)
% number of branches:   41 (8 transformers)
% number of loads:              21 (including Pd/Qd = 0)
% number of generators:    2
% number of capacitors: 2

We use get_lossses, in this case:

    %%% *compute the losses*
    losses 

Re: [get_losses] Different overall value for active losses

2018-12-10 Thread Ray Zimmerman
The shunts are not included in the loss numbers, so everything does add up.

Generation = 5.4 MW
Loads = 4.9 MW
Losses = 0.4 MW
Shunt Inj = –0.1 MW

Generation + Shunt Inj  = Loads + Losses
5.4 – 0.1 = 4.9 + 0.4

Ray


> On Nov 29, 2018, at 10:06 AM, José Paulos  wrote:
> 
> Hi Ray, thanks for your input.
> 
> In fact, we weren't considering that. However:
> 
> When analyzing the case_info we get:
> 
> Shunt Injections
> active (MW)-0.1 
> reactive (MVAr) 3.6 
> 
> I'm assuming that those are simplified values, but in our network, we have:
> 
> Sum of the GS Shunt Conductances = 0.0865 MW
> Difference between calculated losses vs. get_losses = 0.095 MW (that were 
> supposedly due to the missing GS values)
> Resulting a difference of 0.0085 MW (even this is different from the -0.1 MW 
> active shunt injections).
> 
> 
> 
> 
> 
> José Paulos
> Centro de Sistemas de Energia
> Centre for Power and Energy Systems
> 
> INESC TEC
> Campus da FEUP
> Rua Dr Roberto Frias
> 4200-465 Porto
> Portugal
> 
> T +351 91 424 1519
> F +351 22 209 4050
> jose.pau...@inesctec.pt 
> www.inesctec.pt 
> 
> On 27-Nov-18 20:03, Ray Zimmerman wrote:
>> You are missing contribution of the shunt elements defined in the GS and BS 
>> columns of the bus matrix. These also contribute to the overall power 
>> balance. Have a look at …
>> 
>> case_info(powerflow)
>> 
>> … after running your test_file.
>> 
>> Ray
>> 
>> 
>>> On Nov 27, 2018, at 11:53 AM, José Paulos >> > wrote:
>>> 
>>> Hi,
>>> We have a network with the following configuration:
>>> %% system MVA base
>>> mpc.baseMVA = 100;
>>> 
>>> %% system voltage levels (kV)
>>> mpc.V_levels = [
>>>   0.4 15.0 30.0 60.0
>>> ];
>>> 
>>> %% system summary
>>> % number of buses: 41 (1 REF | 1 PV)
>>> % number of branches:   41 (8 transformers)
>>> % number of loads:  21 (including Pd/Qd = 0) 
>>> % number of generators:2
>>> % number of capacitors: 2
>>> 
>>> We use get_lossses, in this case:
>>> 
>>> %%% compute the losses
>>> losses = get_losses(powerflow);
>>> %%% the active losses
>>> active_losses = sum(abs(real(losses)));
>>> 
>>> The balance between the injected active power and the Loads/Gen's is not 
>>> equal to the result of the get_lossses procedure described.
>>> Follows attached the case (run test_file.m with test_network.mat in the 
>>> same dir)
>>> 
>>> Thanks in advance,
>>> 
>>> -- 
>>> 
>>> 
>>> José Paulos
>>> Centro de Sistemas de Energia
>>> Centre for Power and Energy Systems
>>> 
>>> INESC TEC
>>> Campus da FEUP
>>> Rua Dr Roberto Frias
>>> 4200-465 Porto
>>> Portugal
>>> 
>>> T +351 91 424 1519
>>> F +351 22 209 4050
>>> jose.pau...@inesctec.pt 
>>> www.inesctec.pt 
>>> 
>>> 
>> 
> 



Re: [get_losses] Different overall value for active losses

2018-11-29 Thread José Paulos

Hi Ray, thanks for your input.

In fact, we weren't considering that. However:

When analyzing the case_info we get:

   Shunt Injections
    active (MW)    -0.1
    reactive (MVAr) 3.6

I'm assuming that those are simplified values, but in our network, we have:

Sum of the GS Shunt Conductances = *0.0865 MW*
Difference between calculated losses vs. get_losses = *0.095 MW *(that 
were supposedly due to the missing GS values)
Resulting a difference of *0.0085 MW *(even this is different from the 
*-0.1 MW* active shunt injections).




INESC TEC

*José Paulos*
Centro de Sistemas de Energia
Centre for Power and Energy Systems

*INESC TEC*
Campus da FEUP
Rua Dr Roberto Frias
4200-465 Porto
Portugal

T +351 91 424 1519
F +351 22 209 4050
jose.pau...@inesctec.pt 
www.inesctec.pt 

On 27-Nov-18 20:03, Ray Zimmerman wrote:
You are missing contribution of the shunt elements defined in the GS 
and BS columns of the bus matrix. These also contribute to the overall 
power balance. Have a look at …


case_info(powerflow)

… after running your test_file.

    Ray


On Nov 27, 2018, at 11:53 AM, José Paulos > wrote:


Hi,

We have a network with the following configuration:

*%% system MVA base*
mpc.baseMVA = 100;

*%% system voltage levels (kV)*
mpc.V_levels = [
      0.4     15.0     30.0     60.0
];

*%% system summary*
% number of buses:     41 (1 REF | 1 PV)
% number of branches:   41 (8 transformers)
% number of loads:              21 (including Pd/Qd = 0)
% number of generators:    2
% number of capacitors: 2

We use get_lossses, in this case:

    %%% *compute the losses*
    losses = get_losses(powerflow);
    %%% *the active losses*
    active_losses = sum(abs(real(losses)));

The balance between the injected active power and the Loads/Gen's is 
not equal to the result of the get_lossses procedure described.


Follows attached the case (run test_file.m with test_network.mat in 
the same dir)


Thanks in advance,

--

INESC TEC

*José Paulos*
Centro de Sistemas de Energia
Centre for Power and Energy Systems

*INESC TEC*
Campus da FEUP
Rua Dr Roberto Frias
4200-465 Porto
Portugal

T +351 91 424 1519
F +351 22 209 4050
jose.pau...@inesctec.pt 
www.inesctec.pt 








Re: [get_losses] Different overall value for active losses

2018-11-27 Thread Ray Zimmerman
You are missing contribution of the shunt elements defined in the GS and BS 
columns of the bus matrix. These also contribute to the overall power balance. 
Have a look at …

case_info(powerflow)

… after running your test_file.

Ray


> On Nov 27, 2018, at 11:53 AM, José Paulos  wrote:
> 
> Hi,
> We have a network with the following configuration:
> %% system MVA base
> mpc.baseMVA = 100;
> 
> %% system voltage levels (kV)
> mpc.V_levels = [
>   0.4 15.0 30.0 60.0
> ];
> 
> %% system summary
> % number of buses: 41 (1 REF | 1 PV)
> % number of branches:   41 (8 transformers)
> % number of loads:  21 (including Pd/Qd = 0) 
> % number of generators:2
> % number of capacitors: 2
> 
> We use get_lossses, in this case:
> 
> %%% compute the losses
> losses = get_losses(powerflow);
> %%% the active losses
> active_losses = sum(abs(real(losses)));
> 
> The balance between the injected active power and the Loads/Gen's is not 
> equal to the result of the get_lossses procedure described.
> Follows attached the case (run test_file.m with test_network.mat in the same 
> dir)
> 
> Thanks in advance,
> 
> -- 
> 
> 
> José Paulos
> Centro de Sistemas de Energia
> Centre for Power and Energy Systems
> 
> INESC TEC
> Campus da FEUP
> Rua Dr Roberto Frias
> 4200-465 Porto
> Portugal
> 
> T +351 91 424 1519
> F +351 22 209 4050
> jose.pau...@inesctec.pt 
> www.inesctec.pt 
> 
> 



Re: Get_losses

2017-07-17 Thread Ray Zimmerman
Actually, dloss_dV includes partials with respect to both voltage angle and 
voltage magnitude. But, yes, always check the help for the function in question 
by typing, for example, help get_losses, or by checking the online function 
reference Shri mentioned.

   Ray



> On Jul 15, 2017, at 11:48 AM, Abhyankar, Shrirang G.  wrote:
> 
> dloss_dv is the partial derivative of the losses w.r.t. voltage angle. It is 
> an optional output argument. If you do not need it then don’t use it.
>  
> FYI: MATPOWER has an online function reference 
>  where you can see the usage 
> of all of its functions. Suggest going through this first and then sending 
> questions to the list if something is not clear. Here’s the reference for the 
> get_losses 
>  
> function.
>  
> Shri
>  
> From:  > on behalf of Akash Tyagi 
> >
> Reply-To: MATPOWER discussion forum  >
> Date: Saturday, July 15, 2017 at 2:04 AM
> To: MATPOWER discussion forum  >
> Subject: Get_losses
>  
> Hello everyone, I am trying to use get_losses command and it's quite easy but 
> i am not getting one thing in that command,
> mpc=loadcase(case5);
> results=runpf(mpc);
> [loss,fchg,tchg,dloss_dv]=get_losses(results);
> what is 'dloss_dv' given means??



Re: Get_losses

2017-07-15 Thread Abhyankar, Shrirang G.
dloss_dv is the partial derivative of the losses w.r.t. voltage angle. It is an 
optional output argument. If you do not need it then don’t use it.

FYI: MATPOWER has an online function 
reference where you can see 
the usage of all of its functions. Suggest going through this first and then 
sending questions to the list if something is not clear. Here’s the reference 
for the 
get_losses
 function.

Shri

From:  on behalf of Akash Tyagi 

Reply-To: MATPOWER discussion forum 
Date: Saturday, July 15, 2017 at 2:04 AM
To: MATPOWER discussion forum 
Subject: Get_losses

Hello everyone, I am trying to use get_losses command and it's quite easy but i 
am not getting one thing in that command,
mpc=loadcase(case5);
results=runpf(mpc);
[loss,fchg,tchg,dloss_dv]=get_losses(results);
what is 'dloss_dv' given means??