Re: Power Flow in Matpower

2018-03-21 Thread Jose Luis Marín
Hello Mohammed,

The problem is in the *branch joining buses 16 and 17* (line 191 in the
file).  This branch had zero R and zero X.  Just edit the value of X to
something reasonable (I used 0.001), and the case solves just fine, in 4
iterations.

-- 
Jose L. Marin
Grupo AIA



2018-03-21 3:51 GMT+01:00 Mohammed Alhajri :

> i got
>
> 
>
> 19980   NaN
> 19981   NaN
> 19982   NaN
> 19983   NaN
> 19984   NaN
> 19985   NaN
> 19986   NaN
> 19987   NaN
> 19988   NaN
> 19989   NaN
> 19990   NaN
> 19991   NaN
> 19992   NaN
> 19993   NaN
> 19994   NaN
> 19995   NaN
> 19996   NaN
> 19997   NaN
> 19998   NaN
> 1   NaN
> 2   NaN
> Gauss-Seidel power flow did not converge in 2 iterations.
>
> >  Did NOT converge (47.99 seconds)  <
>
>
> On 20 March 2018 at 19:44, Ray Zimmerman  wrote:
>
>> Unfortunately, I do not have time to work on this myself. I was just
>> giving a suggestion for another direction to try if you want to understand
>> the issue that MATPOWER is having with your case. Could you post the output
>> (using verbose set to 2) of runpf() when using a MATPOIWER case file
>> that corresponds to the solved case from the Hadi Sadat code?
>>
>> And if you have any questions about the MATPOWER case format or MATPOWER
>> power flow options, feel free to ask.
>>
>> Ray
>>
>>
>>
>> On Mar 20, 2018, at 11:28 AM, Mohammed Alhajri  wrote:
>>
>> Ok, i have attached the case information in format of Hadi Saadat code,
>> can you please try it in MATPOWER?
>>
>> because we have spent more than three weeks checking the format, but
>> still dose not converge...
>>
>> Regards,,,
>>
>> بتاريخ ٢٠١٨/٠٣/٢٠ ٦:٢٦ م، كتب "Ray Zimmerman" :
>>
>>> It’s possible that the modeling is not identical or that there is some
>>> error in your conversion to MATPOWER format. You can check by talking the
>>> solved case from your other software, converting that solved case to
>>> MATPOWER and then trying the MATPOWER power flow. It should converge in a
>>> single iteration. If it does not, then you know that there is either a
>>> mistake somewhere or a difference in modeling.
>>>
>>>Ray
>>>
>>>
>>> On Mar 16, 2018, at 12:42 PM, Mohammed Alhajri 
>>> wrote:
>>>
>>> i tried that but unfortunately not work
>>>
>>> بتاريخ ٢٠١٨/٠٣/١٦ ٨:٣٠ م، كتب "Abhyankar, Shrirang G." >> >:
>>>
 See FAQ #5 



 Thanks,

 Shri

 Ph: (630) 252 0219 <(630)%20252-0219>

 www.mcs.anl.gov/~abhyshr







 *From: * on behalf of
 Mohammed Alhajri 
 *Reply-To: *MATPOWER discussion forum 
 *Date: Friday, March 16, 2018 at 11:26 AM*
 *To: MATPOWER discussion forum >>> >*
 *Subject: Re: Power Flow in Matpower*



 any answer to this question?



 بتاريخ ٢٠١٨/٠٢/٢٥ ٧:١٨ م، كتب "Mohammed Alhajri" :

 Hello All,



 I did the power flow for a 89-bus network and it converges using Hadi
 Sadat code after 17080 iterations. The accuracy was 1e-8 and the method is
 Gauss-Seidel Method.



 But when I did the power flow using matpower it does not converge! I
 tried to increase the maximum iteration, I put it 10, and still did not
 cnvarge!



 I have attached the data according to Hadi Sadat Code, can any one try
 to do the power flow using matpower?




>>>
>>
>


Re: Power Flow in Matpower

2018-03-21 Thread Mohammed Alhajri
yes done,  thank you very much



بتاريخ ٢٠١٨/٠٣/٢١ ١٢:٥٨ م، كتب "Jose Luis Marín" :

