You can compute the complex currents directly from the power and voltage. The 
following code works for cases with consecutively numbered buses, otherwise you 
need to convert to internal bus numbering using ext2int first.

define_constants;
r = runpf('case9');
j = sqrt(-1);
Sf = (r.branch(:, PF) + j * r.branch(:, QF)) / r.baseMVA;
St = (r.branch(:, PT) + j * r.branch(:, QT)) / r.baseMVA;
V = r.bus(:, VM) .* exp(j * r.bus(:, VA) * pi/180);
If = conj(Sf ./ V);
It = conj(St ./ V);

— Ray


> On Nov 17, 2017, at 12:52 PM, Andrey Vieira <andre...@hotmail.com> wrote:
> 
> I need to get the electric current in each of the parts of certain cases ieee 
> (for example 84 buses) after the load flow simulation. One of the ways is by 
> means of the electrical losses in each of the branches. It turns out that 
> there are cases (like the 84 buses) in which the indication of the losses in 
> some branches is null. To see 84 buses example below (branches 1 - 2  and 2 - 
> 3).
> How to obtain the current of the branches where the indication of losses is 
> zero?
> 
> ================================================================================
> |     Branch Data                                                             
>  |
> ================================================================================
> Brnch   From   To    From Bus Injection   To Bus Injection     Loss (I^2 * Z) 
>  
>   #     Bus    Bus    P (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q 
> (MVAr)
> -----  -----  -----  --------  --------  --------  --------  --------  
> --------
>    1      1      2      0.00      0.00      0.00      0.00     0.000      0.00
>    2      2      3     -0.00      0.00      0.00     -0.00     0.000      0.00
>    3      3      4     -0.08     -0.04      0.08      0.04     0.000      0.00
>    4      4      5     -0.33     -0.20      0.33      0.20     0.000      0.00
>    5      5      6     -0.61     -0.41      0.61      0.41     0.001      0.00
>    6      6      7     -0.79     -0.49      0.79      0.49     0.000      0.00
>    7      7      8     -1.70     -1.15      1.70      1.16     0.002      0.01
>    8      8      9      0.25      0.17     -0.25     -0.16     0.000      0.00
>    9      8     10      0.25      0.19     -0.25     -0.19     0.000      0.00
>   10      8     11      0.25      0.21     -0.25     -0.21     0.000      0.00
>   11      1     12      2.62      1.89     -2.61     -1.88     0.006      0.01
>   12     12     13      2.61      1.88     -2.59     -1.82     0.027      0.06
> ..  ..  ...  ...   ..
> ..     ..     ..    ..    
> ..

Reply via email to