> Hello Mohammed,
>
> The problem is in the *branch joining buses 16 and 17* (line 191 in the
> file).  This branch had zero R and zero X.  Just edit the value of X to
> something reasonable (I used 0.001), and the case solves just fine, in 4
> iterations.
>
> --
> Jose L. Marin
> Grupo AIA
>
>
>
> 2018-03-21 3:51 GMT+01:00 Mohammed Alhajri :
>
>> i got
>>
>> 
>>
>> 19980   NaN
>> 19981   NaN
>> 19982   NaN
>> 19983   NaN
>> 19984   NaN
>> 19985   NaN
>> 19986   NaN
>> 19987   NaN
>> 19988   NaN
>> 19989   NaN
>> 19990   NaN
>> 19991   NaN
>> 19992   NaN
>> 19993   NaN
>> 19994   NaN
>> 19995   NaN
>> 19996   NaN
>> 19997   NaN
>> 19998   NaN
>> 1   NaN
>> 2   NaN
>> Gauss-Seidel power flow did not converge in 2 iterations.
>>
>> >  Did NOT converge (47.99 seconds)  <
>>
>>
>> On 20 March 2018 at 19:44, Ray Zimmerman  wrote:
>>
>>> Unfortunately, I do not have time to work on this myself. I was just
>>> giving a suggestion for another direction to try if you want to understand
>>> the issue that MATPOWER is having with your case. Could you post the output
>>> (using verbose set to 2) of runpf() when using a MATPOIWER case file
>>> that corresponds to the solved case from the Hadi Sadat code?
>>>
>>> And if you have any questions about the MATPOWER case format or MATPOWER
>>> power flow options, feel free to ask.
>>>
>>> Ray
>>>
>>>
>>>
>>> On Mar 20, 2018, at 11:28 AM, Mohammed Alhajri 
>>> wrote:
>>>
>>> Ok, i have attached the case information in format of Hadi Saadat code,
>>> can you please try it in MATPOWER?
>>>
>>> because we have spent more than three weeks checking the format, but
>>> still dose not converge...
>>>
>>> Regards,,,
>>>
>>> بتاريخ ٢٠١٨/٠٣/٢٠ ٦:٢٦ م، كتب "Ray Zimmerman" :
>>>
 It’s possible that the modeling is not identical or that there is some
 error in your conversion to MATPOWER format. You can check by talking the
 solved case from your other software, converting that solved case to
 MATPOWER and then trying the MATPOWER power flow. It should converge in a
 single iteration. If it does not, then you know that there is either a
 mistake somewhere or a difference in modeling.

Ray


 On Mar 16, 2018, at 12:42 PM, Mohammed Alhajri 
 wrote:

 i tried that but unfortunately not work

 بتاريخ ٢٠١٨/٠٣/١٦ ٨:٣٠ م، كتب "Abhyankar, Shrirang G." >>> >:

> See FAQ #5 
>
>
>
> Thanks,
>
> Shri
>
> Ph: (630) 252 0219 <(630)%20252-0219>
>
> www.mcs.anl.gov/~abhyshr
>
>
>
>
>
>
>
> *From: * on behalf of
> Mohammed Alhajri 
> *Reply-To: *MATPOWER discussion forum 
> *Date: Friday, March 16, 2018 at 11:26 AM*
> *To: MATPOWER discussion forum  >*
> *Subject: Re: Power Flow in Matpower*
>
>
>
> any answer to this question?
>
>
>
> بتاريخ ٢٠١٨/٠٢/٢٥ ٧:١٨ م، كتب "Mohammed Alhajri" :
>
> Hello All,
>
>
>
> I did the power flow for a 89-bus network and it converges using Hadi
> Sadat code after 17080 iterations. The accuracy was 1e-8 and the method is
> Gauss-Seidel Method.
>
>
>
> But when I did the power flow using matpower it does not converge! I
> tried to increase the maximum iteration, I put it 10, and still did 
> not
> cnvarge!
>
>
>
> I have attached the data according to Hadi Sadat Code, can any one try
> to do the power flow using matpower?
>
>
>
>

>>>
>>
>


Re: Power Flow in Matpower

2018-03-21 Thread Carlos E Murillo-Sanchez

  
  
The Ybus matrix computed from the data
  in your file has NaN's and Inf's because branch # 69 from bus 16
  to bus 17 has zero series impedance.  You must collapse buses 16
  and 17 into a single bus before applying any algorithm to the
  system because the electrical "distance" between these two buses
  is zero.
  
  Carlos.
  
  Mohammed Alhajri wrote:


  i got






  19980               NaN
  19981               NaN
  19982               NaN
  19983               NaN
  19984               NaN
  19985               NaN
  19986               NaN
  19987               NaN
  19988               NaN
  19989               NaN
  19990               NaN
  19991               NaN
  19992               NaN
  19993               NaN
  19994               NaN
  19995               NaN
  19996               NaN
  19997               NaN
  19998               NaN
  1               NaN
  2               NaN
  Gauss-Seidel power flow did not converge in 2
iterations.
  
  
  >  Did NOT converge (47.99 seconds) 
<



  
  
On 20 March 2018 at 19:44, Ray
  Zimmerman 
  wrote:
  
Unfortunately,
  I do not have time to work on this myself. I was just
  giving a suggestion for another direction to try if you
  want to understand the issue that MATPOWER is having with
  your case. Could you post the output (using verbose set to 2) of runpf() when using a MATPOIWER
  case file that corresponds to the solved case from
  the Hadi Sadat code?
  
  
  And if you have any questions about the MATPOWER case
format or MATPOWER power flow options, feel free to ask.


  
    Ray
  

  

  
On Mar 20, 2018, at 11:28 AM, Mohammed
  Alhajri 
  wrote:


  Ok, i have attached the
case information in format of Hadi
Saadat code, can you please try it in
MATPOWER? 


because we have spent
  more than three weeks checking the
  format, but still dose not
  converge... 


Regards,,, 
  
  
بتاريخ
  ٢٠١٨/٠٣/٢٠ ٦:٢٦ م، كتب "Ray Zimmerman"
  :
  
It’s
  possible that the modeling is not
  identical or that there is some
  error in your conversion to
  MATPOWER format. You can check by
  talking the solved case from your
  other software, converting that
  solved case to MATPOWER and then
  trying the MATPOWER power flow. It
  should converge in a single
  iteration. If it does not, then
  you know that there is either a
  mistake somewhere or a difference
  in modeling.
  
  
     Ray
  

  
On Mar 16, 2018, at
  12:42 PM, Mohammed Alhajri
  
  wrote:

  

Re: Power Flow in Matpower

2018-03-21 Thread Mohammed Alhajri
Hello All

i want to ask about the transformer ratio, how i can choose the best number
such that the voltage bus be in good agreement with the real value

my case is

++

%%-  Power Flow Data  -%%
%% system MVA base
mpc.baseMVA = 100;

%% bus data
% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
mpc.bus = [
1 3 6 2 0 0 1 1.045 0 220 1 1.2 0.7;
2 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
3 2 37 12.2 0 0 1 1.052 0 220 1 1.2 0.7;
4 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
5 1 89.1 40.1 0 0 1 1 0 220 1 1.2 0.7;
6 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
7 2 62 20.4 0 0 1 1.037 0 220 1 1.2 0.7;
8 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
9 1 0 0 0 0 1 1 0 400 1 1.2 0.7;
10 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
11 2 6 2 0 0 1 1.042 0 220 1 1.2 0.7;
12 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
13 1 112.7 46.8 0 40 1 1 0 132 1 1.2 0.7;
14 1 19.4 7.7 0 0 1 1 0 132 1 1.2 0.7;
15 1 73.2 29.5 0 0 1 1 0 132 1 1.2 0.7;
16 2 7 2.3 0 0 1 1.018 0 132 1 1.2 0.7;
17 1 168.1 65 0 0 1 1 0 132 1 1.2 0.7;
18 1 288.4 134.4 0 40 1 1 0 132 1 1.2 0.7;
19 1 165.1 69.2 0 0 1 1 0 132 1 1.2 0.7;
20 1 87.2 35.8 0 0 1 1 0 132 1 1.2 0.7;
21 1 118.1 50.7 0 40 1 1 0 132 1 1.2 0.7;
22 1 144 59.3 0 40 1 1 0 132 1 1.2 0.7;
23 1 0 0 0 40 1 1 0 132 1 1.2 0.7;
24 1 77.3 31 0 40 1 1 0 132 1 1.2 0.7;
25 1 50.1 19.7 0 0 1 1 0 132 1 1.2 0.7;
26 1 128.4 56.3 0 0 1 1 0 132 1 1.2 0.7;
27 1 143.5 59.7 0 0 1 1 0 132 1 1.2 0.7;
28 1 136.9 61.1 0 0 1 1 0 132 1 1.2 0.7;
29 1 97.5 40.4 0 40 1 1 0 132 1 1.2 0.7;
30 1 98.6 41.4 0 0 1 1 0 132 1 1.2 0.7;
31 1 147.3 67 0 0 1 1 0 132 1 1.2 0.7;
32 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
33 1 240.2 103.8 0 40 1 1 0 132 1 1.2 0.7;
34 2 7 2.3 0 0 1 0.993 0 132 1 1.2 0.7;
35 1 132.4 55.9 0 0 1 1 0 132 1 1.2 0.7;
36 1 117 50.5 0 40 1 1 0 132 1 1.2 0.7;
37 1 24.2 9.6 0 0 1 1 0 132 1 1.2 0.7;
38 1 13.2 4.9 0 0 1 1 0 132 1 1.2 0.7;
39 1 58.8 23.4 0 0 1 1 0 132 1 1.2 0.7;
40 1 85.3 34.6 0 40 1 1 0 132 1 1.2 0.7;
41 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
42 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
43 1 225 74 0 0 1 1 0 220 1 1.2 0.7;
44 1 193.4 58.9 0 0 1 1 0 132 1 1.2 0.7;
45 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
46 1 147.3 59.4 0 40 1 1 0 132 1 1.2 0.7;
47 1 28.7 10.8 0 10 1 1 0 132 1 1.2 0.7;
48 1 61.8 16.4 0 10 1 1 0 132 1 1.2 0.7;
49 1 71.3 28.2 0 0 1 1 0 132 1 1.2 0.7;
50 1 86.3 35.6 0 0 1 1 0 132 1 1.2 0.7;
51 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
52 1 101.1 42.3 0 0 1 1 0 132 1 1.2 0.7;
53 2 6 2 0 0 1 1.02 0 132 1 1.2 0.7;
54 1 47.4 19.4 0 0 1 1 0 132 1 1.2 0.7;
55 1 44.6 17.4 0 0 1 1 0 132 1 1.2 0.7;
56 1 116.4 46.4 0 0 1 1 0 132 1 1.2 0.7;
57 1 50.1 19.7 0 0 1 1 0 132 1 1.2 0.7;
58 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
59 1 0 0 0 0 1 1 0 400 1 1.2 0.7;
60 1 0 0 0 0 1 1 0 400 1 1.2 0.7;
61 2 12 3.9 0 0 1 1.006 0 220 1 1.2 0.7;
62 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
63 1 83 33.4 0 0 1 1 0 132 1 1.2 0.7;
64 1 78.1 31.4 0 0 1 1 0 132 1 1.2 0.7;
65 1 83.2 34.3 0 0 1 1 0 132 1 1.2 0.7;
66 2 6 2 0 0 1 1.017 0 132 1 1.2 0.7;
67 1 82.5 33.2 0 0 1 1 0 132 1 1.2 0.7;
68 1 120.9 52.2 0 0 1 1 0 132 1 1.2 0.7;
69 1 80.4 32.2 0 0 1 1 0 132 1 1.2 0.7;
70 1 76.8 30.7 0 0 1 1 0 132 1 1.2 0.7;
71 1 39.7 15.1 0 40 1 1 0 132 1 1.2 0.7;
72 1 8.3 3.5 0 0 1 1 0 132 1 1.2 0.7;
73 1 47.3 18.1 0 0 1 1 0 132 1 1.2 0.7;
74 1 87.2 36.3 0 0 1 1 0 132 1 1.2 0.7;
75 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
76 2 0 0 0 0 1 1.004 0 132 1 1.2 0.7;
77 1 73.2 28.9 0 40 1 1 0 132 1 1.2 0.7;
78 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
79 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
80 1 79.8 31.8 0 0 1 1 0 132 1 1.2 0.7;
81 1 141.7 58.3 0 40 1 1 0 132 1 1.2 0.7;
82 1 98.8 41 0 40 1 1 0 132 1 1.2 0.7;
83 1 76.2 30.9 0 0 1 1 0 132 1 1.2 0.7;
84 1 35.2 13.2 0 0 1 1 0 132 1 1.2 0.7;
85 2 35 11.5 0 0 1 0.991 0 132 1 1.2 0.7;
86 2 139.1 54.5 0 0 1 0.991 0 132 1 1.2 0.7;
87 1 175.4 75 0 40 1 1 0 132 1 1.2 0.7;
88 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
89 1 271.2 121.8 0 40 1 1 0 132 1 1.2 0.7;
];

%% generator data
% bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2 Qc1min Qc1max Qc2min
Qc2max ramp_agc ramp_10 ramp_30 ramp_q apf
mpc.gen = [
1 432.26 180.3 498 -498 1.05 100 1 745 0 0 0 0 0 0 0 0 0 0 0 0;
3 735.72 348.83 350 -348.8 1 100 1 800 0 0 0 0 0 0 0 0 0 0 0 0;
7 1178 567.26 567.3 -567.3 1 100 1 1250 0 0 0 0 0 0 0 0 0 0 0 0;
11 430.62 59.21 296.4 -296.4 1 100 1 450 0 0 0 0 0 0 0 0 0 0 0 0;
16 600.34 197.23 266 -266 1 100 1 665 0 0 0 0 0 0 0 0 0 0 0 0;
34 281.34 140.15 150 -130 1 100 1 325 0 0 0 0 0 0 0 0 0 0 0 0;
53 260.3 114.62 120 -114.6 1 100 1 270 0 0 0 0 0 0 0 0 0 0 0 0;
61 1737.07 470.88 800 -800 1 100 1 2000 0 0 0 0 0 0 0 0 0 0 0 0;
66 208.21 102.09 108.4 -108.4 1 100 1 271 0 0 0 0 0 0 0 0 0 0 0 0;
76 83.3 49.5 55 -49.5 1 100 1 85 0 0 0 0 0 0 0 0 0 0 0 0;
85 168.1 36.4 40 -40 1 100 1 235 0 0 0 0 0 0 0 0 0 0 0 0;
86 83 35.4 122 -122 1 100 1 85 0 0 0 0 0 0 0 0 0 0 0 0;
];

%% branch data
% fbus tbus r x b rateA rateB rateC ratio angle status angmin angmax
mpc.branch = [
60 9 0.000789 0.009643 0.9930 975 975 975 1 0 1 -360 360;
60 59 0.001470 0.017964 1.8499 975 975 975 1 0 1 -360 360;
43 3 0.31 0.000929 0.1235 625 625 625 1 0 1 -360 360;
41 42 0.001367 0.01

Re: Network reduction error

2018-03-21 Thread Ray Zimmerman
Hi Vikram,

The network reduction code in MATPOWER was contributed by Yujia Zhu and Dan 
Tylavsky at ASU. I’m not familiar with the internals of the code, so I’ve 
passed this question along to them (off-list).

Ray


> On Mar 20, 2018, at 1:25 PM, vikram reddy  wrote:
> 
> Hello,
> 
> I have 2 bus system and I am trying to reduce the network with MATPOWER. 
> I want to eliminate about 15000 buses and therefore the "ExBusOrig" is a 
> 15000*1 vector. When I run this case, I am getting a memory error which I 
> posted below. Is there any workaround this?
> 
> Thanks,
> Vikram.
> 
> MATLAB output
> 
> "Eliminate 0 isolated buses
> Eliminate 0 branches
> Eliminate 0 generators
> Eliminate 1 dc lines
> Preprocessing complete
> Convert input data model
> Creating Y matrix of input full model
> Do first round reduction eliminating all external busesRequested 1004214785x1 
> (7.5GB) array exceeds maximum array size preference. Creation of arrays 
> greater than this limit may take a
> long time and cause MATLAB to become unresponsive. See array size limit or 
> preference panel for more information.
> 
> Error in SelfLink (line 51)
> LinkPos(Counter)=SelfRef;
> 
> Error in PartialSymLU (line 97)
> [LinkPos,LinkArray,Counter] = SelfLink(Link,RowIndex);
> 
> Error in DoReduction (line 42)
> [ERPU,CIndxU,ERPEQ,CIndxEQ] = 
> PartialSymLU(CIndx,ERP,dim,length(ExBus),BoundBus);
> 
> Error in MPReduction (line 67)
> [mpcreduced,BCIRCr,ExBusr] = 
> DoReduction(DataB,ERP,CIndx,ExBus,NUMB,dim,BCIRC,newbusnum,oldbusnum,mpc); % 
> ExBusr with original
> numbering"
> 



Re: Power Flow in Matpower

2018-03-21 Thread Ray Zimmerman
MATPOWER does not currently include a way to set the transformer taps 
automatically during power flow. However, Gorazd Bone is working on this 
feature and has some work-in-progress sitting in pull request #16 
 on GitHub. Not sure if you would 
find any of that useful. This thread 
 on the 
MATPOWER-DEV-L list is also relevant to that PR.

   Ray



> On Mar 21, 2018, at 1:01 PM, Mohammed Alhajri  wrote:
> 
> Hello All
> 
> i want to ask about the transformer ratio, how i can choose the best number 
> such that the voltage bus be in good agreement with the real value
> 
> my case is
> 
> ++
> 
> %%-  Power Flow Data  -%%
> %% system MVA base
> mpc.baseMVA = 100;
> 
> %% bus data
> % bus_i   typePd  Qd  Gs  Bs  areaVm  Va  
> baseKV  zoneVmaxVmin
> mpc.bus = [
> 1 3   6   2   0   0   1   1.045   0   220 
> 1   1.2 0.7;
> 2 1   0   0   0   0   1   1   0   220 
> 1   1.2 0.7;
> 3 2   37  12.20   0   1   1.052   0   220 
> 1   1.2 0.7;
> 4 1   0   0   0   0   1   1   0   220 
> 1   1.2 0.7;
> 5 1   89.140.10   0   1   1   0   220 
> 1   1.2 0.7;
> 6 1   0   0   0   0   1   1   0   220 
> 1   1.2 0.7;
> 7 2   62  20.40   0   1   1.037   0   220 
> 1   1.2 0.7;
> 8 1   0   0   0   0   1   1   0   220 
> 1   1.2 0.7;
> 9 1   0   0   0   0   1   1   0   400 
> 1   1.2 0.7;
> 101   0   0   0   0   1   1   0   220 
> 1   1.2 0.7;
> 112   6   2   0   0   1   1.042   0   220 
> 1   1.2 0.7;
> 121   0   0   0   0   1   1   0   220 
> 1   1.2 0.7;
> 131   112.7   46.80   40  1   1   0   132 
> 1   1.2 0.7;
> 141   19.47.7 0   0   1   1   0   132 
> 1   1.2 0.7;
> 151   73.229.50   0   1   1   0   132 
> 1   1.2 0.7;
> 162   7   2.3 0   0   1   1.018   0   132 
> 1   1.2 0.7;
> 171   168.1   65  0   0   1   1   0   132 
> 1   1.2 0.7;
> 181   288.4   134.4   0   40  1   1   0   132 
> 1   1.2 0.7;
> 191   165.1   69.20   0   1   1   0   132 
> 1   1.2 0.7;
> 201   87.235.80   0   1   1   0   132 
> 1   1.2 0.7;
> 211   118.1   50.70   40  1   1   0   132 
> 1   1.2 0.7;
> 221   144 59.30   40  1   1   0   132 
> 1   1.2 0.7;
> 231   0   0   0   40  1   1   0   132 
> 1   1.2 0.7;
> 241   77.331  0   40  1   1   0   132 
> 1   1.2 0.7;
> 251   50.119.70   0   1   1   0   132 
> 1   1.2 0.7;
> 261   128.4   56.30   0   1   1   0   132 
> 1   1.2 0.7;
> 271   143.5   59.70   0   1   1   0   132 
> 1   1.2 0.7;
> 281   136.9   61.10   0   1   1   0   132 
> 1   1.2 0.7;
> 291   97.540.40   40  1   1   0   132 
> 1   1.2 0.7;
> 301   98.641.40   0   1   1   0   132 
> 1   1.2 0.7;
> 311   147.3   67  0   0   1   1   0   132 
> 1   1.2 0.7;
> 321   0   0   0   0   1   1   0   132 
> 1   1.2 0.7;
> 331   240.2   103.8   0   40  1   1   0   132 
> 1   1.2 0.7;
> 342   7   2.3 0   0   1   0.993   0   132 
> 1   1.2 0.7;
> 351   132.4   55.90   0   1   1   0   132 
> 1   1.2 0.7;
> 361   117 50.50   40  1   1   0   132 
> 1   1.2 0.7;
> 371   24.29.6 0   0   1   1   0   132 
> 1   1.2 0.7;
> 381   13.24.9 0   0   1   1   0   132 
> 1   1.2 0.7;
> 391   58.823.40   0   1   1   0   132 
>

Re: Calculating pure generation cost and assign load profile for each bus

2018-03-21 Thread Ray Zimmerman
The issue described in this post 
 may be 
playing into it. There is a constant term related to ramping costs that is not 
in the MIQP objective function returned in mdo.results.f and mdo.QP.f. That 
constant term can be found in mdo.QP.c1. There was an update to most_summary() 
to address this in this commit 
.

Ray



> On Mar 20, 2018, at 1:12 PM, Bainan Xia  wrote:
> 
> Thanks for the explanation J
>  
> You are right, I’ve checked fixed_gencost matrix and found all constant terms 
> there. However, I’m calculating the pure generation cost in each time period 
> in the following way (deterministic, no contingency, linear cost curve):
>  
> for t = 1:nt
> mpc = mdo.flow(t).mpc;
> total_gen0(t) = sum(totcost(mpc.gencost, mpc.gen(:,PG)));
> total_gen1(t) = sum(mpc.gencost(:,5).*mpc.gen(:,PG) + mpc.gencost(:,6)); 
> %Here mpc.gencost(:,6)==0
> total_gen2(t) = sum(mpc.gencost(:,5).*mpc.gen(:,PG) + mpc.fixed_gencost(:,6));
> end
>  
> Then I got following relationship:
> sum(total_gen0) = sum(total_gen1) < f < sum(total_gen2)
> Based on my understanding, sum(total_gen2) should be the correct total 
> generation cost, however, it turns out to be greater than the value of 
> objective function, f, which includes other costs as well. I’m confused about 
> this result.
>  
> Best,
> Bainan
>  
>  
> From: bounce-122398534-80810...@list.cornell.edu 
>  
>  > On Behalf Of Ray 
> Zimmerman
> Sent: Tuesday, March 20, 2018 7:47 AM
> To: MATPOWER discussion forum  >
> Subject: Re: Calculating pure generation cost and assign load profile for 
> each bus
>  
> a) It would take some time for me to dig into the details (Carlos, maybe you 
> remember more off the top of your head), but it has to do with the fact that 
> the constant term (“no-load cost" is only included in the cost if the unit is 
> committed, so it is actually removed from the part that is a function of Pg 
> and handled separately. I believe, if I am not mistaken, the constant term 
> for generator i in period t, scenario j, contingency k, can be found 
> inmdo.flow(t,j,k).mpc.fixed_gencost(i). And I believe the 
> probability-weighted "no-load" cost for generator i in period t can be found 
> in  mdo.UC.c00(i,t).
>  
> b) It is possible. Simply change the col field of the profile from 
> CT_TAREALOAD to CT_TLOAD. See Table 9-2 in the MATPOWER User’s Manual 
> ,
>  in the description of MATPOWER’s apply_changes() 
> 
>  function, which is used to implement the profiles in MOST.
>  
> Hope this helps,
>  
> Ray
>  
> 
> 
> On Mar 19, 2018, at 8:09 PM, Bainan Xia  > wrote:
>  
> Hi guys,
>  
> I’ve got following two questions when solving multi-period UC problem.
>  
> a)   Given the result structure ‘mdo’, I’m calculating the total 
> generation cost for time period t in following way:
> mpc = mdo.flow(t).mpc;
> total_cost = sum(totcost(mpc.gencost, mpc.gen(:, PG)));
> However, I found the total cost is much less than my expectation. Then I 
> compared mdo.flow(t).mpc.gencost and mpc.gencost and found all the constant 
> terms (in my case, cost curves are quadratic and last column defines the 
> constant term) are zero in the previous matrix, which is different from the 
> base case mpc structure. I’m wondering what causes the issue.
>  
> b)  Previously, from the example cases (ex_load_profile), I’ve learned 
> how to assign the time series load profile for each area/load zone. Now, I 
> would like to assign specific time series load profile for each bus and 
> cannot find an example doing so. I’m wondering whether there is a way to do 
> that. Otherwise, I may use the naïve method: making the #area/#load zone the 
> same as the #bus, so that I could assign the load profile in the old way.
>  
> Thanks for the help!
>  
> Best,
> Bainan



Re: Power Flow in Matpower

2018-03-21 Thread Mohammed Alhajri
it will be excellent, but i mean how i can change manually the best
transformer(s) tap(s) to correct the voltage?

i tried to vary the (ratio) of the transformers in branch data matrix and
run PF to see the changes, is this way correct?

if yes, any other ways?

On 22 March 2018 at 01:19, Ray Zimmerman  wrote:

> MATPOWER does not currently include a way to set the transformer taps
> automatically during power flow. However, Gorazd Bone is working on this
> feature and has some work-in-progress sitting in pull request #16
>  on GitHub. Not sure if you
> would find any of that useful. This thread
>  on
> the MATPOWER-DEV-L list is also relevant to that PR.
>
>Ray
>
>
>
> On Mar 21, 2018, at 1:01 PM, Mohammed Alhajri  wrote:
>
> Hello All
>
> i want to ask about the transformer ratio, how i can choose the best
> number such that the voltage bus be in good agreement with the real value
>
> my case is
>
> ++
>
> %%-  Power Flow Data  -%%
> %% system MVA base
> mpc.baseMVA = 100;
>
> %% bus data
> % bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
> mpc.bus = [
> 1 3 6 2 0 0 1 1.045 0 220 1 1.2 0.7;
> 2 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 3 2 37 12.2 0 0 1 1.052 0 220 1 1.2 0.7;
> 4 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 5 1 89.1 40.1 0 0 1 1 0 220 1 1.2 0.7;
> 6 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 7 2 62 20.4 0 0 1 1.037 0 220 1 1.2 0.7;
> 8 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 9 1 0 0 0 0 1 1 0 400 1 1.2 0.7;
> 10 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 11 2 6 2 0 0 1 1.042 0 220 1 1.2 0.7;
> 12 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 13 1 112.7 46.8 0 40 1 1 0 132 1 1.2 0.7;
> 14 1 19.4 7.7 0 0 1 1 0 132 1 1.2 0.7;
> 15 1 73.2 29.5 0 0 1 1 0 132 1 1.2 0.7;
> 16 2 7 2.3 0 0 1 1.018 0 132 1 1.2 0.7;
> 17 1 168.1 65 0 0 1 1 0 132 1 1.2 0.7;
> 18 1 288.4 134.4 0 40 1 1 0 132 1 1.2 0.7;
> 19 1 165.1 69.2 0 0 1 1 0 132 1 1.2 0.7;
> 20 1 87.2 35.8 0 0 1 1 0 132 1 1.2 0.7;
> 21 1 118.1 50.7 0 40 1 1 0 132 1 1.2 0.7;
> 22 1 144 59.3 0 40 1 1 0 132 1 1.2 0.7;
> 23 1 0 0 0 40 1 1 0 132 1 1.2 0.7;
> 24 1 77.3 31 0 40 1 1 0 132 1 1.2 0.7;
> 25 1 50.1 19.7 0 0 1 1 0 132 1 1.2 0.7;
> 26 1 128.4 56.3 0 0 1 1 0 132 1 1.2 0.7;
> 27 1 143.5 59.7 0 0 1 1 0 132 1 1.2 0.7;
> 28 1 136.9 61.1 0 0 1 1 0 132 1 1.2 0.7;
> 29 1 97.5 40.4 0 40 1 1 0 132 1 1.2 0.7;
> 30 1 98.6 41.4 0 0 1 1 0 132 1 1.2 0.7;
> 31 1 147.3 67 0 0 1 1 0 132 1 1.2 0.7;
> 32 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
> 33 1 240.2 103.8 0 40 1 1 0 132 1 1.2 0.7;
> 34 2 7 2.3 0 0 1 0.993 0 132 1 1.2 0.7;
> 35 1 132.4 55.9 0 0 1 1 0 132 1 1.2 0.7;
> 36 1 117 50.5 0 40 1 1 0 132 1 1.2 0.7;
> 37 1 24.2 9.6 0 0 1 1 0 132 1 1.2 0.7;
> 38 1 13.2 4.9 0 0 1 1 0 132 1 1.2 0.7;
> 39 1 58.8 23.4 0 0 1 1 0 132 1 1.2 0.7;
> 40 1 85.3 34.6 0 40 1 1 0 132 1 1.2 0.7;
> 41 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 42 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 43 1 225 74 0 0 1 1 0 220 1 1.2 0.7;
> 44 1 193.4 58.9 0 0 1 1 0 132 1 1.2 0.7;
> 45 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 46 1 147.3 59.4 0 40 1 1 0 132 1 1.2 0.7;
> 47 1 28.7 10.8 0 10 1 1 0 132 1 1.2 0.7;
> 48 1 61.8 16.4 0 10 1 1 0 132 1 1.2 0.7;
> 49 1 71.3 28.2 0 0 1 1 0 132 1 1.2 0.7;
> 50 1 86.3 35.6 0 0 1 1 0 132 1 1.2 0.7;
> 51 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
> 52 1 101.1 42.3 0 0 1 1 0 132 1 1.2 0.7;
> 53 2 6 2 0 0 1 1.02 0 132 1 1.2 0.7;
> 54 1 47.4 19.4 0 0 1 1 0 132 1 1.2 0.7;
> 55 1 44.6 17.4 0 0 1 1 0 132 1 1.2 0.7;
> 56 1 116.4 46.4 0 0 1 1 0 132 1 1.2 0.7;
> 57 1 50.1 19.7 0 0 1 1 0 132 1 1.2 0.7;
> 58 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 59 1 0 0 0 0 1 1 0 400 1 1.2 0.7;
> 60 1 0 0 0 0 1 1 0 400 1 1.2 0.7;
> 61 2 12 3.9 0 0 1 1.006 0 220 1 1.2 0.7;
> 62 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 63 1 83 33.4 0 0 1 1 0 132 1 1.2 0.7;
> 64 1 78.1 31.4 0 0 1 1 0 132 1 1.2 0.7;
> 65 1 83.2 34.3 0 0 1 1 0 132 1 1.2 0.7;
> 66 2 6 2 0 0 1 1.017 0 132 1 1.2 0.7;
> 67 1 82.5 33.2 0 0 1 1 0 132 1 1.2 0.7;
> 68 1 120.9 52.2 0 0 1 1 0 132 1 1.2 0.7;
> 69 1 80.4 32.2 0 0 1 1 0 132 1 1.2 0.7;
> 70 1 76.8 30.7 0 0 1 1 0 132 1 1.2 0.7;
> 71 1 39.7 15.1 0 40 1 1 0 132 1 1.2 0.7;
> 72 1 8.3 3.5 0 0 1 1 0 132 1 1.2 0.7;
> 73 1 47.3 18.1 0 0 1 1 0 132 1 1.2 0.7;
> 74 1 87.2 36.3 0 0 1 1 0 132 1 1.2 0.7;
> 75 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
> 76 2 0 0 0 0 1 1.004 0 132 1 1.2 0.7;
> 77 1 73.2 28.9 0 40 1 1 0 132 1 1.2 0.7;
> 78 1 0 0 0 0 1 1 0 132 1 1.2 0.7;
> 79 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 80 1 79.8 31.8 0 0 1 1 0 132 1 1.2 0.7;
> 81 1 141.7 58.3 0 40 1 1 0 132 1 1.2 0.7;
> 82 1 98.8 41 0 40 1 1 0 132 1 1.2 0.7;
> 83 1 76.2 30.9 0 0 1 1 0 132 1 1.2 0.7;
> 84 1 35.2 13.2 0 0 1 1 0 132 1 1.2 0.7;
> 85 2 35 11.5 0 0 1 0.991 0 132 1 1.2 0.7;
> 86 2 139.1 54.5 0 0 1 0.991 0 132 1 1.2 0.7;
> 87 1 175.4 75 0 40 1 1 0 132 1 1.2 0.7;
> 88 1 0 0 0 0 1 1 0 220 1 1.2 0.7;
> 89 1 271.2 121.8 0 40 1 1 0 132 1 1.2 0.7;
> ];
>
> %% generator data
> % bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2 Qc1min Qc1max
> Qc2min Qc2max ramp_agc ramp_10 ramp_30 ram