Re: case13659pegase

2019-07-26 Thread Ray Zimmerman
The particular reason a specific numerical algorithm fails for a given problem 
is not always easy to determine.

On this problem, you can try turning on the mips.step_control option. That 
seems to work for me.

Ray


> On Jul 18, 2019, at 10:59 AM, Aamir Nawaz  wrote:
> 
> Dear Researchers,
> 
> I have tried to execute the following and error comes. Can anyone explain why 
> algorithm like PDIPM fails to solve this large system? However, i have solved 
> it using evolutionary algorithm and it is converged. Is there any limit of 
> number of dimensions for PDIPM or others? If no, then suggest me how i can 
> solve it or suggest any other algorithm like SDPOPF etc. I waiting for your 
> kind reply.
> 
> runopf(case13659pegase)
> MATPOWER Version 6.0, 16-Dec-2016 -- AC Optimal Power Flow
> PDIPMOPF Version 4.1, Build 18, 11-Nov-2011
> Copyright (c) 2007-2011 by Power System Engineering Research Center (PSERC)
> 
> >  Did NOT converge (4.42 seconds)  <
> 
> -- 
> 
> Regards,
> Aamir Nawaz.



Re: case13659pegase

2019-07-26 Thread Ray Zimmerman
Sorry, I should have mentioned that the MIPS solver in MATPOWER is essentially 
a Matlab language implementation of the MEX based PDIPM.

Ray


> On Jul 26, 2019, at 4:14 PM, Ray Zimmerman  wrote:
> 
> The particular reason a specific numerical algorithm fails for a given 
> problem is not always easy to determine.
> 
> On this problem, you can try turning on the mips.step_control option. That 
> seems to work for me.
> 
> Ray
> 
> 
>> On Jul 18, 2019, at 10:59 AM, Aamir Nawaz > <mailto:aamirna...@gu.edu.pk>> wrote:
>> 
>> Dear Researchers,
>> 
>> I have tried to execute the following and error comes. Can anyone explain 
>> why algorithm like PDIPM fails to solve this large system? However, i have 
>> solved it using evolutionary algorithm and it is converged. Is there any 
>> limit of number of dimensions for PDIPM or others? If no, then suggest me 
>> how i can solve it or suggest any other algorithm like SDPOPF etc. I waiting 
>> for your kind reply.
>> 
>> runopf(case13659pegase)
>> MATPOWER Version 6.0, 16-Dec-2016 -- AC Optimal Power Flow
>> PDIPMOPF Version 4.1, Build 18, 11-Nov-2011
>> Copyright (c) 2007-2011 by Power System Engineering Research Center (PSERC)
>> 
>> >>>>>  Did NOT converge (4.42 seconds)  <<<<<
>> 
>> -- 
>> 
>> Regards,
>> Aamir Nawaz.
> 



Re: Matpower 7 Installation

2019-08-14 Thread Ray Zimmerman
If you’ve double-checked that you’ve followed the installation instructions 
correctly, and it still isn’t working, please send the output of the following 
commands, including any error messages you see?

mpver
t_have_fcn

— Ray



> On Aug 14, 2019, at 7:38 AM, Yusuf Susilo Wijoyo  wrote:
> 
> Dear all, 
>  
> I am installing Matpower 7 version. Matpower test result shows fail reports 
> as follows:
>  
> t_have_fcn..not ok
> #  Ran 20 of 20 tests: 16 passed, 4 failed
> t_feval_w_path..not ok
> #  Ran 23 of 23 tests: 22 passed, 1 failed
>  
> Could you please help me how to fix it?
>  
> Best Regards,
>  
> Yusuf
>  
> Sent from Mail  for Windows 10



Re: Matpower 7 Installation

2019-08-15 Thread Ray Zimmerman
MATPOWER 7 should work fine with MATLAB R2013b. If it does not, that would be 
considered a bug. So, if you or anyone else can reproduce this problem with 
MATLAB R2013b and MATPOWER 7, please let me know.

   Ray

P.S. It seems there were 2 other issues that were triggering fatal MATLAB 
R2013b bugs during the tests, at least on Mac (see MATPOWER/mips/#1 
<https://github.com/MATPOWER/mips/issues/1> and MATPOWER/matpower/#78 
<https://github.com/MATPOWER/matpower/issues/78>). These are now fixed/avoided.


> On Aug 14, 2019, at 9:46 PM, Yusuf Susilo Wijoyo  wrote:
> 
> I have tried reinstalling matpower again according to the instructions in the 
> manual. But it still raises the same error. This morning I tried upgrading 
> matlab to 2016A version and fortunately, the installation was perfect (the 
> previous matlab version was R2013B). 
> Thank you for your help.
>  
> Best Regards,
>  
> Yusuf
>  
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>  
> From: Ray Zimmerman <mailto:r...@cornell.edu>
> Sent: Wednesday, August 14, 2019 11:39 PM
> To: MATPOWER discussion forum <mailto:matpowe...@list.cornell.edu>
> Subject: Re: Matpower 7 Installation
>  
> If you’ve double-checked that you’ve followed the installation instructions 
> correctly, and it still isn’t working, please send the output of the 
> following commands, including any error messages you see?
>  
> mpver
> t_have_fcn
>  
> — Ray
>  
>  
> 
> 
> On Aug 14, 2019, at 7:38 AM, Yusuf Susilo Wijoyo  <mailto:yusu...@ugm.ac.id>> wrote:
>  
> Dear all, 
>  
> I am installing Matpower 7 version. Matpower test result shows fail reports 
> as follows:
>  
> t_have_fcn..not ok
> #  Ran 20 of 20 tests: 16 passed, 4 failed
> t_feval_w_path..not ok
> #  Ran 23 of 23 tests: 22 passed, 1 failed
>  
> Could you please help me how to fix it?
>  
> Best Regards,
>  
> Yusuf
>  
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



Re: want to calculate expected curtailed load

2019-08-29 Thread Ray Zimmerman
I’m afraid this is more of a research question than a MATPOWER usage question 
so, unfortunately, it falls outside the scope of this forum (unless someone 
else here has ideas). Maybe ask on Power-Globe 
?

Ray


> On Aug 28, 2019, at 10:37 PM, Aamir Nawaz  wrote:
> 
> Dear Dr. Ray,
> I want to calculated expected curtailed load in case of N-2 or N-k 
> contingency. Is there any way i can utilize PTDF and LODF to acheive some 
> precise results? As it will take too much time to perform PF or OPF to find 
> out expected curtailed load. I am looking towards some fast way in matpower 
> to solve this problem. I am looking forward to hearing from you.
> 
> 
> Regards,
> Aamir Nawaz



Re: Jacobian calculation in mips.m & query regarding finding Lx from L

2019-08-30 Thread Ray Zimmerman
The mips() function requires that you pass in function handles for functions 
that evaluate the objective and it’s gradient (f_fcn), and the constraints and 
their gradients (gh_fcn) or Jacobian, and Hessian (hess_fcn). So, mips itself 
does not compute these quantities (e.g. via finite differences), but it uses 
the functions it is provided.

Regarding the transpose matrices, I’m not sure where you are referring to 
(maybe provide a specific file and line number), but MIPS was designed to be as 
compatible as possible with the way derivative and Hessian functions were 
defined for fmincon (part of MATLAB’s Optimization Toolbox) and I believe that 
required a transpose somewhere.

Best,

  Ray




> On Aug 29, 2019, at 4:55 PM, Jubeyer Rahman  wrote:
> 
> Hi,
> Is there any Jacobian calculation taking place in mips.m?  If not, what 
> function can I use to calculate the Jacobian matrix inside the mips where Lxx 
> is calculated (hessian)?
> 
> Another question is, while taking the derivative to produce Lx from L ; why 
> the transpose matrices become regular, say for example, lam' becomes lam, 
> etc.?
> 
> -Jubeyer
> 



Re: Jacobian calculation in mips.m & query regarding finding Lx from L

2019-09-09 Thread Ray Zimmerman
Ok, for example, here g and lam are both column vectors and dg (for 
compatibility with fmincon) is a matrix whose columns correspond to the rows of 
g.

   Ray

> On Aug 30, 2019, at 11:17 AM, Jubeyer Rahman  wrote:
> 
> Well I am referring to line 390 and 392 in mips.m.
> 
> Regards,
> Jubeyer
> 
> On Fri, Aug 30, 2019 at 10:58 AM Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> The mips() function requires that you pass in function handles for functions 
> that evaluate the objective and it’s gradient (f_fcn), and the constraints 
> and their gradients (gh_fcn) or Jacobian, and Hessian (hess_fcn). So, mips 
> itself does not compute these quantities (e.g. via finite differences), but 
> it uses the functions it is provided.
> 
> Regarding the transpose matrices, I’m not sure where you are referring to 
> (maybe provide a specific file and line number), but MIPS was designed to be 
> as compatible as possible with the way derivative and Hessian functions were 
> defined for fmincon (part of MATLAB’s Optimization Toolbox) and I believe 
> that required a transpose somewhere.
> 
> Best,
> 
>   Ray
> 
> 
> 
> 
>> On Aug 29, 2019, at 4:55 PM, Jubeyer Rahman > <mailto:jube...@hawaii.edu>> wrote:
>> 
>> Hi,
>> Is there any Jacobian calculation taking place in mips.m?  If not, what 
>> function can I use to calculate the Jacobian matrix inside the mips where 
>> Lxx is calculated (hessian)?
>> 
>> Another question is, while taking the derivative to produce Lx from L ; why 
>> the transpose matrices become regular, say for example, lam' becomes lam, 
>> etc.?
>> 
>> -Jubeyer
>> 
> 



Re: Jacobian calculation in mips.m & query regarding finding Lx from L

2019-09-09 Thread Ray Zimmerman
If I understand the definitions, the Jacobian is the transpose of the set of 
gradients of the constraints, where a gradient is a column vector. That is the 
rows of the Jacobian correspond to the constraints and the columns to the 
variables. In that case, if dh and dg are appended (side-by-side) you get the 
transpose of the Jacobian.

   Ray

> On Aug 30, 2019, at 11:23 AM, Jubeyer Rahman  wrote:
> 
> And I assume that you mean here the gradient and jacobians are the same 
> though in theory gradients are subsets of jacobian. I think if I append the 
> dh and dg (measured in line 356 and 357 for nonlinear case); I will get the 
> Jacobian matrix.
> 
> On Fri, Aug 30, 2019 at 11:17 AM Jubeyer Rahman  <mailto:jube...@hawaii.edu>> wrote:
> Well I am referring to line 390 and 392 in mips.m.
> 
> Regards,
> Jubeyer
> 
> On Fri, Aug 30, 2019 at 10:58 AM Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> The mips() function requires that you pass in function handles for functions 
> that evaluate the objective and it’s gradient (f_fcn), and the constraints 
> and their gradients (gh_fcn) or Jacobian, and Hessian (hess_fcn). So, mips 
> itself does not compute these quantities (e.g. via finite differences), but 
> it uses the functions it is provided.
> 
> Regarding the transpose matrices, I’m not sure where you are referring to 
> (maybe provide a specific file and line number), but MIPS was designed to be 
> as compatible as possible with the way derivative and Hessian functions were 
> defined for fmincon (part of MATLAB’s Optimization Toolbox) and I believe 
> that required a transpose somewhere.
> 
> Best,
> 
>   Ray
> 
> 
> 
> 
>> On Aug 29, 2019, at 4:55 PM, Jubeyer Rahman > <mailto:jube...@hawaii.edu>> wrote:
>> 
>> Hi,
>> Is there any Jacobian calculation taking place in mips.m?  If not, what 
>> function can I use to calculate the Jacobian matrix inside the mips where 
>> Lxx is calculated (hessian)?
>> 
>> Another question is, while taking the derivative to produce Lx from L ; why 
>> the transpose matrices become regular, say for example, lam' becomes lam, 
>> etc.?
>> 
>> -Jubeyer
>> 
> 



Re: Query regarding the documentation on mips.m

2019-09-16 Thread Ray Zimmerman
Hi Jubeyer,

I think that’s the extent of the documentation available for MIPS. The lines 
you mention are related to the step length controlled version of the algorithm, 
referred to as SCIPM in the paper and described in Fig. 5. The purpose is 
simply to shorten the step length when quadratic approximation used by the 
Newton step is found be inaccurate.

   Ray




> On Sep 12, 2019, at 10:15 AM, Jubeyer Rahman  wrote:
> 
> Hi,
> I was wondering whether there exists any detailed documentation on the mips.m 
> code other than the PhD thesis and paper by H. Wang and the Matpower manual's 
> mips solver section? 
> 
> If not, it will be great if someone can clarify the following question:
> 
> 
> a. [line 554-557], why alpha is getting multiplied with the newton directions 
> (dx, dz , dlam etc.)?
> 
> Regards,
> Jubeyer
> 
> 



Re: the previous iteration that was overwritten

2019-09-18 Thread Ray Zimmerman
Use the printpf() <https://matpower.org/docs/ref/matpower7.0/lib/printpf.html> 
function to print the results of a previously run solution that you’ve saved in 
a results struct. For example …

results = runpf('case118');
.
.
.
printpf(results);

Hope this helps,

Ray


> On Sep 18, 2019, at 5:50 AM, Sabhan Kanata  wrote:
> 
> 
> Dear Prof Ray Zimmerman,
> 
> 
> How to display the entire matpower power flow in the matlab command from the 
> previous iteration that was overwritten?
> 
> Thanks
> 
> Regards
> Sabhan K



Re: the previous iteration that was overwritten

2019-09-19 Thread Ray Zimmerman
You can always use the diary command to save all of the output of a MATLAB 
session to a file. It sounds like that may be what you’re looking for.

You could also keep a copy of the results struct for the best solution so far, 
replacing it each time you find an improved solution. Then at the end, use 
printpf() to re-print the output of the best solution.

   Ray


> On Sep 18, 2019, at 10:11 PM, Sabhan Kanata  wrote:
> 
> Dear Prof Ray Zimmerman,
> 
> I did the optimization process using metaheuristics with the calculation of 
> power flow using matpower. When I use the number of iterations above 5, the 
> runpf output value is overwritten in the windows command. As a result, the 
> power flow that shows the minimum PLOSS and VD optimization results is erased 
> from history. How to withdraw all previous power flow.
> 
> Ex:  PLOSS and voltage deviation (VD) with the minimum value, namely = 
> 120.5285 MW and 0,18971. 
> 
> PLOSS #1:
>   Min = 120.5285
>   Max = 170.736
> Range = 50.2075
> St.D. = 22.1753
>  Mean = 131.1021
>  
> VD #2:
>   Min = 0.18971
>   Max = 0.38363
> Range = 0.19392
> St.D. = 0.091242
>  Mean = 0.30149
> 
> 
> Example of a matpower command output that does not bring up the minimum PLOSS 
> and VD values because it is overwritten from the previous iteration output
> 
> Newton's method power flow converged in 4 iterations.
> 
> Converged in 0.01 seconds
> 
> | Bus Data
>  |
> 
>  Bus  Voltage  Generation Load
>   #   Mag(pu) Ang(deg)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
> - ---         
> 1  1.0111.164   2411.84   7434.88148.43 29.76 
> 2  1.0090.848   - -  295.80225.46 
> 3  0.996   -3.946   - -  449.98-43.59 
> 4  0.996   -3.501   - -  865.82   -172.55 
> 5  0.998   -3.556   - -  586.13195.76 
> 6  1.013   -4.729   - -  552.61 45.05 
> 7  1.007   -4.707   - -  459.79 78.89 
> 8  1.037   -3.176   1253.00   2431.39   - -   
> 9  1.000   -3.711   - -  709.19422.36 
>10  0.978   -3.237533.00   -212.17626.00290.00 
>11  0.973   -2.941447.00183.51   - -   
>12  0.949   -2.750   - -  660.94268.66 
>13  0.9245.009   - -  300.89218.78 
>14  0.936   10.087   - -  583.82315.34 
>15  0.976   19.288   2432.00802.54497.00165.00 
>16  1.001   15.164   - - 1303.75545.75 
>17  1.007   15.382552.00499.06215.20 23.00 
>18  0.996   -3.473   - -  372.62-73.09 
>19  0.9653.015   - -  301.18 89.10 
>20  0.9256.761   - - 1288.57475.95 
>21  0.978   16.599   - -  544.44199.85 
>22  1.044   24.386   4239.00787.61   1039.30209.00 
>23  1.044   19.334418.00   1345.14576.30338.37 
>24  0.994   -1.529   - -  827.95177.43 
>25  0.981   13.619   - -  220.82110.72 
>26  0.936   -1.164   - -  302.54113.09 
>27  0.9667.614566.00214.87   - -   
>28  0.9667.766565.00 10.46   - -   
>29  0.9616.745   - -  122.80 52.00 
>30  0.9277.002   - - - -   
>31  0.9741.168575.00  -6773.36   - -   
>       
>Total:  13991.84   6723.93  13851.87   4300.09
> 
> 
> | Branch Data 
>  |
> 
> Brnch   From   ToFrom Bus Injection   To Bus Injection Loss (I^2 * Z) 
>  
>   # BusBusP (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q 
> (MVAr)
> -  -  -            
> 
>1  1  2826.93270.06   -826.47   -264.87 0.463  5.18
>2  1 24   1376.53378.49  -1369.20   -308.09 7.327 70.40
>3  1 31

Re: About the branch violation

2019-09-24 Thread Ray Zimmerman
The power flow solver runpf(), by default, simply solves for the flows given 
the specified loads and generator voltage and active power set points. It does 
not alter any set points in an attempt to keep flows, voltages or generator 
reactive powers within feasible limits. There is one exception to this, and 
that is when you set the pf.enforce_q_lims option to 1 or 2, in which case, it 
attempts to respect reactive power limits on generators in exchange for 
relaxing the corresponding voltage set point.

If you need to solve a problem that respects other limits, as it appears you 
do, you’ll want to use runopf() and set up the costs to indicate how you want 
to prioritize changes in the set points.

Hope this helps,

   Ray




> On Sep 24, 2019, at 10:29 AM, 赤心 肖  wrote:
> 
> Sorry, I forgot the benchmark is 'case 30'. Thanks.
> Regards,
> Chixin
> From: bounce-123952714-44420...@list.cornell.edu 
>  on behalf of 
> chixinx...@hotmail.com 
> Sent: 25 September 2019 01:24
> To: matpowe...@list.cornell.edu 
> Subject: About the branch violation
>  
> Dear all,
>I am programming by the use of 'runpf' and to be required not to ignore 
> any limits such as the generator, the branch flow and the voltage.
>Although I have set the 'pf.enforce_q_lims' into 1 or 2, the 'pf.tol' into 
> 10e-20 and the 'pf.nr.max_it' into 40, the branch flow still has violation at 
> branch 10. 
> Can anybody give me some suggestion when you are at convenience? Thanks a 
> lot.
> Regards,
> Chixin



Re: Endogenous contingency reserves and Zonal reserves in UC with MOST

2019-10-15 Thread Ray Zimmerman
See responses below ...

> On Oct 8, 2019, at 1:50 PM, Carlos Ferrandon Cervantes  
> wrote:
> 
> 1. Hello everyone. I am running a UC analysis via MOST. If I'm correct, the 
> values contained in mdo.results.Rpp reflect the contingency upward reserve. 
> Although I am previously specifying these values in the file xgd_res_uc, I 
> dont see any result in mdo.results.Rpp by the end of the simulation, only 
> zero values in that matrix. What would be the cause for this?

Have you defined contingencies for each period? And can you confirm that the 
contingency cases are actually different from the base cases? If not, the 
contingency reserves will be zero.

> 2. I am aware that Zonal reserves work when a previous value of reserve is 
> indicated in mdi.FixedReserves.req. I wonder, where can I see the share of 
> each generator to meet this  requirement? I know that it's not a 
> load-following ramping reserve, and the mdo.results.Rpp is empty as the 
> endogenous contingency reserves case.

The zonal reserve results are reported in …

  mdo.flow(t, 1, 1).mpc.reserves

… in the R field (see Table 7-6 in the MATPOWER User’s Manual 
 for details on the outputs 
in the mpc.reserves struct.

   Ray



Re: Problems with add_vars function

2019-10-15 Thread Ray Zimmerman
Unfortunately, the OPF routines in MATPOWER are not currently designed to 
handle integer variables. The integer variable capability indicated by 
add_vars() was added for MOST, where mixed integer solvers are explicitly 
called when integer variables are present.

If you are using DC OPF only, you may be able to easily modify dcopf_solver() 
to call miqps_matpower() instead of qps_matpower() when the problem has integer 
variables.

I’m afraid for AC OPF there isn’t likely to be an easy workaround. My 
suggestion in that case is to see if you can find a formulation for your 
storage that doesn’t require integer variables. If it is related to avoiding 
simultaneous charge and discharge, you may not even need that constraint. It 
seems to me that simultaneous charge and discharge should never be optimal if 
there are charging/discharging inefficiencies.

Hope this helps,

Ray


> On Oct 9, 2019, at 2:20 PM, Diego Piserà  wrote:
> 
> 
> Dear Dr. Zimmerman, Dear community
>  
> I am working on a multitemporal OPF with storage device using Matpower
>  
> To implement this problem I need to introduce new variables in the OPF 
> formulation.
>  
> Two of these variables are integers, 'alphaCH'and 'alphaDS' .
>  
> using the runopf function the solution converges but unfortunately the 
> variables 'alphaCH' 'alphaDS'are treated as continuous and not integer 
> variables
>  
>  
> Using Matpower 6.0 this is the code by which I add the function during the 
> formulation:
>  
> function om = userfcn_multitemporalOPF_formulation(om, args)
>  
> global LoL LoI no_period no_SD SoCMax SoCmin SoC0;
>  
> define_constants;
> % mpc = get_mpc(om);
> no_SD = 1;
> no_gen = 5;
> no_ts = 24;
>  
> "
OutmailID: 124021150, List: 'matpower-l', MemberID: 82861091
SCRIPT: "ADD Variable >   > om = add_vars(om,'alphaCH', no_SD * no_ts, 0, 
zeros(no_SD * no_ts, 1), ones(no_SD * no_ts, 1), 'I'); > om = 
add_vars(om,'alphaDS', no_SD * no_ts, 0, zeros(no_SD * no_ts, 1), ones(no_SD * 
no_ts, 1), 'I'); >   >"
TCL MERGE ERROR ( 10/15/2019 12:58:37 ): "invalid command name "ADD" ADD 
Constrains
> % contraints on State of Charge
> A = args.Ar;
> l = ones(args.no_period*args.no_SD,1).*(args.SoCmin-args.SoC0)/args.baseMVA;
> u = ones(args.no_period*args.no_SD,1)*(args.SoCMax-args.SoC0)/args.baseMVA;
> om = add_constraints(om, 'SoC', A, l, u,{'Pg'});
>  
> % constraint that avoid charge and discharge at the same time
> om = add_constraints(om, 'Pch_plus_aplha', args.Ar_CH, [], zeros(no_SD * 
> no_ts,1), {'Pg','alphaCH'});
>  
> om = add_constraints(om, 'Pds_plus_aplha', args.Ar_DS, [], zeros(no_SD * 
> no_ts,1), {'Pg','alphaDS'});
>  
> om = add_constraints(om, 'a_a',args.Ar_a_a, zeros(no_SD * no_ts, 1), 
> ones(no_SD * no_ts, 1), {'alphaCH', 'alphaDS'} );
>  
> Who can tell me why matpower doesn't treat the two variables as whole numbers?
>  
> Diego Piserà



Re: Adding new integer constraints to MOST for UC optimisation process

2019-10-17 Thread Ray Zimmerman
Hi Carlos,

MOST does not have a mechanism for adding variables or constraints without 
modifying existing code (like you can with MATPOWER’s OPF), but it should be 
straightforward to add variables and constraints by modifying most.m (or, even 
better, a copy of it). Simply add your own om.add_var(…) and 
om.add_lin_constraint(…) calls at the appropriate places.

If you are including integer variables for non-unit-commitment problems, you 
will also have to modify the logic used to select the mixed integer 
(miqps_matpower) versus continuous (qps_matpower) solver, since it currently 
only calls the mixed integer solver when doing unit commitment.

   Ray


> On Oct 16, 2019, at 9:04 AM, Carlos Ferrandon Cervantes 
>  wrote:
> 
> Hello Doctor:
> 
> I am aware that unit commitment uses MILP techniques to solve the 
> optimisation problem. For frequency stability reasons in the power system, I 
> am in the process of adding new constraints to the problem, but some of them 
> are nonlinear. My approach is using separable programming to linearise them. 
> Basically the solver  will have to deal with new constraints (let's call them 
> λ) that meet SOS2 conditions, i.e., at most two of the variables can be non 
> zero, mapping these r-variables in a sum from the real numbers 0 to 1. Also, 
> another set of binary r-constraints (let's call them y) must be met such as 
> only one of them can be nonzero. (I am adding the picture of the conditions 
> in the email)
> 
> 
> My question more specifically is: Does adding these new constraints to MOST 
> is possible? These constraints will be linked to reserves and the power 
> output of the generators. And they will be different to the already existing 
> binary operators u,v,w.
>  
> As always, thank you very much in advance,
> 
> Carlos Ferrandon
> -- 
> Carlos Ferrandon



Re: Matrix is singular to working precision.

2019-10-21 Thread Ray Zimmerman
It is possible that you have a disconnected network with an island that does 
not have a reference bus, or maybe you have a zero impedance branch. I would 
begin by looking at the output of case_info() for your case to see if you see 
anything unusual.

Ray


> On Oct 20, 2019, at 11:59 PM, Sabhan Kanata  wrote:
> 
> Dear Prof Ray,
> 
> I get a warning when running the power flow as below:
> 
> What do you think is the solution?
> 
> 
> Error using  \
> Matrix is singular to working precision.
> 
> Error in newtonpf (line 100)
>dx = -(J \ F);
> 
> Error in runpf (line 148)
> [V, success, iterations] = newtonpf(Ybus, Sbus, V0, ref, pv, pq, 
> mpopt);
> 
> Regards
> Sabhan K



Re: Matrix is singular to working precision.

2019-10-21 Thread Ray Zimmerman
Did you check the output of case_info() for your case?

   Ray

> On Oct 21, 2019, at 10:04 AM, Sabhan Kanata  wrote:
> 
> Dear Prof Ray,
> 
> Thank you for responding
> My branch data, There are no R and X parameters that are 0.  Where do you 
> think the problem is?
> 
> "
OutmailID: 124038130, List: 'matpower-l', MemberID: 82861091
SCRIPT: "branch data > %fbustbusrxbrateArateB
rateCratioanglestatus > branch = [ > 1 20.62650
0.00070080.000990000001; %Suralaya-Cilegon 
> 1   240.0003677680.00353330.0009900000
01; %Suralaya-Balaraja > 1   310.060000.0005600
0.000990000001; %Suralaya-LBE > 3124
0.721600.00717620.000990000001; 
%LBE-Balaraja > 250.0013133320.01469260.21097009900
00001; %Cilegon-Cibinong > 430.000151318
0.00169820.000990000001; %Gandul-Kembangan 
> 1840.347000.00033340.0009900000   
 01; %Depok-Gandul > 750.0004441880.0042675
0.0009900000   01; %Bekasi-Cibinong > 85
0.0006211600.00596780.0009900000   01; 
%Muaratawar-Cibinong > 1150.0004111380.00459950.2652900
990000001; %Saguling-Cibinong > 67
0.0001973650.00189620.000990000001; 
%Cawang-Bekasi > 860.0005625600.00540480.0009900
00001; %Muaratawar-Cawamg > 890.000282206
0.00271120.000990000001; %Muaratawar-Cibatu 
> 1090.000273900 0.00263240.0009900000  
  01; %Cirata-Cibatu > 11100.000147473 0.00141680.000   
 990000001; %Saguling-Cirata > 1211
0.0001957800.00219020.000990000001; 
%Bandung Selatan-Saguling > 13120.0139819600.1343320
0.1924070990000001; %Mandiracan-Bandung Selatan >   
  13260.0010129000.00973200.13939409900000  
  01; %Mandiracan-Ujung Berung > 26120.0003854000.0037034   
 0.000990000001; %Ujung Berung-Bandung Selatan 
> 30130.000200.00225000.0009900000  
  01; %Pemalang-Mandiracan > 14300.000320.0035300   
 0.000990000001; %Ungaran-Pemalang > 15
140.676600.00757030.436644099000000
1; %Tanjung Djati-Ungaran > 16140.0029792000.0286229
0.4099740990000001; %Surabaya Barat-Ungaran > 
14200.0009036120.00868150.0009900000
01; %Ungaran-Pedan > 16170.000140.00133990.000  
  990000001; %Surabaya Barat-Gresik > 2316
0.0003986380.00445970.000990000001; 
%Grati-Surabaya Barat > 18 50.912000.00087650.000   
 990000001; %Depok-Cibinong > 1918
0.0014030000.01569670.9015550990000001; 
%Tasikmalaya-Depok > 29190.0005446000.00609330.3499780
990000001; %Kesugihan-Tasikmalaya > 2729
0.000110.00126680.000990000001; 
%Adipala-Kesugihan > 28270.381000.00043870.000
990000001; %Cilacap-Adipala > 2029
0.0009839000.01100730.6348830990000001; 
%Pedan-Kesugihan > 21200.0020531000.02296940.3298180
990000001; %Kediri-Pedan > 22210.001026500  
  0.01148470.7239300990000001; %Paiton-Kediri > 
22230.441000.00493430.31103509900000
01; %Paiton-Grati > 24 40.0002979220.0028623
0.000990000001; %Balaraja-Gandul > 2514 
   0.0023479610.02255810.3244670990000001; 
%Ngimbang-Ungaran > 16250.000596665    0.0057324    0.000
990000001; %Surabaya Barat-Ngimbang >  ]; >  >  > 
Regards > Sabhan

Re: Matrix is singular to working precision.

2019-10-23 Thread Ray Zimmerman
Hi Sabhan,

I don’t see anything unusual here. Do you have reasonable bus voltages (e.g. a 
flat start) in your bus matrix? Feel free to send me your case file off-list 
and I’ll have a look.

Ray




> On Oct 21, 2019, at 7:03 PM, Sabhan Kanata  wrote:
> 
> Dear Prof Ray..
> 
> Case_info:
> 
> case_info(mpc)
> Checking connectivity ... single fully connected network
> Elapsed time is 0.107661 seconds.
> 
> Full
>System   
> Number of:   -- 
>   buses31   
>   loads25   
> on 25   
> off -   
> fixed  25   
> dispatchable-   
>   on-   
>   off   -   
>   generators   11   
> on 11   
> off -   
>   shunt elements3   
>   branches 38   
> on 38   
> off -   
> ties (off)  -   
> 
> Load
>   active (MW)   
> dispatched  13851.9 
>   fixed 13851.9 
>   dispatchable  -   
> nominal 13851.9 
>   on13851.9 
>   off   -   
>   fixed 13851.9 
>   dispatchable  -   
> on  -   
> off -   
>   reactive (MVAr)   
> dispatched   4300.1 
>   fixed  4300.1 
>   dispatchable  -   
> nominal  4300.1 
>   on 4300.1 
>   off   -   
>   fixed  4300.1 
>   dispatchable  -   
> on  -   
> off -   
> 
> Generation  
>   active (MW)   
> dispatched  15078.0 
> max capacity18086.0 
>   on18086.0 
>   off   -   
> min capacity 9494.0 
>   on 9494.0 
>   off   -   
>   reactive (MVAr)   
> dispatched   2981.0 
> max capacity 6630.0 
>   on 6630.0 
>   off   -   
> min capacity-3240.0 
>   on-3240.0 
>   off   -   
> 
> Shunt Injections
> active (MW) -   
> reactive (MVAr)  -391.8 
> 
> Branch Losses   
> active (MW) -   
> reactive (MVAr) -   
> 
> DC line 
>   export (MW)   
> dispatch-   
> max capacity-   
>   on-   
>   off   -   
> min capacity-   
>   on-   
>   off   -   
> 
> Reference Buses 
>   num of ref buses  1   
>   ref bus numbers   1   
> 
> Regards
> Sabhan K
> 
> Pada Senin, 21 Oktober 2019 22.35.13 WIB, Sabhan Kanata 
>  menulis:
> 
> 
> Dear Prof Ray..
> 
> How do I check with the case_info command, sir? Please the instructions
> 
> myfiledata : casejawabali.m
> 
> Regards
> Sabhan
> 
> Pada Senin, 21 Oktober 2019 22.23.34 WIB, Ray Zimmerman  
> menulis:
> 
> 
> Did you check the output of case_info() for your case?
> 
>   Ray



Re: Problems with OPF

2019-10-24 Thread Ray Zimmerman
Have you checked the generator limits, e.g. PMIN, PMAX, QMIN, QMAX?

You can use the checklimits() function in extras/misc to check OPF limits for 
you.

Ray


> On Oct 23, 2019, at 12:19 PM, Diego Piserà  wrote:
> 
> Dear Dr. Zimmerman
>  
> I have a problem with the runopf function.
>  
> I have a network with only one generator,
> this models the primary substation.
>  
> %tap change
> tap = 1.1;
> % 
> mpc.bus(1,8) = tap; % VM voltage magnitude
> mpc.gen(1,6) = tap; % VG voltage generator setpoint
> % 
> mpc.bus(1,12) = tap; % VMAX 
> mpc.bus(1,13) = tap; % VMIN
> then I try to run both the runpf and runopf function:
>  
> runpf Converges and gives me a result.
> From these results I can observe that with the assignments made I have no 
> violation of the voltage limits (VMIN & VMAX) or of power passing in the 
> branches (RATEA) imposed in the OPF problem, so I would expect the runopf 
> function to converge.
>  
> Instead the OPF run function does not converge.
>  
> What could it be due to?
>  
> Diego



Re: 24hrs Solar Load Flow Analysis

2019-10-24 Thread Ray Zimmerman
If you are simply running independent power flow simulations sequentially for 
every 5 minutes, you can specify the solar power generators as you would any 
other generator, updating the power output PG for each period and calling 
runpf() in a loop.

Ray



> On Oct 24, 2019, at 1:16 AM, Fatin Anuwar  wrote:
> 
> Dear Ray,
> 
> I want to add solar power generation to the case file. I want to run 24 hour 
> load flow simulation
> including solar which i have solar power generation every 5 mins for 24 hr. 
> How can i add solar input to the case?
> Can i use addwind  file and change to addsolar for runpf or runopf? (since 
> addwind file used for MOST).
> or MATPOWER have other suitable technique?
> Kindly advise me on this matter.
> 
> Thanks



Re: Problems with OPF

2019-10-25 Thread Ray Zimmerman
I suppose it could be a numerical issue, possibly related to the large 
numerical values on variables that are essentially unconstrained. You might try 
Inf and -Inf, which should eliminate those constraints entirely, to see if that 
makes any difference.

You can also just try temporarily setting branch(:, RATE_A) to zero to 
eliminate those constraints to see if it makes a difference numerically.

   Ray


> On Oct 24, 2019, at 11:39 AM, Diego Piserà  wrote:
> 
> Yes, 
> PMIN = -
> PMAX = 
> QMIN = -
> QMAX = 
>  
> These are the constrains that i put in the mpc.
>  
>  
>  
>  
>  
> Diego
>  
> Da: Ray Zimmerman <mailto:r...@cornell.edu>
> Inviato: giovedì 24 ottobre 2019 15:53
> A: MATPOWER discussion forum <mailto:matpowe...@list.cornell.edu>
> Oggetto: Re: Problems with OPF
>  
> Have you checked the generator limits, e.g. PMIN, PMAX, QMIN, QMAX?
>  
> You can use the checklimits() function in extras/misc to check OPF limits for 
> you.
>  
> Ray
>  
> 
> 
> On Oct 23, 2019, at 12:19 PM, Diego Piserà  <mailto:piseradi...@gmail.com>> wrote:
>  
> Dear Dr. Zimmerman
>  
> I have a problem with the runopf function.
>  
> I have a network with only one generator,
> this models the primary substation.
>  
> %tap change
> tap = 1.1;
> % 
> mpc.bus(1,8) = tap; % VM voltage magnitude
> mpc.gen(1,6) = tap; % VG voltage generator setpoint
> % 
> mpc.bus(1,12) = tap; % VMAX 
> mpc.bus(1,13) = tap; % VMIN
> then I try to run both the runpf and runopf function:
>  
> runpf Converges and gives me a result.
> From these results I can observe that with the assignments made I have no 
> violation of the voltage limits (VMIN & VMAX) or of power passing in the 
> branches (RATEA) imposed in the OPF problem, so I would expect the runopf 
> function to converge.
>  
> Instead the OPF run function does not converge.
>  
> What could it be due to?
>  
> Diego



Re: wind integration

2019-10-29 Thread Ray Zimmerman
For a simple power flow or OPF, you can model a wind generator as any other 
generator (specify the output power) or as a negative load. For the OPF, you 
might consider setting the cost to a level below which the wind generation 
would be curtailed.

   Ray


> On Oct 28, 2019, at 2:01 AM, zafar ayub  wrote:
> 
> Hi Matpower,
> hope  u all will be ok and good.
> i want to know, how can i integrate wind power to the existing power system 
> IEEE any standard bus system in matpower.
>thank you very 
> much'
>Zafar Ayub





Re: NREL-118

2019-10-29 Thread Ray Zimmerman
Have you checked directly with the authors of the paper? They may know someone 
who has it in MATPOWER format. If you do find it (or create it yourself), 
please share.

Thanks,

   Ray


> On Oct 28, 2019, at 6:13 AM, Luiz Eduardo Oliveira 
>  wrote:
> 
> Hello everyone,
> I'm trying to find the NREL-118 system on matpower. Do you have this system 
> already implemented? Follows the paper that presents the system: 
> https://ieeexplore.ieee.org/document/7904729/ 
>  
> 
> 
> https://db.bettergrids.org/bettergrids/handle/1001/120 
>   
> 
> If somebody have it, Do you mind to provide it?
> 
> Thanks.
> Best regards.
> -- 
> 
> 
> LUIZ EDUARDO DE OLIVEIRA
> Certified SAP HCM Consultant
> Certification ID: 0011661155
> 
> Currently coursing Ph.D. in University of Porto (DEEC / FEUP)
> M.Sc. in Electrical Power Systems by University of Brasília (UnB)
> B.Sc in Electrical Engineer by Federal University of Juiz de Fora (UFJF)
> CREA – 175407/D-MG 
> Contacts:
> 
> luiz.eduardo@ 
> engenharia.ufjf.br 
> 
> luiz.edua...@fe.up.pt 
> 
> +351 934 637 345
> +55 61 98651-3245
> +55 32 3221-1595
> 
> 
> 



Re: Information request

2019-10-29 Thread Ray Zimmerman
I think you’ve answered your own question. Apparently, plot_mpc() uses the 
mdscale() function from MATLAB’s Statistics Toolbox, and Octave’s statistics 
toolbox has not (yet) implemented that function.

So there are two options …
(1) work on implementing the mdscale() function, or
(2) adapt plot_mpc() to avoid using mdscale().

I’m not familiar enough with either to know which is the simpler approach. As 
you may know, plot_mpc() was developed by Paul Cuffe mailto:paul.cu...@ucd.ie>> . You might try contacting him directly to see if 
he has suggestions about the simplest way to make plot_mpc() usable under 
Octave.

Also, could I ask you to please create a “plot_mpc() is not Octave-compatible” 
issue on the MATPOWER Extras issue tracker 
 and post any updates there?

Thanks,

   Ray



> On Oct 29, 2019, at 3:16 AM, Alberto Geri  wrote:
> 
> Why doesn't 'plot_mpc' work in 'octave'?
> I installed the pkg 'statistics' but the 'mdscale' function has not been 
> implemented yet.
> How can I solve the problem by continuing to work in the 'octave' open source 
> development environment?
> Thank you
> ag 
> 
> 
> -- 
> 



Re: wind integration

2019-11-11 Thread Ray Zimmerman
MATPOWER does not have any implementation of L-index functionality. And your 
other question about modeling wind generation is addressed in my previous 
response below. Feel free to get more specific with your question if there is a 
specific part you don’t understand.

   Ray


> On Nov 10, 2019, at 12:35 AM, zafar ayub  wrote:
> 
> Hi Ray, Hope this mail will find you well. Can we model L-index in Matpower , 
> if yes then plz share the information
> Thank you
>  Ayub
> 
> On Tue, Oct 29, 2019, 8:41 PM Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> For a simple power flow or OPF, you can model a wind generator as any other 
> generator (specify the output power) or as a negative load. For the OPF, you 
> might consider setting the cost to a level below which the wind generation 
> would be curtailed.
> 
>Ray
> 
> 
> > On Oct 28, 2019, at 2:01 AM, zafar ayub  > <mailto:ayubdawar...@gmail.com>> wrote:
> > 
> > Hi Matpower,
> > hope  u all will be ok and good.
> > i want to know, how can i integrate wind power to the existing power system 
> > IEEE any standard bus system in matpower.
> >thank you 
> > very much'
> >Zafar Ayub
> 
> 
> 



Re: Harmonics analysis

2019-11-11 Thread Ray Zimmerman
Unfortunately, MATPOWER does not currently implement harmonic power flow.

Ray


> On Nov 10, 2019, at 8:52 PM, Fatin Anuwar  wrote:
> 
> Dear all,
> 
> Has anyone know how to do harmonic analysis in MATPOWER?
> I'm integrating solar farm and run the power flow. I'm interested to know 
> the harmonics in the system.
> 
> Thanks in advance for any help!
> 
> Fatin Anuwar



Re: About Y-bus values from Matpower and theoretical values. Thanks.

2019-11-12 Thread Ray Zimmerman
Hi Rana,

I’m not following where you are seeing a discrepancy in Ybus when there is a 
shunt admittance. The value of Ybus returned by makeYbus() definitely includes 
the shunt admittances (see line 100 
<https://github.com/MATPOWER/matpower/blob/f3267c88bb974b17566d25a599fcad8e8efda41d/lib/makeYbus.m#L100>)
 Maybe you could provide a short script using case14 (which includes some shunt 
admittances) to show precisely how you are calculating the values that are not 
matching as you expect.

   Ray


> On Nov 11, 2019, at 11:10 PM, Md Masud Rana  
> wrote:
> 
> Dear Dr. Ray,
> 
> Good morning. I found that Y matrix from mathpower and it manual: Y = Cf'*Yf 
> + Ct'*Yt+Ysh  values are not same!
> They are same when their is no no shunt admittance, i.e, Y = Cf'*Yf + Ct'*Yt. 
> Why this happens?
> 
> As a result, the active/reactive  power injection: conj(diag((Y) * v*v')) is 
> different from Cf'*Pf+Ct'*Pt+Ysh (active power for example, Pf and Pt are 
> power flow from and to).  When their is no shunt admittance both are equal  
> but the problem comes when there is shunt admittance. Please help: how can I 
> get theoretical active power injection real(conj(diag((Y) * v*v'))) is equal 
> to calculated Cf'*Pf+Ct'*Pt+Ysh values when there is shunt admittance? 
> Thanks.  
> 
> Regards,
> Rana
> 
> From: Md Masud Rana
> Sent: Tuesday, 12 November 2019 4:06 PM
> To: matpower-l@cornell.edu <mailto:matpower-l@cornell.edu> 
> mailto:matpower-l@cornell.edu>>; Ray Zimmerman 
> mailto:r...@cornell.edu>>
> Subject: About Y-bus values from Matpower and theoretical values. Thanks. 
>  
> Dear Dr. Ray,
> 
> Good morning. I found that Y matrix from mathpower and it manual: Y = Cf'*Yf 
> + Ct'*Yt+Ysh  values are not same!
> They are same when their is no no shunt admittance, i.e, Y = Cf'*Yf + Ct'*Yt. 
> Why this happens?
> 
> As a result, the active/reactive  power injection: conj(diag((Y) * v*v')) is 
> different from Cf'*Pf+Ct'*Pt+Ysh (active power for example, Pf and Pt are 
> power flow from and to).  When their is no shunt admittance both are equal  
> but the problem comes when there is shunt admittance. Please help: how can I 
> get theoretical active power injection real(conj(diag((Y) * v*v'))) is equal 
> to calculated Cf'*Pf+Ct'*Pt+Ysh values when there is shunt admittance? 
> Thanks.  
> 
> Regards,
> Rana



Re: wind integration

2019-11-12 Thread Ray Zimmerman
1) Assuming you want to run a power flow, you simply set the PG column in the 
gen matrix to the output of the wind generator at the moment you are 
simulating. If you want to solve for different wind conditions and output 
levels, each will be a separate power flow run with a different value of PG in 
the gen matrix..

2) Yes. But the “how" depends on the system and range of operating conditions, 
etc.

Ray


> On Nov 12, 2019, at 1:39 AM, zafar ayub  wrote:
> 
> Hi , 
> Fist i would like to thank you for ur time guiding. May question is that 
> 1) how can we define the generator used in wind farm are constant or variable 
> speed generator.
> 2) the location of wind integratio effets the voltages stability and how???
>
>   zafar Ayb
> 
> On Tue, Nov 12, 2019, 2:31 AM Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> MATPOWER does not have any implementation of L-index functionality. And your 
> other question about modeling wind generation is addressed in my previous 
> response below. Feel free to get more specific with your question if there is 
> a specific part you don’t understand.
> 
>Ray
> 
> 
>> On Nov 10, 2019, at 12:35 AM, zafar ayub > <mailto:ayubdawar...@gmail.com>> wrote:
>> 
>> Hi Ray, Hope this mail will find you well. Can we model L-index in Matpower 
>> , if yes then plz share the information
>> Thank you
>>  Ayub
>> 
>> On Tue, Oct 29, 2019, 8:41 PM Ray Zimmerman > <mailto:r...@cornell.edu>> wrote:
>> For a simple power flow or OPF, you can model a wind generator as any other 
>> generator (specify the output power) or as a negative load. For the OPF, you 
>> might consider setting the cost to a level below which the wind generation 
>> would be curtailed.
>> 
>>Ray
>> 
>> 
>> > On Oct 28, 2019, at 2:01 AM, zafar ayub > > <mailto:ayubdawar...@gmail.com>> wrote:
>> > 
>> > Hi Matpower,
>> > hope  u all will be ok and good.
>> > i want to know, how can i integrate wind power to the existing power 
>> > system IEEE any standard bus system in matpower.
>> >thank you 
>> > very much'
>> >Zafar Ayub
>> 
>> 
>> 
> 



Re: Setting OPF starting point

2019-11-15 Thread Ray Zimmerman
See the opf.start option, described in the help for mpoption and in Table C-5 
in the MATPOWER User’s Manual 
.

   Ray



> On Nov 12, 2019, at 10:48 AM, Jubeyer Rahman  wrote:
> 
> Hi,
> Is there any simple way to  make MATPOWER start OPF solution process with my 
> point of choice (starting values for the optimization variables)?
> 
> Regards,
> Jubeyer
> 



Re: Static Var Compensation

2019-11-15 Thread Ray Zimmerman
You can either use the QD column of the bus matrix and treat it as a negative 
reactive load, or you can treat it as a generator with Pmin = Pmax  = 0 and 
Qmin = Qmax =  5 MVAr.

   Ray


> On Nov 13, 2019, at 9:33 AM, Kate Augusto  wrote:
> 
> Hi. I hope you guys are doing well. I would just like to ask how do I inject 
> a +5Mvar in the optimal power flow of a system.
> 
> Best regards! 



Re: Number of buses

2019-11-26 Thread Ray Zimmerman
There is no explicit limit to the size. Power flow for a 582 bus case should be 
extremely fast, only a fraction of a second. On my 5 yr old laptop a 13,000 bus 
system solves in ~0.3 sec.

Ray

> On Nov 24, 2019, at 3:12 PM, Winnie apiyo  wrote:
> 
> Thank you 
> 
> Sent from my iPhone
> 
>> On 24 Nov 2019, at 21:54, Abhay Kumar  wrote:
>> 
>> A list of test cases are available in Appendix D (Table D-18 to Table D-23) 
>> of the MATPOWER user manual   
>> I’m not sure if there is a limit but MATPOWER can definitely handle 582 
>> buses. 
>> 
>> 
>> 
>> 
>>  
>> Abhay Kumar
>> Graduate Teaching Assistant | Michigan Tech | Dept of ECE
>> E:  abh...@mtu.edu 
>> A: EERC 617, 1400 Townsend Dr Houghton MI 49931
>> 
>>> On Nov 24, 2019, at 1:33 PM, Winnie apiyo >> > wrote:
>>> 
>>> good evening,
>>> What is the maximum number of buses that can be run in MATPOWER.? I have 
>>> 582 buses and can't run power flow or it is just taking long to run
>>> regards
>> 



Re: how the syntax of using specified bus is in the function add_quad_cost ?

2019-11-26 Thread Ray Zimmerman
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  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, {'X'});
> 
> the item 'X' is to represent the voltage magnitude of the 5th node.
> 
> How the syntax is in the item 'X'? 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
> 
> 
> 
>  



Re: Number of buses

2019-11-26 Thread Ray Zimmerman
You’ll have to show us exactly what commands you are using to attempt to run 
it. It sounds like you may be calling runpf(mpc) without first loading the case 
into mpc. Normally, you’d do something like …

mpc = loadcase('case118');
results = runpf(mpc);

… or simply …

results = runpf('case118');

Hope this helps,

   Ray


> On Nov 26, 2019, at 12:18 PM, Winnie apiyo  wrote:
> 
> It is only running with no results. mpc empty , undefined function or 
> variable mpc.  I have been troubleshooting with no results. What are the 
> possible mistakes?
> 
> Sent from my iPhone
> 
>> On 26 Nov 2019, at 20:26, Ray Zimmerman  wrote:
>> 
>> There is no explicit limit to the size. Power flow for a 582 bus case 
>> should be extremely fast, only a fraction of a second. On my 5 yr old laptop 
>> a 13,000 bus system solves in ~0.3 sec.
>> 
>> Ray
>> 
>>> On Nov 24, 2019, at 3:12 PM, Winnie apiyo >> <mailto:winnieapiy...@gmail.com>> wrote:
>>> 
>>> Thank you 
>>> 
>>> Sent from my iPhone
>>> 
>>>> On 24 Nov 2019, at 21:54, Abhay Kumar >>> <mailto:abh...@mtu.edu>> wrote:
>>>> 
>>>> A list of test cases are available in Appendix D (Table D-18 to Table 
>>>> D-23) of the MATPOWER user manual 
>>>> <https://matpower.org/docs/MATPOWER-manual.pdf>  I’m not sure if there is 
>>>> a limit but MATPOWER can definitely handle 582 buses. 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>
>>>> Abhay Kumar
>>>> Graduate Teaching Assistant | Michigan Tech | Dept of ECE
>>>> E:  abh...@mtu.edu <mailto:abh...@mtu.edu>
>>>> A: EERC 617, 1400 Townsend Dr Houghton MI 49931
>>>> 
>>>>> On Nov 24, 2019, at 1:33 PM, Winnie apiyo >>>> <mailto:winnieapiy...@gmail.com>> wrote:
>>>>> 
>>>>> good evening,
>>>>> What is the maximum number of buses that can be run in MATPOWER.? I have 
>>>>> 582 buses and can't run power flow or it is just taking long to run
>>>>> regards
>>>> 
>> 



Re: Number of buses

2019-11-27 Thread Ray Zimmerman
Do you have some bus numbers (either in the bus or branch matrix) that are not 
positive integers?

   Ray


> On Nov 27, 2019, at 6:14 AM, Winnie apiyo  wrote:
> 
> Good evening Ray,
> It is now running but with this error:
> Array indices must be positive integers or logical values.
> 
> Error in ext2int (line 148)
> bs(n2i(mpc.branch(:, F_BUS))) & ...
> 
> Error in runpf (line 109)
> mpc = ext2int(mpc);
> 
> On Tue, Nov 26, 2019 at 10:58 PM Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> You’ll have to show us exactly what commands you are using to attempt to run 
> it. It sounds like you may be calling runpf(mpc) without first loading the 
> case into mpc. Normally, you’d do something like …
> 
> mpc = loadcase('case118');
> results = runpf(mpc);
> 
> … or simply …
> 
> results = runpf('case118');
> 
> Hope this helps,
> 
>Ray
> 
> 
>> On Nov 26, 2019, at 12:18 PM, Winnie apiyo > <mailto:winnieapiy...@gmail.com>> wrote:
>> 
>> It is only running with no results. mpc empty , undefined function or 
>> variable mpc.  I have been troubleshooting with no results. What are the 
>> possible mistakes?
>> 
>> Sent from my iPhone
>> 
>>> On 26 Nov 2019, at 20:26, Ray Zimmerman >> <mailto:r...@cornell.edu>> wrote:
>>> 
>>> There is no explicit limit to the size. Power flow for a 582 bus case 
>>> should be extremely fast, only a fraction of a second. On my 5 yr old 
>>> laptop a 13,000 bus system solves in ~0.3 sec.
>>> 
>>> Ray
>>> 
>>>> On Nov 24, 2019, at 3:12 PM, Winnie apiyo >>> <mailto:winnieapiy...@gmail.com>> wrote:
>>>> 
>>>> Thank you 
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>>> On 24 Nov 2019, at 21:54, Abhay Kumar >>>> <mailto:abh...@mtu.edu>> wrote:
>>>>> 
>>>>> A list of test cases are available in Appendix D (Table D-18 to Table 
>>>>> D-23) of the MATPOWER user manual 
>>>>> <https://matpower.org/docs/MATPOWER-manual.pdf>  I’m not sure if there is 
>>>>> a limit but MATPOWER can definitely handle 582 buses. 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>   
>>>>> Abhay Kumar
>>>>> Graduate Teaching Assistant | Michigan Tech | Dept of ECE
>>>>> E:  abh...@mtu.edu <mailto:abh...@mtu.edu>
>>>>> A: EERC 617, 1400 Townsend Dr Houghton MI 49931
>>>>> 
>>>>>> On Nov 24, 2019, at 1:33 PM, Winnie apiyo >>>>> <mailto:winnieapiy...@gmail.com>> wrote:
>>>>>> 
>>>>>> good evening,
>>>>>> What is the maximum number of buses that can be run in MATPOWER.? I have 
>>>>>> 582 buses and can't run power flow or it is just taking long to run
>>>>>> regards
>>>>> 
>>> 
> 



Re: Number of buses

2019-12-02 Thread Ray Zimmerman
MATPOWER does not handle 3 winding transformers directly, so you would have to 
convert it to an equivalent star formation of 2 winding transformers. The 
psse2mpc() function can convert a 3-winding transformers in PSS/E RAW format 
into the equivalent for MATPOWER, in case that would be useful.

Ray


> On Nov 27, 2019, at 12:24 PM, Winnie apiyo  wrote:
> 
> Ray,
> Bus 92 was missing. I have f 400 kV , 220 kV, 132 kv , 66 kV,  33 kV and  
> 11kV voltage levels. How do you model three winding transformers?
> 
> i have the following error after running pf
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> Warning: Matrix is singular to working precision. 
> > In newtonpf (line 89)
>   In runpf (line 204)
>  
> 
> Newton's method power flow did not converge in 10 iterations.
> 
> >>>>>  Did NOT converge (0.17 seconds)  <<<<<
> 
> On Wed, Nov 27, 2019 at 7:13 PM Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> Do you have some bus numbers (either in the bus or branch matrix) that are 
> not positive integers?
> 
>Ray
> 
> 
>> On Nov 27, 2019, at 6:14 AM, Winnie apiyo > <mailto:winnieapiy...@gmail.com>> wrote:
>> 
>> Good evening Ray,
>> It is now running but with this error:
>> Array indices must be positive integers or logical values.
>> 
>> Error in ext2int (line 148)
>> bs(n2i(mpc.branch(:, F_BUS))) & ...
>> 
>> Error in runpf (line 109)
>> mpc = ext2int(mpc);
>> 
>> On Tue, Nov 26, 2019 at 10:58 PM Ray Zimmerman > <mailto:r...@cornell.edu>> wrote:
>> You’ll have to show us exactly what commands you are using to attempt to run 
>> it. It sounds like you may be calling runpf(mpc) without first loading the 
>> case into mpc. Normally, you’d do something like …
>> 
>> mpc = loadcase('case118');
>> results = runpf(mpc);
>> 
>> … or simply …
>> 
>> results = runpf('case118');
>> 
>> Hope this helps,
>> 
>>Ray
>> 
>> 
>>> On Nov 26, 2019, at 12:18 PM, Winnie apiyo >> <mailto:winnieapiy...@gmail.com>> wrote:
>>> 
>>> It is only running with no results. mpc empty , undefined function or 
>>> variable mpc.  I have been troubleshooting with no results. What are the 
>>> possible mistakes?
>>> 
>>> Sent from my iPhone
>>> 
>>>> On 26 Nov 2019, at 20:26, Ray Zimmerman >>> <mailto:r...@cornell.edu>> wrote:
>>>> 
>>>> There is no explicit limit to the size. Power flow for a 582 bus case 
>>>> should be extremely fast, only a fraction of a second. On my 5 yr old 
>>>> laptop a 13,000 bus system solves in ~0.3 sec.
>>>> 
>>>> Ray
>>>> 
>>>>> On Nov 24, 2019, at 3:12 PM, Winnie apiyo >>>> <mailto:winnieapiy...@gmail.com>> wrote:
>>>>> 
>>>>> Thank you 
>>>>> 
>>>>> Sent from my iPhone
>>>>> 
>>>>>> On 24 Nov 2019, at 21:54, Abhay Kumar >>>>> <mailto:abh...@mtu.edu>> wrote:
>>>>>> 
>>>>>> A list of test cases are available in Appendix D (Table D-18 to Table 
>>>>>> D-23) of the MATPOWER user manual 
>>>>>> <https://matpower.org/docs/MATPOWER-manual.pdf>  I’m not sure if there 
>>>>>> is a limit but MATPOWER can definitely handle 582 buses. 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>  
>>>>>> Abhay Kumar
>>>>>> Graduate Teaching Assistant | Michigan Tech | Dept of ECE
>>>>>> E:  abh...@mtu.edu <mailto:abh...@mtu.edu>
>>>>>> A: EERC 617, 1400 Townsend Dr Houghton MI 49931
>>>>>> 
>>>>>>> On Nov 24, 2019, at 1:33 PM, Winnie apiyo >>>>>> <mailto:winnieapiy...@gmail.com>> wrote:
>>>>>>> 
>>>>>>> good evening,
>>>>>>> What is the maximum number of buses that can be run in MATPOWER.? I 
>>>>>>> have 582 buses and can't run power flow or it is just taking long to run
>>>>>>> regards
>>>>>> 
>>>> 
>> 
> 



documentation for older PSS/E RAW versions

2014-07-29 Thread Ray Zimmerman
Dear MATPOWER users,

Does anyone know where I can find documentation for older (pre-v29) versions of 
the PSS/E RAW data format?

Full documentation for multiple versions would be ideal, but even if someone 
can answer the following simple questions for me it would be a big help.

In which versions were the following first introduced?
- separate Load Data section?
- separate Transformer Data section?
- Transformer Impedance Correction section?

And does anyone know what version this file 
(http://www.ee.washington.edu/research/pstca/formats/pti.txt) refers to?

Thanks in advance for any pointers,

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645



Re: documentation for older PSS/E RAW versions

2014-07-29 Thread Ray Zimmerman
Thanks.

Also, please note, in case there was any question, I am *not* asking for anyone 
to send me anything that would violate any license agreements or copyrights. 
This was a request for pointers to legitimate sources of the information.

I do have what I was able to get from directly Siemens. Just trying to figure 
out the details of some older, unversioned data files I have.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


On Jul 29, 2014, at 10:18 AM, Jovan Ilic  wrote:

> 
> Ray,
> 
> (http://www.ee.washington.edu/research/pstca/formats/pti.tx)  refers to 
> version 23
> The documentation is not complete and sufficiently detailed. 
>  
> You can always "reverse engineer" the data format by using PSSE to save a 
> case 
> raw data file in different formats.  I think that the student version allows 
> you to do that. 
> Figuring out what is what could be a bit messy due to introduction of new 
> devices 
> and models over time.  Note that there are other files besides raw.  Also, 
> the pre v29 
> versions used comma and/or space as delimiters and single quotes to enclose 
> textual fields which could have spaces.  You'll need a pretty good parser 
> (perl or awk 
> maybe) to get it right. Or, you can do it in Fortran in a few lines. Somehow, 
> it is trivial 
> in Fortran, you do not even need a parser. :-)
> 
> I don't know about Siemens but PTI used to be very picky about using their 
> data format. 
> About 15 years ago I contacted them with a similar question and the answer 
> was "sure 
> we can send you the documentation but it will cost you a few $K".  You can 
> find the docs
> for the newer formats, post 30, on Siemens' web site.  
> 
> Jovan Ilic
> 
> 
> 
> --
> Not everything that can be counted counts 
> and not everything that counts can be counted.
> --AE
> 
> 
> On Tue, Jul 29, 2014 at 9:45 AM, Ray Zimmerman  wrote:
> Dear MATPOWER users,
> 
> Does anyone know where I can find documentation for older (pre-v29) versions 
> of the PSS/E RAW data format?
> 
> Full documentation for multiple versions would be ideal, but even if someone 
> can answer the following simple questions for me it would be a big help.
> 
> In which versions were the following first introduced?
>   - separate Load Data section?
>   - separate Transformer Data section?
>   - Transformer Impedance Correction section?
> 
> And does anyone know what version this file 
> (http://www.ee.washington.edu/research/pstca/formats/pti.txt) refers to?
> 
> Thanks in advance for any pointers,
> 
> -- 
> Ray Zimmerman
> Senior Research Associate
> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
> phone: (607) 255-9645
> 
> 



Re: Basic Inquiry about Fixed Zonal Reserves extension of OPF

2014-07-29 Thread Ray Zimmerman
I’m not sure why, but it appears that the OPF is probably not converging 
successfully. Did you check results.success to see that it converged? I am not 
able to reproduce your result. When I execute the 3 lines of code you have 
below, I get:


| Reserves |

 Gen   Bus   Status  Reserves   Price
  # #  (MW) ($/MW) Included in Zones ...
  -  --       
  1  1  1  25.00  2.00 1
  2  2  1  15.00  2.00 1
  3 22  1   0.00  2.00 1
  4 27  1   0.00  2.00 1
  5 23  1  19.39  5.50 1, 2
  6 13  1   0.61  5.50 1, 2
 
Total: 60.00  Total Cost: $177.81

Zone  Reserves   Price  
  # (MW) ($/MW) 
    
  1 60.00  2.00
  2 20.00  3.50


| Reserve Limits   |

 Gen   Bus   Status  Rmin mu RminReservesRmaxRmax mu   Pmax mu 
  # # ($/MW) (MW)  (MW)  (MW) ($/MW)($/MW) 
  -  --            
  1  1  1-0.00 25.00 25.00  0.10  0.00
  2  2  1-0.00 15.00 25.00   -0.00
  3 22  1   1.00  0.00  0.00 25.00   - -  
  4 27  1   2.00  0.00  0.00 25.00   -0.00
  5 23  1-0.00 19.39 25.00  0.00  0.50
  6 13  1   0.00  0.00  0.61 25.00   - -  
 
Total: 60.00

… which looks like a correct result.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


On Jul 29, 2014, at 10:05 AM, Sohail Khan  wrote:

> Dear all,
> 
> I have two questions:
> 
> Question 1
> While running the OPF extension of the fixed zonal reserves extension of OPF 
> in the default settings that is simulating following code
> 
> mpc = loadcase('t_case30_userfcns');
> mpc = toggle_reserves(mpc, 'on');
> results = runopf(mpc);
> 
> leading to the result:
> Zone  Reserves   Price  
>   # (MW) ($/MW) 
>     
>   1 49.7353975328242405556000.00
>   2 16.58 36.71
> 
> But the zonal requirement is:
> %% reserve requirements for each zone in MW
> mpc.reserves.req   = [60; 20];
> 
> Then according to equation 6.5 of the manual the additional constraint 'Rreq' 
> should be satisfied but it is not as shown above. Even while decrease the 
> zone requirements to  
> mpc.reserves.req   = [10; 10]; the result does not satisfy the constraint
> 
> Zone  Reserves   Price  
>   # (MW) ($/MW) 
>     
>   1 19.12 13.25
>   2  7.84296055709475616220.00
> 
> Why is it so?
> 
> Question 2
> My second question is that while the reserve cost is different for different 
> generators
> mpc.reserves.cost  = [1.9;2;3;4;5;5.5];
> 
> the reserve distribution among generators doesn't reflect the difference in 
> the amount of reserve power assigned such that reserves allocated per 
> generator 8.29 MW.
> 
> Why is it the same?
> 
> Please guide me.
> 
> Thank you!
> Sohail Khan



Re: documentation for older PSS/E RAW versions

2014-07-29 Thread Ray Zimmerman
Oops, I didn’t mean to make it sound like Jovan was suggesting anything that 
would violate license agreements or copyrights. He wasn’t.
That was just a general clarifying comment for all, since someone else brought 
that issue to my attention, and was not directed toward Jovan.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


On Jul 29, 2014, at 11:21 AM, Ray Zimmerman  wrote:

> Thanks.
> 
> Also, please note, in case there was any question, I am *not* asking for 
> anyone to send me anything that would violate any license agreements or 
> copyrights. This was a request for pointers to legitimate sources of the 
> information.
> 
> I do have what I was able to get from directly Siemens. Just trying to figure 
> out the details of some older, unversioned data files I have.
> 
> -- 
> Ray Zimmerman
> Senior Research Associate
> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
> phone: (607) 255-9645
> 
> 
> On Jul 29, 2014, at 10:18 AM, Jovan Ilic  wrote:
> 
>> 
>> Ray,
>> 
>> (http://www.ee.washington.edu/research/pstca/formats/pti.tx)  refers to 
>> version 23
>> The documentation is not complete and sufficiently detailed. 
>>  
>> You can always "reverse engineer" the data format by using PSSE to save a 
>> case 
>> raw data file in different formats.  I think that the student version allows 
>> you to do that. 
>> Figuring out what is what could be a bit messy due to introduction of new 
>> devices 
>> and models over time.  Note that there are other files besides raw.  Also, 
>> the pre v29 
>> versions used comma and/or space as delimiters and single quotes to enclose 
>> textual fields which could have spaces.  You'll need a pretty good parser 
>> (perl or awk 
>> maybe) to get it right. Or, you can do it in Fortran in a few lines. 
>> Somehow, it is trivial 
>> in Fortran, you do not even need a parser. :-)
>> 
>> I don't know about Siemens but PTI used to be very picky about using their 
>> data format. 
>> About 15 years ago I contacted them with a similar question and the answer 
>> was "sure 
>> we can send you the documentation but it will cost you a few $K".  You can 
>> find the docs
>> for the newer formats, post 30, on Siemens' web site.  
>> 
>> Jovan Ilic
>> 
>> 
>> 
>> --
>> Not everything that can be counted counts 
>> and not everything that counts can be counted.
>> --AE
>> 
>> 
>> On Tue, Jul 29, 2014 at 9:45 AM, Ray Zimmerman  wrote:
>> Dear MATPOWER users,
>> 
>> Does anyone know where I can find documentation for older (pre-v29) versions 
>> of the PSS/E RAW data format?
>> 
>> Full documentation for multiple versions would be ideal, but even if someone 
>> can answer the following simple questions for me it would be a big help.
>> 
>> In which versions were the following first introduced?
>>  - separate Load Data section?
>>  - separate Transformer Data section?
>>  - Transformer Impedance Correction section?
>> 
>> And does anyone know what version this file 
>> (http://www.ee.washington.edu/research/pstca/formats/pti.txt) refers to?
>> 
>> Thanks in advance for any pointers,
>> 
>> -- 
>> Ray Zimmerman
>> Senior Research Associate
>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>> phone: (607) 255-9645
>> 
>> 
> 



Re: Dispatchable loads with negative reactive demand

2014-08-01 Thread Ray Zimmerman
MATPOWER treats generators with PMAX == 0 and PMIN < 0 as dispatchable loads 
and constrains their power factor. It should work with positive or negative 
reactive power consumption. Just make sure QMAX > QMIN.

  Ray


On Aug 1, 2014, at 6:41 AM, HEGGIE Alastair  wrote:

> ​Hi Shri,
> 
> >You can model it as a generator in MatPower with a negative Pmin, Pmax and a 
> >positive Qmin, Qmax.
> 
> My thought was that if I do this Matpower won't recognize it as a 
> dispatchable load and hence won't maintain a constant power factor - perhaps 
> I'm mistaken here, I'll gave it a go though and it seems to be working.
> 
> >What kind of load is this???​
> 
> Honestly, I don't know. See the load at bus 9 in the attached model. It is 
> one of the test cases supplied with MATPOWER so I assume it is not in error.
> 
> Thanks,
> Alastair
> From: bounce-117678726-70590...@list.cornell.edu 
>  on behalf of Abhyankar, Shrirang 
> G. 
> Sent: 01 August 2014 03:39
> To: MATPOWER discussion forum
> Cc: MATPOWER discussion forum
> Subject: Re: Dispatchable loads with negative reactive demand
>  
> 
> 
> On Jul 31, 2014, at 9:17 AM, "HEGGIE Alastair"  wrote:
> 
>> Dear all,
>> 
>> Does anyone know if it is possible to convert a load to a dispatchable load 
>> if the load at a bus has negative reactive demand (and positive real demand)?
> You can model it as a generator in MatPower with a negative Pmin, Pmax and a 
> positive Qmin, Qmax. What kind of load is this???
> 
> Shri
>> 
>> For example, buss 9 in the 39 bus example, case39.m has a reactive demand of 
>> -66.6. Setting Qmin to -66.6 would not model this correctly but If I set 
>> Qmin to 66.6 and Qmax to 0 the OPF does not solve. If I set Qmin to 0 and 
>> Qmax to 66.6 I don't think matpower recognizes this as a dispatchable load.
>> ​
>> Many thanks,
>> 
>> Alastair Heggie
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
> 



Re: Objective Function display

2014-08-01 Thread Ray Zimmerman
There’s always the possibility of a bug, but I’d be a bit surprised in this 
case. Unless you have additional user-defined costs, you can easily compute the 
objective function value yourself using the totcost() function, or even by 
explicitly using the quadratic coefficients to compute the cost of each gen.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Aug 1, 2014, at 10:16 AM, Tommy k  wrote:

> Hi
> 
>  I have the some cost functions of the following format which I believe is 
> still a convex cost function. With large initial cost and  a negative 1st 
> order coefficient.
> 
> abc.gencost = [
> 2 0 0 3 0.54376-229.78 145993.63;
> 
> ]
> 
> runopf converges and I am getting lambda's in the correct ranges. However the 
> object function is displaying a very, very large number.  Could there be a 
> bug in the display of the objective function? 
>  
> Regards
>   Tom



Re: Working with runopf

2014-08-06 Thread Ray Zimmerman
It may still be infeasible due to voltage and reactive power limits, or there 
could be an issue with the topology. Have you tried using case_info() to check 
the connectivity of the network?

   Ray


On Aug 4, 2014, at 11:06 AM, Vitor Ribeiro  wrote:

> Hello again,
> 
> I tried to change network limits so I can have runopf working correctly with 
> previously presented solution, but I did not have results.
> I cannot understand the warning about singular matrix described on 1st post:
> 
> " Warning: Matrix is singular to working precision.
> > In mips at 423
>   In mipsopf_solver at 147
>   In opf_execute at 91
>   In opf at 225
>   In runopf at 96
>   In f_perdas at 82 "
> 
> Am I doing something wrong possibly not related with the network parameters 
> limit?
> 
> Best regards,
> Vitro Ribeiro.





Re: Medium voltage load-flow

2014-08-06 Thread Ray Zimmerman
It may be because bus 12 (including its generator) is not connected to the 
network, which you can see by using case_info() in MATPOWER 5.0b1.

Ray


On Aug 5, 2014, at 6:26 AM, Simone Cochi  wrote:

> Dear all,
> I'm getting hard times to solve a power flow on a real Italian medium
> voltage network. MATPOWER does not converge with any algorithm. I'm
> wondering if the branch data must have a certain order or my problem
> is simply the R/X ratio. The casefile is the following:
> 
> function mpc = LFMT
> mpc.version = 2;
> mpc.baseMVA = 10;
> mpc.bus=[
> 1 3 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 2 1 0.02700 0.01308 0 0 1 1.0 0 20 1 1.1 0.9;
> 3 1 0.02700 0.01308 0 0 1 1.0 0 20 1 1.1 0.9;
> 4 1 0.02700 0.01308 0 0 1 1.0 0 20 1 1.1 0.9;
> 5 1 0.02700 0.01308 0 0 1 1.0 0 20 1 1.1 0.9;
> 6 1 0.05400 0.02615 0 0 1 1.0 0 20 1 1.1 0.9;
> 7 1 0.08640 0.04185 0 0 1 1.0 0 20 1 1.1 0.9;
> 8 1 0.02700 0.01308 0 0 1 1.0 0 20 1 1.1 0.9;
> 9 1 0.02700 0.01308 0 0 1 1.0 0 20 1 1.1 0.9;
> 10 1 0.02700 0.01308 0 0 1 1.0 0 20 1 1.1 0.9;
> 11 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 12 2 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 13 2 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 14 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 15 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 16 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 17 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 18 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 19 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 20 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 21 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 22 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 23 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 24 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 25 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 26 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 27 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> 28 1 0.0 0.0 0 0 1 1.0 0 20 1 1.1 0.9;
> ];
> mpc.gen=[
> 12 0.99440 0.0 100 -100 1.0 100.000 1 1000.0 0.0 0 0 0 0 0 0 0 0 0 0 0;
> 13 0.99440 0.0 100 -100 1.0 100.000 1 1000.0 0.0 0 0 0 0 0 0 0 0 0 0 0;
> 1 0.0 0.0 100 -100 1.0 100.000 1 1000.0 0.0 0 0 0 0 0 0 0 0 0 0 0;
> ];
> mpc.branch=[
> 19 27 0.01430 0.01060 0.01240 50.0 50.0 50.0 0 0 1 360 -360;
> 27 10 0.00220 0.00120 0.00120 50.0 50.0 50.0 0 0 1 360 -360;
> 27 15 0.00320 0.00240 0.00280 50.0 50.0 50.0 0 0 1 360 -360;
> 15 24 0.00840 0.00630 0.00740 50.0 50.0 50.0 0 0 1 360 -360;
> 24 16 0.00520 0.00390 0.00450 50.0 50.0 50.0 0 0 1 360 -360;
> 24 4 0.00040 0.00010 0.00820 50.0 50.0 50.0 0 0 1 360 -360;
> 16 25 0.00310 0.00230 0.00270 50.0 50.0 50.0 0 0 1 360 -360;
> 25 28 0.00170 0.00130 0.00150 50.0 50.0 50.0 0 0 1 360 -360;
> 25 5 0.00160 0.00090 0.00090 50.0 50.0 50.0 0 0 1 360 -360;
> 28 13 0.00400 0.00290 0.04580 50.0 50.0 50.0 0 0 1 360 -360;
> 28 14 0.00070 0.00020 0.01370 50.0 50.0 50.0 0 0 1 360 -360;
> 13 6 0.01320 0.00980 0.12280 50.0 50.0 50.0 0 0 1 360 -360;
> 6 26 0.00840 0.00630 0.00740 50.0 50.0 50.0 0 0 1 360 -360;
> 26 17 0.00130 0.00100 0.00110 50.0 50.0 50.0 0 0 1 360 -360;
> 26 8 0.00740 0.00420 0.00410 50.0 50.0 50.0 0 0 1 360 -360;
> 17 11 0.00900 0.00640 0.09160 50.0 50.0 50.0 0 0 1 360 -360;
> 11 18 0.00950 0.00710 0.05630 50.0 50.0 50.0 0 0 1 360 -360;
> 18 23 0.00060 0.00050 0.00060 50.0 50.0 50.0 0 0 1 360 -360;
> 23 3 0.02320 0.01320 0.01300 50.0 50.0 50.0 0 0 1 360 -360;
> 23 20 0.00520 0.00390 0.00450 50.0 50.0 50.0 0 0 1 360 -360;
> 20 21 0.01950 0.01450 0.01700 50.0 50.0 50.0 0 0 1 360 -360;
> 21 22 0.01490 0.01110 0.01300 50.0 50.0 50.0 0 0 1 360 -360;
> 22 7 0.00700 0.00520 0.06060 50.0 50.0 50.0 0 0 1 360 -360;
> 22 9 0.02480 0.01470 0.01490 50.0 50.0 50.0 0 0 1 360 -360;
> 7 2 0.01130 0.00650 0.00630 50.0 50.0 50.0 0 0 1 360 -360;
> 1 19 0.01970 0.01460 0.02750 50.0 50.0 50.0 0 0 1 360 -360;
> 
> Thank you.
> 





Re: Cost vs. Objective function discrepancy

2014-09-02 Thread Ray Zimmerman
If you are using a piecewise linear cost model, the costs must be convex in 
order to define the function you intend. See section 6.4.1 in the (v 5) User’s 
Manual to understand the resulting cost function. In this case, I believe the 
objective function value will be equal to the sum of the y cost variables, 
which lies above what you intend at some points, whereas totcost() still gives 
the correct non-convex cost.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Aug 15, 2014, at 8:11 AM, Eser Patrick  wrote:

> Ok, I found the reason: Some of my cost curves are non-convex. If I change 
> the curves to be perfectly linear, the two values match.
> 
> But this does leave another question for me: In the case of non-convex cost 
> curves, what does the objective function value "result.f" represent? Why is 
> there a difference to the totcost() value?
> 
> Thanks for your help.
> 
> Von: bounce-117731499-69334...@list.cornell.edu 
> [bounce-117731499-69334...@list.cornell.edu]" im Auftrag von "Eser  
> Patrick [es...@student.ethz.ch]
> Gesendet: Freitag, 15. August 2014 11:45
> An: MATPOWER-L@cornell.edu
> Betreff: Cost vs. Objective function discrepancy
> 
> Dear MATPOWER community,
> 
> I am experiencing a strange phenomenon when looking at the results of a 
> MATPOWER case I'm running.
> 
> I have a system of around 200 buses and 300 generators, and when I solve the 
> system using IPOPT, I receive the following results:
> 
>>> result.f
> 
> ans =
> 
>   6.9125e+05
> 
>>> sum(totcost(result.gencost, result.gen(:, PG)))
> 
> ans =
> 
>   6.1887e+05
> 
> So effectively, my objective function value is 691250 $/h, whereas my total 
> generator cost is just 618870 $/h. Where could this discrepancy come from? If 
> I "manually" calculate the production cost of all dispatched generators at 
> their respective power levels, I receive the exact value from the totcost() 
> function. Are some further shadow costs in the objective function value 
> (result.f)?
> 
> I have to mention, that the case does converge (result.success = 1) and that 
> I do NOT have any dispatchable loads in the system.
> 
> I'd be thankful for any hints on where to look for the problem. I can't see 
> it at the moment.
> 
> Thanks,
> Best Regards,
> 
> Patrick
> 
> 
> 



Re: Dispatchable load

2014-09-02 Thread Ray Zimmerman
1. Yes, if you are allowing changes to both loads and generators, you will need 
to use dispatchable loads.
2. Since MATPOWER’s OPF minimizes generation cost (negative for dispatchable 
loads), you will have to define your cost functions to reflect only the cost of 
changes from your base dispatch point. While it may not be necessary, you might 
find it simpler to include the base dispatches of all generators and loads as 
simple bus injections (PD column of the bus matrix), so that the generator 
dispatches reflect only incremental dispatches.


-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Aug 19, 2014, at 1:55 PM, nilesh patel  wrote:

> Dear sir,
> I m working on congestion cost minimization. My objective function is to 
> minimise rescheduling demand (load) cost. The objective function  is attached 
> herewith for your reference. My questions are:
> 1. Shall i use dispatchable load for rescheduling demand (del Pd (up/down) in 
> obj. function.)
> 2. Which changes should be made in Generator Cost Data format for the same.
> 
> Thanks.
> 
> 
> Nilesh Patel
> S.P.C.E. Visnagar, India
> 9979249556
> 
> 
> Get your own FREE website, FREE domain & FREE mobile app with Company email.  
> Know More >
> 



Re: Regarding Case11.m file

2014-09-02 Thread Ray Zimmerman
MATPOWER does not include case11.m, so I am not able to reproduce the problem. 
Are you using runse? 

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Aug 20, 2014, at 2:02 AM, Mahesh P  wrote:

> Dear Sir,
> 
>   I am performing state estimation on ill-conditioned system 
> namely: 11-bus system and 13-bus system. I am trying to execute case11.m in 
> Matpower. The program is executing well however, it is displaying state 
> estimator converged in 4 iterations and also displayed did not converged in 
> (0.02 sec).
> 
> So, my question is did state estimation algorithm is converged or did not 
> converged for ill-conditioned 11-bus system.
> 
>  
>   Thanking you,
> 
>  
> With Regards,
> 
> P.Mahesh
> Email: p.mahesh...@gmail.com
> 



Re: Modifying the Power Balance Equations

2014-09-02 Thread Ray Zimmerman
Can you accomplish what you want simply by including the base dispatch in the 
PD column of the bus matrix (where injections would appears as negative loads)?

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Aug 28, 2014, at 10:10 PM, vids  wrote:

> Thank you very much, Dr. Shri. Yes i think your suggestion about
> making the delta Pg as the control variables is a great idea. However
> I am new to Matpower. Can you help me/ direct me to some examples on
> how i can accomplish this? Thank you very much...
> 
> On Thu, Aug 28, 2014 at 12:23 AM, Abhyankar, Shrirang G.
>  wrote:
>> Vids,
>>  Implementing your reformulated OPF equations, written in complementarity
>> form, is non-trivial in MATPOWER as it will require modifying the
>> variable/equation sizes and muddling with the OPF data structures. Note
>> that you'll also need additional equations, perhaps expressed in
>> semi-smooth form, relating your upward/downward balancing service to
>> generator power deviation. You will have to spend some time to understand
>> the OPF data structures and how they are used in the various OPF routines.
>> 
>> One other possible way (that I think will work) is by using the real power
>> generator deviation \Delta{Pg} as the control variable instead of Pg (see
>> the attached equations).  This will keep the sizes of the
>> variables/equations for the reformulated OPF same as the original one.
>> However, you will have to modify the cost function, gradient, Hessian, and
>> the generator real power limits accordingly.
>> 
>> Shri
>> 
>> -Original Message-
>> From: vids 
>> Reply-To: MATPOWER discussion forum 
>> Date: Wed, 27 Aug 2014 16:18:14 +0800
>> To: 
>> Subject: Modifying the Power Balance Equations
>> 
>>> Hi Dr Zimmerman and Matpower Community,
>>> 
>>> I am trying implement an OPF where the real power dispatch is
>>> pre-determined (as in the case of an energy market where the Q
>>> schedules are managed separately by the transmission operator).
>>> 
>>> Is it possible to implement it in Matpower? My idea is to add "slack"
>>> variables in the nodal energy equations
>>> 
>>> Pgi - ΔPgi + Pb1i - Pb2i - Pdi = ΣViVjYij(cos(θij + δi -δj)
>>> 
>>> Pgi  - fixed/predetermined real power generated at node i
>>> ΔPgi - real power 're-scheduling' due to the reactive power dispatch
>>> Pb1i - upward balancing service at node i
>>> Pb2i - downward balancing service at node i
>>> 
>>> Pb1i and Pb2 will have non-zero values when ΔPgi is nonzero, prompting
>>> other generators to compensate the real power 're-scheduling' when
>>> needed.
>>> 
>>> This is the formulation in the dissertation of Dr.  El-Samahy, and I
>>> am wondering if this can be implemented in matpower.
>>> 
>>> Any ideas would greatly be appreciated. Thank you very much.
>>> 
>>> --
>>> 2 Cor 12:9
>>> Each time he said, "My grace is all you need. My power works best in
>>> weakness." So now I am glad to boast about my weakness, so that the
>>> power of Christ can work through me.
>>> 
>>> 
>> 
> 
> 
> 
> -- 
> 2 Cor 12:9
> Each time he said, "My grace is all you need. My power works best in
> weakness." So now I am glad to boast about my weakness, so that the
> power of Christ can work through me.
> 
> 



Re: Reactive Capability Curve Limits

2014-09-02 Thread Ray Zimmerman
Both cases have a all generator cost functions equal to zero, so all feasible 
power flow solutions are optimal. That is, there isn’t even a unique *local* 
optima, let alone a global optima. Under such circumstances, numerical 
optimization routines such as those used by MATPOWER, should not be expected to 
produce anything unique or consistent. Adding a small quadratic real power cost 
for each generator does result in consistent solutions for the two cases (to 
numerical accuracy of the algorithms).

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Sep 1, 2014, at 10:42 AM, vids  wrote:

> Hi Matpower Community,
> 
> I was testing the application of reactive capability curve limits. I
> defined a generator operating region by using the points described in
> section 6.4.3 in the manual.
> I first performed the OPF without including the parameters, and then
> compared it with the results when the PQ curve limitation was
> included. I was expecting the same results because the operating point
> is very well within the operating region defined by the limits. But
> the results were two slightly different operating points. Is this
> really how Matpower behaves? I am attaching the two case files, in
> case. Thank you very much!
> 
> Vids
> 



Re: Enforce Q lims causes Voltage limit violation

2014-09-02 Thread Ray Zimmerman
You will have to manually redispatch something else to keep your voltage within 
limits (i.e. generator voltage set-points, transformer taps, generator real 
power dispatch). You may be able to define an OPF with appropriately specified 
limits on bus voltages, generator P and Q dispatches, etc. that will accomplish 
what you want automatically. 

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


On Sep 2, 2014, at 6:15 AM, karthikai dharma  wrote:

> Dear sir,
> when i enforce q limits in load flow, the voltage of PV bus goes beyond the 
> upper limit(>1.1). what i have to do to keep both Q lims and Voltage lims 
> within the tolerance.
>  
> D.Karthikaikannan
> Associate Professor GrI,
> Department of Electrical and Electronics Engg
> Indra Ganesan College of Engg,
> TamilNadu
> INDIA



Re: Reactive Capability Curve Limits

2014-09-08 Thread Ray Zimmerman
First of all, using small identical *quadratic* cost functions for generators 
is not strictly the same as minimizing losses. If the costs are identical 
*linear* costs, then it is strictly the same as loss minimization, since it is 
essentially trying to minimize the sum of the real power dispatch.

If you start putting costs on the reactive power outputs of the generators, it 
will affect the dispatches (real and reactive) and therefore will increase the 
total real power losses relative to the optimum obtained by the problem 
describe above.

Ray

On Sep 6, 2014, at 4:02 AM, vids  wrote:

> Hi Dr Zimmerman,
> 
> I have another question on the generator cost and objective function
> formulation. I read in the previous messages that in order to change
> the objective function from total cost minimization to real power loss
> minimization, the gencost function must be modified to specify small
> quadratic cost functions identical for all generators.
> 
> What is the expected behavior of MATPOWER when (a) small identical
> quadratic cost functions will also be specified for the generator
> reactive power output as opposed to (b) the default setting wherein
> there are no costs specified for reactive power?
> 
> If I want my objective to be irrelevant of the cost of reactive power,
> I just want to minimize the losses, which option do I choose, option a
> or b? Thank you very much.
> 
> Vids
> 
> 
> On Tue, Sep 2, 2014 at 10:39 PM, Ray Zimmerman  wrote:
>> Both cases have a all generator cost functions equal to zero, so all
>> feasible power flow solutions are optimal. That is, there isn’t even a
>> unique *local* optima, let alone a global optima. Under such circumstances,
>> numerical optimization routines such as those used by MATPOWER, should not
>> be expected to produce anything unique or consistent. Adding a small
>> quadratic real power cost for each generator does result in consistent
>> solutions for the two cases (to numerical accuracy of the algorithms).
>> 
>> --
>> Ray Zimmerman
>> Senior Research Associate
>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>> phone: (607) 255-9645
>> 
>> On Sep 1, 2014, at 10:42 AM, vids  wrote:
>> 
>> Hi Matpower Community,
>> 
>> I was testing the application of reactive capability curve limits. I
>> defined a generator operating region by using the points described in
>> section 6.4.3 in the manual.
>> I first performed the OPF without including the parameters, and then
>> compared it with the results when the PQ curve limitation was
>> included. I was expecting the same results because the operating point
>> is very well within the operating region defined by the limits. But
>> the results were two slightly different operating points. Is this
>> really how Matpower behaves? I am attaching the two case files, in
>> case. Thank you very much!
>> 
>> Vids
>> 
>> 
>> 
> 
> 
> 
> -- 
> 2 Cor 12:9
> Each time he said, "My grace is all you need. My power works best in
> weakness." So now I am glad to boast about my weakness, so that the
> power of Christ can work through me.
> 
> 





Re: on-load tap changer in power flow calculation

2014-09-08 Thread Ray Zimmerman
MATPOWER does not currently make any changes to transformer taps during the 
power flow or OPF solution process, but you can certainly run either PF or OPF 
iteratively, adjusting the tap settings between runs. Simply modify the TAP 
column in the branch matrix.

Ray


On Sep 8, 2014, at 10:06 AM, sabrina.hasssa2...@mailbox.tu-berlin.de wrote:

> Dear all,
> I want to implement a OLTC transformer model in MatLabs "Case 9". I already 
> know that I need to modify the
> (1) new admittance matrices and and (2) voltage magnitudes in MatLab's Newton 
> Power Flow Function.
> 
> Hereby I have the problem, that I don't now how to define these two
> values within or outside of the "runpf.m"-function (or "newtonpf.m"-function).
> 
> I am grateful for every help.
> Kind regards, Sabrina
> 
> 





Re: on-load tap changer in power flow calculation

2014-09-08 Thread Ray Zimmerman
The branch model used by MATPOWER is the one shown in Fig 3-1 in the manual. 
Tap changes on the primary or secondary side are both reflected in the single 
tap ratio specified in the TAP column of the branch matrix. This tap ratio is 
taken into account when forming the admittance matrix. As you can see in Fig 
3-1, the voltage at the secondary side of the ideal transformer in the model is 
v_f / N. It is also straightforward to run a few cases with different settings 
for the tap ratio to see the effect on voltages.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Sep 8, 2014, at 12:52 PM,  
 wrote:

> Thanks Ray,
> modifying TAP settings in mpc.branch is changing taps on primary side, right? 
> I want to modify taps on secondary side which makes a difference on 
> admittance matrix. Also I can't see how voltage magnitude is controlled by 
> tap setting.
> Cheers, Sabrina
> 
> 
> 



Re: About OPF constraint violation

2014-09-16 Thread Ray Zimmerman
That option is used to set the default value of the feastol parameter for 
mips(). It is really termination tolerance, not something intended to be used 
to relax constraints, since it applies to equality constraints (such as power 
balance) as well as inequality constraints.

Unfortunately, there isn’t really an easy way to find which constraints 
“caused” an infeasible solution. My approach is usually to start by relaxing 
constraints until I get convergence. Then you can see which constraints violate 
the original limits and begin to gradually move the limits back toward their 
original values, watching which constraint multipliers grow large (indicating 
constraints which may conflict).

Hope this helps,

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


On Sep 12, 2014, at 8:19 AM, ni le  wrote:

> Dear all,
> 
> I'm running Optimal Power Flow using Matpower and I would like to know how 
> can I know which constrains are not fulfilled if the OPF is not converged? 
> 
> In mpoption.m, there is an option to change the tolerance for constraint 
> violation, i.e. OPF_VIOLATION, but I couldn't find this value used in the OPF 
> program (e.g. in mips.m)? So how this value works in the OPF program?
> 
> Thank you very much!
> 
> 
> Kind regards,
> ni le
> 



Re: Dispatchable load

2014-09-18 Thread Ray Zimmerman
Without more details of how you are converting your fixed loads to 
dispatchable, I have no way to guess where the 15MW block you are referring to 
comes from. It is certainly not a restriction by MATPOWER.

   Ray


On Sep 18, 2014, at 7:18 AM, nilesh patel  wrote:

> Hello sir,
> i have to use fixed load as dispatchable load to reschedule demand for 
> overload alleviation.
> 
> My question is that after running acopf, i am getting in result each  
> dispatchable load converted to fixed  generation block of 15 MW only. Can 
> this block of 15 MW changed to different value?
> 
> Thanks.
> 
> Nilesh Patel





Re: Regarding runse('case11.m')

2014-09-19 Thread Ray Zimmerman
As I mentioned before, MATPOWER does not include case11.m, so I am not able to 
reproduce the problem. However, looking at the code, it probably means that the 
initial power flow did not converge.

Ray


On Sep 19, 2014, at 9:45 AM, Mahesh P  wrote:

> Dear Sir/Madam,
> 
>   I am performing state estimation on ill-conditioned system 
> namely: 11-bus system and 13-bus system. I am trying to execute case11.m in 
> Matpower by calling runse(‘case11.m’).  The program is executing well 
> however, it is displaying state estimator converged in 4 iterations and also 
> displayed did not converged in (0.02 sec).
> 
> So, my question is did state estimation algorithm is converged or did not 
> converged for ill-conditioned 11-bus system.
> 
>  
>   Thanking you,
> 
>  
> With Regards,
> 
> P.Mahesh
> Email: p.mahesh...@gmail.com
> 



Re: Branch limit relaxation for AC OPF

2014-09-23 Thread Ray Zimmerman
There isn’t a really easy to solve what you want with the current version of 
MATPOWER, but I think it should be possible to do it with a few “tricks”.

For a branch between bus X and bus Y ...

1. Add two dummy buses X’ and Y’ and reconnect the line to X’ and Y’ instead of 
X and Y.
2. Add dummy generators at X, X’, Y and Y’ with PMIN = –M, PMAX = M, where M is 
some value larger than the max flow on the line (even in the relaxed solutions).
3. Add user-defined linear constraints to enforce equality between the Pg of 
dummy gen at X and -Pg of dummy gen at X’, and likewise for dummy gens at Y and 
Y’.
4. Set the cost on each of the dummy generators to a piecewise linear function 
that is zero up to the original line limit value, and some large value above 
that.
5. Add user-defined linear constraints to enforce equality between the voltages 
(magnitudes and angles) at X and X’ and at Y and Y’.
6. Remove or relax the original line limit on the line itself.

I don’t think I’ve never tried this, so I’d be interested in hearing how well 
it works if you decide to attempt it.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Sep 23, 2014, at 5:51 AM, Jiazi Zhang  wrote:

> Dear all,
> 
> I'm running AC OPF using Matpower for my project and for some cases, the OPF 
> does not converge due to the capacities of several branches are not enough. 
> I'd like to relax the thermal limit constraints on these branches with large 
> penalty factors. But the power flow thermal limit constraints are nonlinear 
> for AC OPF. I wonder if it is possible to do such branch limit relaxation in 
> AC OPF program.
> 
> Best Regards,
> Jiazi
> 
> -- 
> Jiazi Zhang
> Research Assisant
> School of Electrical, Computer & Energy Engineering
> Ira A. Fulton Schools of Engineering
> Arizona State University
> jzhan...@asu.edu



Re: Branch limit relaxation for AC OPF

2014-09-26 Thread Ray Zimmerman
1. The dummy buses are only connected to the line whose flow constraint you 
want to relax.
2. There is only one line in question. It was initially connected to X and Y, 
now it (the same line) is connected to X’ and Y’.

The idea is that we are essentially splitting the terminal buses of the line 
into two, X and X’ (and similarly for Y and Y’). X and X’ then are not 
physically connected by any branch, but the additional user constraints ensure 
they represent the same physical bus. Their voltages and angles are required to 
be the same, it’s just that at X the injection into the line is represented by 
a dummy generator and at X’ all of the other bus injections (which must be the 
negative of the line flow, since together all of the injections sum to zero) 
are represented by a dummy generator. As Álvaro points out, it is now easy to 
put costs on the injections of these dummy variables since they are simple 
optimization variables.

I should mention that after looking again at the thread he linked to I realized 
I missed a constraint. You also need the equivalent of step 3 to constrain the 
reactive injections of the dummy generators as well. That is, Qg at X must 
equal -Qg at X’, and similarly at Y and Y’.

Hope this helps,

   Ray

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Sep 24, 2014, at 9:50 AM, Jiazi Zhang  wrote:

> Dear Dr. Zimmerman,
> 
> Thank you so much for your approach. But I still have several questions.
> 
> 1. For the two dummy buses, where should I add them? Are they directly 
> connected to the original bus X and Y? Or they are not connected to bus X and 
> bus Y, but have the same buses connection as X and Y?
> 2. According to step 1, the relaxed line is reconnected to bus X' and bus Y', 
> but in step 6, it seems the line connected to X and Y still exists. Should 
> both the lines connected to X and Y, and X' and Y'  exist in the system?
> 
> Actually I'm not fully understanding why this approach can be equivalent to 
> relaxed the thermal limit constraints on a specific branch. Can you explain 
> the theory of the approach more in detail? 
> 
> Thank you!
> 
> Best Regards,
> Jiazi
> 
> On Tue, Sep 23, 2014 at 1:20 PM, Ray Zimmerman  wrote:
> There isn’t a really easy to solve what you want with the current version of 
> MATPOWER, but I think it should be possible to do it with a few “tricks”.
> 
> For a branch between bus X and bus Y ...
> 
> 1. Add two dummy buses X’ and Y’ and reconnect the line to X’ and Y’ instead 
> of X and Y.
> 2. Add dummy generators at X, X’, Y and Y’ with PMIN = –M, PMAX = M, where M 
> is some value larger than the max flow on the line (even in the relaxed 
> solutions).
> 3. Add user-defined linear constraints to enforce equality between the Pg of 
> dummy gen at X and -Pg of dummy gen at X’, and likewise for dummy gens at Y 
> and Y’.
> 4. Set the cost on each of the dummy generators to a piecewise linear 
> function that is zero up to the original line limit value, and some large 
> value above that.
> 5. Add user-defined linear constraints to enforce equality between the 
> voltages (magnitudes and angles) at X and X’ and at Y and Y’.
> 6. Remove or relax the original line limit on the line itself.
> 
> I don’t think I’ve never tried this, so I’d be interested in hearing how well 
> it works if you decide to attempt it.
> 
> -- 
> Ray Zimmerman
> Senior Research Associate
> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
> phone: (607) 255-9645
> 
> On Sep 23, 2014, at 5:51 AM, Jiazi Zhang  wrote:
> 
>> Dear all,
>> 
>> I'm running AC OPF using Matpower for my project and for some cases, the OPF 
>> does not converge due to the capacities of several branches are not enough. 
>> I'd like to relax the thermal limit constraints on these branches with large 
>> penalty factors. But the power flow thermal limit constraints are nonlinear 
>> for AC OPF. I wonder if it is possible to do such branch limit relaxation in 
>> AC OPF program.
>> 
>> Best Regards,
>> Jiazi
>> 
>> -- 
>> Jiazi Zhang
>> Research Assisant
>> School of Electrical, Computer & Energy Engineering
>> Ira A. Fulton Schools of Engineering
>> Arizona State University
>> jzhan...@asu.edu
> 
> 
> 
> 
> -- 
> Jiazi Zhang
> Research Assisant
> School of Electrical, Computer & Energy Engineering
> Ira A. Fulton Schools of Engineering
> Arizona State University
> jzhan...@asu.edu



Re: One Question

2014-10-06 Thread Ray Zimmerman
No, MATPOWER is not able to model unbalanced power flow.

Ray

On Oct 5, 2014, at 11:23 AM, iran iet  wrote:

> Hi, everyone
> Is MATPOWER able to analysis unbalanced load flow?
> I have many unbalanced load in a distribution system and i want to run load 
> flow.
> Thanks





Re: Hello sir/madam,

2014-10-06 Thread Ray Zimmerman
Let me take this opportunity to just remind everyone … please check the 
MATPOWER user’s manual *before* posting to this list.

The IEEE 39 bus system is included in the MATPOWER distribution (see Table 
D-16). And type “help case39” at the Matlab prompt for details on what is meant 
by “the IEEE 39-bus system”.

As far as calculating LMP, simply run an OPF and pull the LMP’s from 
results.bus(:, LAM P) (see from Table 6-1).

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645



On Oct 6, 2014, at 6:19 AM, priya alagumalai  wrote:

> Plese anyone send me the ieee 39bus new england test system (datas) details...
> and give me a guideline for LMP calculation...
> 



Re: changing voltage of the 30 bus ieee test system

2014-10-14 Thread Ray Zimmerman
If you are running a simple power flow, you’ll want to change the values in the 
VG column of the gen matrix. If it’s an OPF, it will be the VMIN and VMAX 
columns of the bus matrix.

Ray


On Oct 7, 2014, at 12:33 AM, zahra shiravi  wrote:

> Dear all
> i want to change voltage of the 30 bus ieee test system to have low voltages. 
> i need these low voltages to run my program and see the effect of it on 
> voltages. can anyone help me and say how can i do it??
> Best Regards.
> 





Re: From MW to kW

2014-10-14 Thread Ray Zimmerman
I’m afraid not. But if you consistently enter all data in kW and kVA instead of 
MW and MVA (including baseMVA), the answers will also be in kW, though the 
labels will still say MW.

   Ray



On Oct 7, 2014, at 3:37 AM, Simone Cochi  wrote:

> Hello all,
> is there any settings to work with kW in MATPOWER instead with MW? Or
> at least only to change the display results in kW?
> 
> Thank you
> 
> Simone
> 





Re: Problem with DC in power analysis

2014-10-14 Thread Ray Zimmerman
Maybe if you give us a specific example of what you’re changing that is giving 
you an identical solution?

For example, if you cut the reactance in line 19 ...

mpc = loadcase(‘case14’);
rundcpf(mpc);

define_constants;
mpc.branch(19, BR_X) = mpc.branch(19, BR_X)/10;
rundcpf(mpc);

… you’ll notice that the flow in the branch does change.

   Ray




On Oct 7, 2014, at 1:55 PM, Allan King George IV  wrote:

> I would say in IEEE14.
> It does work for IEEE30.
> Does anyone know why?





Re: Hello sir/madam,

2014-10-14 Thread Ray Zimmerman
MATPOWER does not include an option to automatically run N-1 contingencies, but 
you could certainly implement your own on top of MATPOWER’s power flow program.

   Ray


On Oct 9, 2014, at 3:51 AM, priya alagumalai  wrote:

> Thank you sir
>  
> One more question...
> How to run a N-1 contigency program?
> 
> On Mon, Oct 6, 2014 at 7:56 PM, Ray Zimmerman  wrote:
> Let me take this opportunity to just remind everyone … please check the 
> MATPOWER user’s manual *before* posting to this list.
> 
> The IEEE 39 bus system is included in the MATPOWER distribution (see Table 
> D-16). And type “help case39” at the Matlab prompt for details on what is 
> meant by “the IEEE 39-bus system”.
> 
> As far as calculating LMP, simply run an OPF and pull the LMP’s from 
> results.bus(:, LAM P) (see from Table 6-1).
> 
> -- 
> Ray Zimmerman
> Senior Research Associate
> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
> phone: (607) 255-9645
> 
> 
> 
> On Oct 6, 2014, at 6:19 AM, priya alagumalai  wrote:
> 
>> Plese anyone send me the ieee 39bus new england test system (datas) 
>> details...
>> and give me a guideline for LMP calculation...
>> 
> 
> 
> 
> 
> -- 
> 
> Emoticons



Re: Additional constraint

2014-10-14 Thread Ray Zimmerman
Please check the math against the definition of power factor, but I think it’s 
as simple as changing the sign on QPratio1 and QPratio2 in your constraints, 
along with the direction of your inequalities. And, by the way, I recommend you 
use Inf and -Inf for the unlimited bounds, since that way those constraints 
will be eliminated completely, rather than using - and 999 as proxies.

Ray
 

On Oct 10, 2014, at 11:24 AM, vids  wrote:

> Hi Dr Zimmerman,
> 
> I tried to implement an additional constraint on the power factors
> using an inequality constraint. I tried to implement this inequality,
> as stated in one of the previous messages.
> 
> The original problem was to set the power factor of a generator
> between 0.8 and 0.9.
> pf1 = 0.8;
> pf2 = 0.9;
> QPratio1 = sqrt(1/pf1^2 -1);
> QPratio2 = sqrt(1/pf2^2 -1);
> % then write the constraints for
> % QPratio1 * Pg(i) - Qg(i) > 0
> % QPratio2 * Pg(i) - Qg(i) < 0
> 
> 
> I implemented the inequality constraints using this code:
> 
> mpc.A = sparse([1; 1; 2; 2], [2*nb+1; 2*nb+ng+1; 2*nb+1; 2*nb+ng+1],
> [QPratio1 -1 QPratio2 -1],2,2*nb+2*ng);
> mpc.l = [0; -]
> mpc.u = [999; 0]
> 
> 
> When I performed opf on my test system (please see attached), the
> original power factor of the first generator was 0.9284 lead. When I
> performed the modified OPF, it forced the operation of the said
> generator to lagging, in order to satisfy the power factor constraint.
> Is there any way to still maintain the leading operation, but the cos
> theta will be within the specified limits? Thank you very much.
> -- 
> 2 Cor 12:9
> Each time he said, "My grace is all you need. My power works best in
> weakness." So now I am glad to boast about my weakness, so that the
> power of Christ can work through me.
> 





Re: Total and Dispatchale load

2014-10-14 Thread Ray Zimmerman
The total_load() function can be used to get the total *nominal* load at each 
bus. I’ve actually just updated total_load() to properly return the total 
realized load, rather than the nominal load, by default. Nominal load will 
still be available optionally. I’m happy to send you the updated code off-line 
if you need it, but it will be in the final 5.0 release.

   Ray



On Oct 12, 2014, at 4:25 PM, Abdel-Fattah El-Adl  wrote:

> How can get the total load at each bus in the case of loads contain fixed 
> part and dispatchable part as appears in the results when run opf.
>  
> Best regards 
> =
> Abdel-Fattah El-Adl
> Associate Lecturer
> Mansoura University 
> Faculty of Engineering 
> Electrical Engineering Dept. 
> EL-Mansoura - Egypt 
> Tel : +201227074312 
> Fax : +2050-2244690 
> e-mail: elad...@yahoo.com 
>  elad...@mans.edu.eg
>   elad...@gmail.com
> =



Re: Hep with converting real line parameters to branch data

2014-10-14 Thread Ray Zimmerman
I’m pretty sure the answer can be found here …

   https://en.wikipedia.org/wiki/Per-unit_system

You have a system MVA base for your per unit conversions and you can use 230 kV 
as the voltage base for these lines.

   Ray


On Oct 10, 2014, at 4:17 AM, Zeya Aung [11547809d]  
wrote:

> Hi all
> 
> I need help to convert my real case line parameters to the branch data 
> format. Sample of real life data is given below.
> 
> **
> TRANSMISSION LINES
> NONAME Line Length
> km No. of 
> CircuitPositive Sequence
> Resistance
> R' (ohm/km)Reactance
> X'(ohm/km) Capacitance
> C'(uF/km)
> 1 230kV-BELIN-THAPYAYWA-1 87.95   Double  0.03624 0.30153 0.011898
> 2 230kV-BELIN-THAPYAYWA-2 87.95   Double  0.03624 0.30153 0.011898
> 3 230kV-BELIN-OHNTAW-157.6Double  0.04761 0.30652 0.011739 ***
> 
> How can i turn it into the branch data format of Matpower with per unit 
> resistance etc? Using the appropriate transmission line model to calculate 
> the impedance (Z) and turn it into per unit?
> 
> Please help..
>
> -
>  
> Disclaimer:
> 
> 
> This message (including any attachments) contains confidential information 
> intended for a specific individual and purpose. If you are not the intended 
> recipient, you should delete this message and notify the sender and The Hong 
> Kong Polytechnic University (the University) immediately. Any disclosure, 
> copying, or distribution of this message, or the taking of any action based 
> on it, is strictly prohibited and may be unlawful.
> 
> The University specifically denies any responsibility for the accuracy or 
> quality of information obtained through University E-mail Facilities. Any 
> views and opinions expressed are only those of the author(s) and do not 
> necessarily represent those of the University and the University accepts no 
> liability whatsoever for any losses or damages incurred or caused to any 
> party as a result of the use of such information.
> 



Re: Branch modelling: capacitance or susceptance?

2014-10-16 Thread Ray Zimmerman
It is susceptance, not capacitance, so the first sentence in section 3.2 needs 
to be fixed (and will be in the final MATPOWER 5 release). Thanks for catching 
this.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Oct 15, 2014, at 5:52 AM, Kaiser, Raphaël 
 wrote:

> Dear all,
> 
> I have a questions concerning the modelling of branches and I'm
> referring to the MATPOWER 4.0b1 User's Manual.
> 
> 1. In chapter 3.2 the first sentence states:
> All transmission lines, transformers and phase shifters are modeled with
> a common branch model, consisting of a standard π transmission line
> model, with series impedance z_s = r_s + jx_s and total charging
> capacitance b_c , in series with an ideal phase shifting transformer.
> Note: b_c is defined as *total charging capacitance*.
> 
> 2. In chapter 3.5 the letter b is used in the formula y_sh = g_sh + jb_sh
> Note: In this context, b seems to be used as a *susceptance*.
> 
> 3. In Appendix B, Table B-3 on page 79 I cannot find any capacitance,
> but there is the *total line charging susceptance (p.u.)* in column 5.
> 
> As susceptance and capacitance are related but not the same, the
> statements of the manual seem contradictory to me. What does b in the
> common branch model stand for, the capacitance or the susceptance?
> 
> Best regards,
> Raphaël Kaiser
> 
> 
> 



Re: Modifying the Power Balance Equations

2014-10-16 Thread Ray Zimmerman
If you used the A, l and u fields of the MATPOWER case struct (mpc) to specify 
the constraints, then the multipliers are in …

results.lin.mu.l.usr
results.lin.mu.u.usr

Note that these will be relative to power in p.u. not in MW, so you’ll have to 
divide by baseMVA to get prices in $/MW.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


On Oct 16, 2014, at 12:52 PM, vids  wrote:

> Hi Dr Zimmerman,
> How do i access the multipliers for the additional constraint that I
> added? thank you
> 
> On Tue, Sep 2, 2014 at 10:26 PM, Ray Zimmerman  wrote:
>> Can you accomplish what you want simply by including the base dispatch in
>> the PD column of the bus matrix (where injections would appears as negative
>> loads)?
>> 
>> --
>> Ray Zimmerman
>> Senior Research Associate
>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>> phone: (607) 255-9645
>> 
>> On Aug 28, 2014, at 10:10 PM, vids  wrote:
>> 
>> Thank you very much, Dr. Shri. Yes i think your suggestion about
>> making the delta Pg as the control variables is a great idea. However
>> I am new to Matpower. Can you help me/ direct me to some examples on
>> how i can accomplish this? Thank you very much...
>> 
>> On Thu, Aug 28, 2014 at 12:23 AM, Abhyankar, Shrirang G.
>>  wrote:
>> 
>> Vids,
>> Implementing your reformulated OPF equations, written in complementarity
>> form, is non-trivial in MATPOWER as it will require modifying the
>> variable/equation sizes and muddling with the OPF data structures. Note
>> that you'll also need additional equations, perhaps expressed in
>> semi-smooth form, relating your upward/downward balancing service to
>> generator power deviation. You will have to spend some time to understand
>> the OPF data structures and how they are used in the various OPF routines.
>> 
>> One other possible way (that I think will work) is by using the real power
>> generator deviation \Delta{Pg} as the control variable instead of Pg (see
>> the attached equations).  This will keep the sizes of the
>> variables/equations for the reformulated OPF same as the original one.
>> However, you will have to modify the cost function, gradient, Hessian, and
>> the generator real power limits accordingly.
>> 
>> Shri
>> 
>> -Original Message-
>> From: vids 
>> Reply-To: MATPOWER discussion forum 
>> Date: Wed, 27 Aug 2014 16:18:14 +0800
>> To: 
>> Subject: Modifying the Power Balance Equations
>> 
>> Hi Dr Zimmerman and Matpower Community,
>> 
>> I am trying implement an OPF where the real power dispatch is
>> pre-determined (as in the case of an energy market where the Q
>> schedules are managed separately by the transmission operator).
>> 
>> Is it possible to implement it in Matpower? My idea is to add "slack"
>> variables in the nodal energy equations
>> 
>> Pgi - ΔPgi + Pb1i - Pb2i - Pdi = ΣViVjYij(cos(θij + δi -δj)
>> 
>> Pgi  - fixed/predetermined real power generated at node i
>> ΔPgi - real power 're-scheduling' due to the reactive power dispatch
>> Pb1i - upward balancing service at node i
>> Pb2i - downward balancing service at node i
>> 
>> Pb1i and Pb2 will have non-zero values when ΔPgi is nonzero, prompting
>> other generators to compensate the real power 're-scheduling' when
>> needed.
>> 
>> This is the formulation in the dissertation of Dr.  El-Samahy, and I
>> am wondering if this can be implemented in matpower.
>> 
>> Any ideas would greatly be appreciated. Thank you very much.
>> 
>> --
>> 2 Cor 12:9
>> Each time he said, "My grace is all you need. My power works best in
>> weakness." So now I am glad to boast about my weakness, so that the
>> power of Christ can work through me.
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> 2 Cor 12:9
>> Each time he said, "My grace is all you need. My power works best in
>> weakness." So now I am glad to boast about my weakness, so that the
>> power of Christ can work through me.
>> 
>> 
>> 
> 
> 
> 
> -- 
> 2 Cor 12:9
> Each time he said, "My grace is all you need. My power works best in
> weakness." So now I am glad to boast about my weakness, so that the
> power of Christ can work through me.
> 
> 



Re: Generators as negative loads

2014-10-16 Thread Ray Zimmerman
Simone and Shri,

I’ve looked at this a bit and I’m not sure I agree. First of all, Simone, I 
can’t seem to create a case that demonstrates what you are seeing (unless by “a 
little reactive power output” you mean something non-zero on the order of the 
termination tolerances. So, could you please send me a small example off-list?

And Shri, while I agree there is a small bug in the handling of generator 
reactive power at PQ buses, I don’t think it has anything to do with the 
charging capacitance of connected lines. In fact, I think the total reactive 
power injection at the bus is correct. The only issue is that the total is 
distributed proportionally among all of the generators at the bus, as opposed 
to leaving the allocations as specified in the input. In any case, I think your 
suggested patch will not be correct, since gbus and on could then be of 
different dimension.

Let me know if you still think I’m missing something,

Ray
   

On Oct 8, 2014, at 2:46 PM, Abhyankar, Shrirang G.  wrote:

> Simone,
>   I think the smallish reactive power output from the generator that you
> are seeing is due to the reactive power supplied by the line charging
> capacitance(s) of the transmission line(s) connected to it.  Instead of
> what I suggested earlier, you could set the generator output as negative
> load in the bus data struct (and set its bus type to PQ).
> 
> @Ray: I think the proper fix for this is by applying the following patch
> in pfsoln.m that excludes generators at PQ buses from gbus.
> 
>  - gbus = gen(on, GEN_BUS);%% what buses are they at?
>  + gbus = find(bus(gen(on,GEN_BUS),BUS_TYPE)~=PQ)  %% Only include
> generator buses with types PV and REF.
> 
> 
> Shri
> 
> -Original Message-
> From: Simone Cochi 
> Reply-To: MATPOWER discussion forum 
> Date: Wed, 8 Oct 2014 16:01:05 +0200
> To: MATPOWER discussion forum 
> Subject: Generators as negative loads
> 
>> Hello there,
>> I asked months ago if I could simulate photovoltaic generators as PQ
>> negative loads in order to see the the voltage profile modifications
>> caused by injection of the generators.Someone advised me to put the
>> generator in the generator struct and to mark bus type as PQ (1). I
>> notice that even if I put reactive power output to zero in the
>> generator and bus struct, I have a little a little reactive power
>> output from the photovoltaic generator in the results. Someone can
>> explain me this behaviour?
>> 
>> Thank you very much
>> 
>> Simone
>> 
> 
> 
> 



Re: penalty

2014-10-17 Thread Ray Zimmerman
You’ll have to describe what you’re doing in a bit more detail for us to be 
able to give any useful input. Presumably, you are doing an OPF with some sort 
of modified cost function? What is the objective function?

Ray

On Oct 17, 2014, at 12:02 AM, nivedita arunachalam 
 wrote:

> ​Dear all,
> ​Im working with reactive power optimization on IEEE30 bus 
> system. And I need to add penalty to my fitness function. While doing so I 
> get maximum reactive power for all generator buses. why does this occur can 
> anyone explain me?
> I there any remedy for that?



Re: reg reactive power violation

2014-10-17 Thread Ray Zimmerman
Looks like you are working on the same assignment as the previous poster?   ;-)

If I understand your problem correctly, it makes perfect sense. If you ignore 
violations, you have a lot more freedom to reduce losses. If you restrict your 
solutions to those that have only small violations, you have restricted 
yourself to a smaller search space so the losses will increase.

For the pf.enforce_q_lims option (or ENFORCE_Q_LIMS for older versions) the 
procedure is described in the last paragraph of section 4.1 of the User’s 
Manual  A value of 1 means that, at each iteration of the outer loop, all buses 
with generators violating Q limits will be converted to PQ buses at once. With 
a value of 2, only one will be converted before solving the power flow again. 
The second method is slower, but more robust.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Oct 17, 2014, at 3:40 AM, ambi ka  wrote:

> Sir,
> I am working with reactive power optimization. If I run GSA algorithm without 
> adding penalty terms, my power loss is less compared to the original system. 
> But if I add penalty terms for voltage violation(PQ buses), line flow 
> violation, reactive power violation(PV & Slack) and slack bus real power 
> violation, my power losses are high compared to without penalty. (Without 
> using Enforce Qlimits). What is the reason and how to correct it?
> To correct this, I tried the following.
> With Enforce Q limits set to 1, error occurs in setting ref bus.
> With Enforce q limits set to 2, no error occurs but with very low value of 
> power loss compared to without penalty?
> My program is correct or not?
> What is the difference between Enforce Q limit set to 1 or 2?
> from
> ambika
> 



Re: hello sir

2014-10-17 Thread Ray Zimmerman
I’m afraid I don’t know how to interpret that question. Each is a formulation 
of an optimization problem, where the DCOPF simply uses more modeling 
approximations, resulting in a simpler model to solve.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

On Oct 17, 2014, at 11:04 AM, priya alagumalai  wrote:

> Is there any way to convert dcopf to acopf?



Re: penalty

2014-10-20 Thread Ray Zimmerman
If you are saying that adding the penalty function (to violations of certain 
constraints, I assume? which ones?)  increases your reactive power output, I’m 
afraid I don’t have a good explanation for that. It’s also not clear which 
“outputs” are giving you “lesser values” without penalties than with. If you 
are talking about losses, that makes sense (see my explanation in a previous 
post to Ambika).

Regarding whether or not to enforce Q limits, that depends on your problem I 
suppose. In the end, I guess you want feasible solutions, so you can either 
enforce the Q limits directly, or put penalty functions on their violations.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

> On Oct 17, 2014, at 11:09 AM, nivedita arunachalam 
>  wrote:
> 
> I do powerloss optimisation which adds up the violation values. I have the 
> voltages of the gen bus as my control variable. My outputs without penalty 
> gives lesser values than with penalties.
> And i hav another ques that is while doing reactive power optimisation should 
> i enforce q limits. I refered all your previous replies and wanted your 
> suggestion regarding it.
> 
> On 17 Oct 2014 19:00, "Ray Zimmerman"  <mailto:r...@cornell.edu>> wrote:
> You’ll have to describe what you’re doing in a bit more detail for us to be 
> able to give any useful input. Presumably, you are doing an OPF with some 
> sort of modified cost function? What is the objective function?
> 
> Ray
> 
> On Oct 17, 2014, at 12:02 AM, nivedita arunachalam 
> mailto:niveditaarunacha...@gmail.com>> wrote:
> 
>> ​Dear all,
>> ​Im working with reactive power optimization on IEEE30 bus 
>> system. And I need to add penalty to my fitness function. While doing so I 
>> get maximum reactive power for all generator buses. why does this occur can 
>> anyone explain me?
>> I there any remedy for that?
> 



Re: Modifying the Power Balance Equations

2014-10-20 Thread Ray Zimmerman
Vids,

It looks correct to me. Are you sure that it isn’t just that a large amount of 
negative VArs are needed to satisfy all of the voltage and line flow 
constraints?

Ray


> On Oct 17, 2014, at 3:59 PM, vids  wrote:
> 
> Dear Dr Ray,
> 
> I was able to implement what i wanted when I said I was trying to
> implement an OPF where the real power dispatch is
> pre-determined (as in the case of an energy market where the Q
> schedules are managed separately by the transmission operator), by
> fixing the Pmin=Pmax equal to the energy schedules, and allowing only
> one "slack" bus to move, since the real power variation was only
> minimal.
> 
> Now I am trying to determine an optimum "reactive power schedule" by
> trying to simulate the given the current ancillary service payment
> arrangement here in our country. The reactive power outputs of
> generators beyond 0.9 lead and 0.85 lag are paid with fixed 4$/kVAr
> cost. All reactive power generated within these limits are not
> compensated.
> 
> So i tried to model this scenario by using a piecewise linear cost
> function for generators. The cost function below is for one specific
> generator in my data.
> 
> 1   005-784000-51.82-0.01 00
> 66.3   0.01102 4000;
> 
> Please see attached figure for the cost function I wanted to achieve.
> Basically I wanted the solution of the OPF to schedule as much MVArs
> in region A. However it seems that because of the (-) negative term
> for the reactive power absorption, it tends to schedule more MVArs in
> region B.
> 
> Did I use the piecewise linear function correctly? How can I improve
> my cost function model to achieve the least amount of VArs shceduled
> outside region A? Thank you very much Sir.
> 
> Vids
> 
> On Fri, Oct 17, 2014 at 2:52 AM, Ray Zimmerman  wrote:
>> If you used the A, l and u fields of the MATPOWER case struct (mpc) to
>> specify the constraints, then the multipliers are in …
>> 
>> results.lin.mu.l.usr
>> results.lin.mu.u.usr
>> 
>> Note that these will be relative to power in p.u. not in MW, so you’ll have
>> to divide by baseMVA to get prices in $/MW.
>> 
>> --
>> Ray Zimmerman
>> Senior Research Associate
>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>> phone: (607) 255-9645
>> 
>> 
>> On Oct 16, 2014, at 12:52 PM, vids  wrote:
>> 
>> Hi Dr Zimmerman,
>> How do i access the multipliers for the additional constraint that I
>> added? thank you
>> 
>> On Tue, Sep 2, 2014 at 10:26 PM, Ray Zimmerman  wrote:
>> 
>> Can you accomplish what you want simply by including the base dispatch in
>> the PD column of the bus matrix (where injections would appears as negative
>> loads)?
>> 
>> --
>> Ray Zimmerman
>> Senior Research Associate
>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>> phone: (607) 255-9645
>> 
>> On Aug 28, 2014, at 10:10 PM, vids  wrote:
>> 
>> Thank you very much, Dr. Shri. Yes i think your suggestion about
>> making the delta Pg as the control variables is a great idea. However
>> I am new to Matpower. Can you help me/ direct me to some examples on
>> how i can accomplish this? Thank you very much...
>> 
>> On Thu, Aug 28, 2014 at 12:23 AM, Abhyankar, Shrirang G.
>>  wrote:
>> 
>> Vids,
>> Implementing your reformulated OPF equations, written in complementarity
>> form, is non-trivial in MATPOWER as it will require modifying the
>> variable/equation sizes and muddling with the OPF data structures. Note
>> that you'll also need additional equations, perhaps expressed in
>> semi-smooth form, relating your upward/downward balancing service to
>> generator power deviation. You will have to spend some time to understand
>> the OPF data structures and how they are used in the various OPF routines.
>> 
>> One other possible way (that I think will work) is by using the real power
>> generator deviation \Delta{Pg} as the control variable instead of Pg (see
>> the attached equations).  This will keep the sizes of the
>> variables/equations for the reformulated OPF same as the original one.
>> However, you will have to modify the cost function, gradient, Hessian, and
>> the generator real power limits accordingly.
>> 
>> Shri
>> 
>> -Original Message-
>> From: vids 
>> Reply-To: MATPOWER discussion forum 
>> Date: Wed, 27 Aug 2014 16:18:14 +0800
>> To: 
>> Subject: Modifying the Power Balance Equations
>> 
>> Hi Dr Zimmerman and Matpower Community

Re: Convergence problem

2014-10-20 Thread Ray Zimmerman
Have you tried using the voltages of one of the solved cases as a starting 
point for your original case that isn’t converging?

   Ray

> On Oct 20, 2014, at 9:48 AM, Simone Cochi  wrote:
> 
> Dear all,
> I trying to run a lf on a MV network. I treat all the transformers as
> simple branch. If I use the whole case file the load flow doesn't
> converge, instead if I remove the first branch, that is the HV/MV
> transformer, and put the slack bus on bus 2 (MV busbar of the
> substation), the load flow converge. Also if I decrease the
> transformer impedance of 10 the load flow does converge. The
> transformer is a 25 MVA machine with a short circuit voltage of 14,6%
> circa. The case file is attached if someone want to check.
> 





Re: Help with running PF

2014-10-27 Thread Ray Zimmerman
In MATPOWER, this configuration has no impact on the bus matrix. You can simply 
enter both transmission lines in the branch matrix. That is the branch matrix 
will have a duplicate row. Or, if you like, you can represent it as a single 
branch with half the impedance and twice the line charging.

Ray

> On Oct 24, 2014, at 7:23 PM, Zeya Aung [11547809d]  
> wrote:
> 
> Hi all
> 
> Thanks! Someone in the mail list has solved this problem. I’ve another 
> question - I wish to know that if 2 transmission lines with the same 
> parameters connect two buses, can i take the equivalent impedance to be half 
> of a line? How can i represent the double circuit connection in the bus 
> matrix? I need to form the bus matrix (which requires equivalent impedance 
> between two buses). 
> 
> please see attached picture. 
> 
> Best
> Zeya
> 
> On 22 Oct, 2014, at 10:14 pm, Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> 
>> Zeya,
>> 
>> First of all, please continue to address your MATPOWER questions to the 
>> MATPOWER mailing list <http://www.pserc.cornell.edu/matpower/#mailinglist>, 
>> not to me directly.
>> 
>> Are you using the charging susceptance to compute the value, as opposed to 
>> the series susceptance?
>> 
>> Ray
>> 
>> 
>> 
>> 
>> 
>>> On Oct 22, 2014, at 12:28 AM, Zeya Aung [11547809d] 
>>> mailto:zya@connect.polyu.hk>> wrote:
>>> 
>>> Thank you Ray.
>>> 
>>> Can you also help me on with the “b” (per unit) value of the line matrix 
>>> please? I’ve been getting values way above 1, which has to be wrong. I’ve 
>>> the r and x pu value as attached in the picture. Many thanks!
>>> 
>>> 
>>> 
>>> 
>>> Best
>>> Zeya
>>> 
>>> On 21 Oct, 2014, at 8:44 pm, Ray Zimmerman >> <mailto:r...@cornell.edu>> wrote:
>>> 
>>>> (please continue to address your MATPOWER questions to the MATPOWER 
>>>> mailing list <http://www.pserc.cornell.edu/matpower/#mailinglist>)
>>>> 
>>>> In the power flow problem, the demand and generation (except at the slack 
>>>> bus) are assumed to be given. So, you can solve the power flow without 
>>>> generator costs if you SPECIFY the generator outputs, but if you want to 
>>>> compute generator outputs, you’ll have to use some other criteria (like 
>>>> and OPF minimizing cost) to determine the generation. Otherwise you 
>>>> haven’t given enough information.
>>>> 
>>>> Ray
>>>> 
>>>> 
>>>>> On Oct 21, 2014, at 3:47 AM, Zeya Aung [11547809d] 
>>>>> mailto:zya@connect.polyu.hk>> wrote:
>>>>> 
>>>>> Hi Sir
>>>>> 
>>>>> I’ve the generator, load and transmission line parameters ready in mat 
>>>>> power format as attached in this email. Is it possible to run the power 
>>>>> flow program to get the values for the power generated, demanded, and the 
>>>>> voltage + angle at each bus? Can i get the  power flow without the 
>>>>> generation cost functions?
>>>>> 
>>>>> Many thanks
>>>>> 
>>>>> 
>>>>> 
>>>>> Best
>>>>> Zeya
>>>>> >>>> 3.46.43 pm.png>
>>>>>
>>>>> -
>>>>>  
>>>>> Disclaimer:
>>>>> 
>>>>> 
>>>>> This message (including any attachments) contains confidential 
>>>>> information intended for a specific individual and purpose. If you are 
>>>>> not the intended recipient, you should delete this message and notify the 
>>>>> sender and The Hong Kong Polytechnic University (the University) 
>>>>> immediately. Any disclosure, copying, or distribution of this message, or 
>>>>> the taking of any action based on it, is strictly prohibited and may be 
>>>>> unlawful.
>>>>> 
>>>>> The University specifically denies any responsibility for the accuracy or 
>>>>> quality of information obtained through University E-mail Facilities. Any 
>>>>> views and opinions expressed are only those of the author(s) and do not 
>>>>> necessarily represent tho

Re: How to decouple case data into multi areas in MatPower

2014-10-27 Thread Ray Zimmerman
I don’t have time to read the paper, so I’m not sure what the definition of 
“area” is in this context, but you can certainly assign buses to whatever 
definition of non-overlapping areas you choose. This has no effect on the 
physical system, however, and is just essentially a grouping and labeling 
convention that could be useful for certain applications. So, I’m not quite 
sure what you mean by being able to “decouple the system into multi areas”.

   Ray


> On Oct 24, 2014, at 10:54 PM, Gelli Ravikumar  
> wrote:
> 
> Dear Sir/s,
> 
> In the literature, I have found a paper titled "Multiarea State Estimation 
> Using Synchronized Phasor Measurements", attached for your kind perusal. I'm 
> trying to implement the IEEE 118 case system in accordance with the 
> methodology proposed in the paper. But, I''m finding difficulties in 
> developing a program (matlab based) for decoupling the case118.m 
> (ref:MatPower) system into multi area system as mentioned in the paper. In 
> the paper, Fig. 6 directly shows the multi area depiction of the case 118 
> system. Can anyone help me on how to prepare an algorithm so that, we can 
> decouple the system into multi areas. Or else, Is there any provision in the 
> MatPower to identify multi-areas in a system as mentioned in the paper.
> 
> 
> 
> 
> --
> with Regards
> 
> Gelli Ravikumar
> Research Scholar (Ph.D), 
> Field Computations Lab,
> Dept. of Electrical Engineering,
> IIT Bombay, Powai, Mumbai 400076
> Ph: 022-2576 4424, 089 765 983 96
> 
> Gandhian Young Technological Innovation Award - 2013
> POSOCO Power System Award: PPSA - 2013
> IITB PhD Executive Member - 2013-14
> IITB SARC Core Technical Member - 2014-15
> 
> 
> 





Re: How to report issues with cdf2matp and psse2mpc?

2014-10-28 Thread Ray Zimmerman
If it is a matter of simple individual bug or two, it’s fine to simply post it 
here. I suppose if it is more extensive, it would make more sense just to send 
the details to me directly off list.

And please know, that I do really appreciate anyone taking the time to report 
bugs and fixes. It is something we all benefit from.

Thanks,

Ray

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


> On Oct 28, 2014, at 5:01 AM, Jose Luis Marin  wrote:
> 
> Hello,
> 
> I'm testing and benchmarking various powerflows, and I'm finding some issues 
> with the format conversions performed by cdf2matp and psse2mpc.  I was 
> wondering, what is the preferred way that the authors would like to receive 
> bug reports / patches?
> 
> [Disclaimer: I work for a company making a powerflow product]
> 
> Thanks,
> 
> JL
> -- 
> Jose L. Marin
> Gridquant España SL
> Grupo AIA
> 



Re: How to report issues with cdf2matp and psse2mpc?

2014-10-29 Thread Ray Zimmerman
Thanks Jose. Good catch.

It turns out I had already run into this bug and fixed it for the next 5.0 
release.

   Ray


> On Oct 28, 2014, at 11:35 AM, Jose Luis Marin  wrote:
> 
> 
> Thanks, Ray.  I am testing things with the latest Beta.  In the case of 
> psse2mpc, I have found this one: for PSS/E formats v29-30, the bus angles 
> were not being parsed correctly:
> 
> ===
> $ diff -u psse_convert.m.ORIG psse_convert.m
> --- psse_convert.m.ORIG2014-05-06 15:58:12.0 +0200
> +++ psse_convert.m2014-10-27 17:04:05.0 +0100
> @@ -107,7 +107,7 @@
>  numbus(:, [1:9 11:12]);
>  elseif rev < 31 %% includes GL, BL
>  bus(:, [BUS_I BASE_KV BUS_TYPE GS BS BUS_AREA ZONE VM VA]) = ...
> -numbus(:, [1 3 4 5 6 7 8 9 6]);
> +numbus(:, [1 3 4 5 6 7 8 9 10]);
>  else
>  bus(:, [BUS_I BUS_TYPE BUS_AREA VM VA BASE_KV ZONE]) = ...
>  numbus(:, [1 4 5 8 9 3 6]);
> 
> ===
> 
> In the case of cdf2matp, I have found some others, but they are are probably 
> more involved (and some of them not clear if they're a feature), so I will be 
> sending those directly to you.
> 
> Thanks,
> 
> JL
> -- 
> Jose L. Marin
> Gridquant España SL
> Grupo AIA
> 
> 
> 
> On Tue, Oct 28, 2014 at 3:17 PM, Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> If it is a matter of simple individual bug or two, it’s fine to simply post 
> it here. I suppose if it is more extensive, it would make more sense just to 
> send the details to me directly off list.
> 
> And please know, that I do really appreciate anyone taking the time to report 
> bugs and fixes. It is something we all benefit from.
> 
> Thanks,
> 
> Ray
> 
> -- 
> Ray Zimmerman
> Senior Research Associate
> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
> phone: (607) 255-9645
> 



Re: adding penalty factor to the obj function

2014-10-29 Thread Ray Zimmerman
It turns out that I was recently faced with a similar situation, so I 
implemented another MATPOWER extension to convert the limits on certain lines 
to soft limits, with a simple linear cost on line violations. I plan to include 
it in the final release of MATPOWER 5, but I will send it to you off-list now. 
Hopefully, it does exactly what you want.

Sorry for the lack of good clear examples in the manual of adding additional 
costs, constraints. I hope to remedy that at some point. For the time being, 
there is an example buried in the test suite, starting around line 185 in 
t/t_opf_mips.m.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

> On Oct 29, 2014, at 11:03 AM, mohd  wrote:
> 
> Good Morning all,
>  
> I am using a DC OPF to be tested in a real case system. However, the problem 
> does not converge. However, if i remove transmission constraint, then the 
> problem is solved. Upon further inspection, i found some lines are violating 
> the constraint. When checking the high concentrated load area, i found the 
> least resistance path carries the most amount of the flow, while the high 
> resistance path carries less, which is logical and well-known. Now, what I am 
> trying to do is to add a penalty function when lines exceeds their capacity 
> to encourage the flow to the high resistance path, which is taken care of by 
> the OPF since it tries to minimize the obj function. Since line limits are 
> already included as part of my OPF in matpower, my understanding is that i 
> need to add penalty function to the objective function only. If so, when i 
> followed the manual, i kind of got lost with several matrices that needs to 
> be created and defined and i wish that matpower showed an example of 
> modifying the objective function, so i can follow and make an analogy. So, i 
> appreciate any help that can be provided or direction that can lead me to an 
> example that can be easily followed. Thanks.



Re: get DC power flow matrix in IEEE 14 bus system from matpower

2014-10-29 Thread Ray Zimmerman
Since case14 already has consecutively numbered buses starting at 1, you don’t 
need to worry about conversions to and from internal indexing.

So, for the PTDF matrix …

  mpc = loadcase('case14');
  PTDF = makePTDF(mpc.baseMVA, mpc.bus, mpc.branch);

For the B matrix …

  [Bbus, Bf, Pbusinj, Pfinj] = makeBdc(mpc.baseMVA, mpc.bus, mpc.branch);

Hope this helps,

Ray


> On Oct 29, 2014, at 12:11 PM, Song Tan  wrote:
> 
> Hello All,
>   I am new to matpower and was wondering whether someone can give me some 
> sample codes to get the DC power flow matrix of IEEE 14 system.
> 
>   Specifically, what parameters I should pass to function makeBdc or 
> makePTDF?  And how should I get those parameters from the loadcase('case14')?
>   
>   I really appreciate any hints, thanks!
> 
> Best,
>  Song Tan



Re: Minimization of the exchanged power

2014-11-04 Thread Ray Zimmerman
You should be able to accomplish this simply by combining the two kinds of 
costs in your objective function.

To minimize transmission losses, see FAQ #1 
<http://www.pserc.cornell.edu/matpower/#faq>.
To minimize flow on a particular branch (or set of branches), you need a way to 
put a cost on a flow. This discussion 
<http://www.mail-archive.com/matpower-l@cornell.edu/msg03558.html> on relaxing 
branch flow limits and placing penalties on violations introduces optimization 
variables (available for imposing costs) that are equal to line flows. You 
could use a similar technique here.

You can adjust the tradeoff between the two objectives by the relative costs 
used for the flows vs. the generation.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


> On Oct 31, 2014, at 5:41 AM, Simone Cochi  wrote:
> 
> Dear all,
> I'm working on dispatchable loads on distribution network. The network
> I'm studying has a huge reverse power flow from the MV to the HV. I
> would like to implement an multi-objective function by witch I would
> to minimize the reverse power flow and grid losses. Any inputs about
> how to implement it in Matpower?
> 
> Thank you
> 



Re: save constraints

2014-11-04 Thread Ray Zimmerman
What do you mean by “save all constraints”? If you mean save the pretty-printed 
output, you can simply supply filename to runopf() in the 3rd argument. If you 
mean collect the indexes of binding constraints, then I suggest you use the 
find() command on the constraint multipliers of interest (see Table 6-1 in the 
User’s Manual <http://www.pserc.cornell.edu/matpower/manual.pdf> for details on 
where to find the constraints).

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

> On Oct 31, 2014, at 8:06 AM, Abdel-Fattah El-Adl  wrote:
> 
> Dear all
> How i can save all constraints which printed in multi-runopf
> 
> Best regards 
> =
> Abdel-Fattah El-Adl
> Associate Lecturer
> Mansoura University 
> Faculty of Engineering 
> Electrical Engineering Dept.  
> Mansoura - Egypt 
> Tel   :  +20127074312 
> Fax  :  +2050-2244690 
> e-mail:  elad...@yahoo.com <mailto:elad...@yahoo.com>
>   elad...@mans.edu.eg <mailto:elad...@mans.edu.eg>
>   elad...@gmail.com <mailto:elad...@gmail.com>
> =



Re: incorporating N-1 contingency

2014-11-04 Thread Ray Zimmerman
MATPOWER does not include a facility for automatic N-1 contingency analysis. 
You can however, implement your own brute force checking of contingencies by, 
one-by-one, changing the status to zero (mpc.branch(k, BR_STATUS) or mpc.gen(k, 
GEN_STATUS)) on the line or generator taken out by the contingency in question. 
Beware of creating isolated buses or islands when taking out lines. The 
find_islands() function may be helpful there.

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645

> On Nov 2, 2014, at 7:25 AM, abhisek mishra  <mailto:abhisek005mis...@gmail.com>> wrote:
> 
> Dear all,
> I am a new user of matpower. Can anyone guide me in how to incorporate N-1 
> contingency using matpower???
> 
> Thank you.
> 
> Abhisek



Re: Help with incomplete real case data

2014-11-04 Thread Ray Zimmerman
I agree with Uriel that many of these parameters cannot simply be assumed 
without more information about the system. You can make up numbers, but the OPF 
results will be garbage. I think you need more information.

   Ray 


> On Nov 3, 2014, at 8:55 AM, Zeya Aung [11547809d]  
> wrote:
> 
> Thanks Ureil!
> 
> Do you have some reference to support the Qmin= -1/3 Qmax assumption? If it 
> is a good approximation used in the industry, i think it’s justified to make 
> this assumption in my project.
> 
> What do you think should i assume the values of RateA B C for the Matpower 
> case format branch data?
> 
> Many thanks.
> Will appreciate if anyone else has some comments on my 4 problems.
> 
> Best
> Zeya
> 
> On 3 Nov, 2014, at 9:22 pm, Uriel Fernando Sandoval  
> wrote:
> 
>> Hi Zeya,
>> 
>> 
>> I’ll try to answer some of your questions:
>> 
>> 1) Reactive power consumption (Qmin) is typically smaller than Qmax. 
>> Sometimes a good approximation is to take Qmin= -1/3 Qmax, but to a better 
>> assumptions you have to look at the generator’s capability curve.
>> 
>> 2) If you are doing PF analysis you don’t need these parameters. But in my 
>> opinion the line’s capacity typically are between 25-1000 MW. This parameter 
>> depends on the physical construction of the line and i think you can’t 
>> assume it.
>> 
>> 3) The best way is to use either pice-wise or quadratical convex functions. 
>> If you have a set of points that represent the generator cost under 
>> different powers, you can approximate this set to a quadratical function 
>> using least squares regression.
>> 
>> 4) This data is very important and you should not assume it.  if you can 
>> obtain the cost functions you should run an OPF to dispatch active power 
>> generation and then you will have a base case to perform all your steady 
>> state analysis.
>> 
>> 
>> Best regards,
>> 
>> Uriel
>> 
>> 
>> 
>> 
>> 
>> 
>>> El 02/11/2014, a las 14:09, Zeya Aung [11547809d] 
>>>  escribió:
>>> 
>>> Anyone help with this question please….? Really need some feedback to 
>>> continue my work.
>>> 
>>> Many thanks guys!!!
>>> 
>>> Best
>>> Zeya
>>> 
>>> On 24 Oct, 2014, at 12:22 am, Zeya Aung <115478...@connect.polyu.hk> wrote:
>>> 
 Hey guys
 
 I’m missing some data in my real case analysis. Please advise on the best 
 approximation methods and assumptions.
 
 1) Generator (min and max Q limit) - I’ve the power factor and capacity, 
 and i suppose the max Q generation can be assumed using the p.f, but how 
 about min Q?
 2) Line transfer capacity - I’ve all the impedance, susceptance, and 
 length, should i set 9900 in rateA of manpower format? Is this realistic?
 3) Generator cost functions - for hydropower, coal power and natural gas 
 turbines, how can i best approximate the cost functions?
 4) I’ve the load profile (i.e. max load per month at transformers) but i 
 do not have the generator data supplying this load. What can i do about 
 this considering there are no accurate generation cost functions to run a 
 optimal power flow and get a steady state solution?
 
 Many thanks.
 
 
 
 Best
 Zeya
 
>>> 
>>> 
>>> -
>>>  Disclaimer:
>>> 
>>> This message (including any attachments) contains confidential information 
>>> intended for a specific individual and purpose. If you are not the intended 
>>> recipient, you should delete this message and notify the sender and The 
>>> Hong Kong Polytechnic University (the University) immediately. Any 
>>> disclosure, copying, or distribution of this message, or the taking of any 
>>> action based on it, is strictly prohibited and may be unlawful.
>>> 
>>> The University specifically denies any responsibility for the accuracy or 
>>> quality of information obtained through University E-mail Facilities. Any 
>>> views and opinions expressed are only those of the author(s) and do not 
>>> necessarily represent those of the University and the University accepts no 
>>> liability whatsoever for any losses or damages incurred or caused to any 
>>> party as a result of the use of such information.
>>> 
>>> 
>> 
>> 
>> 
> 
>   
> -
>Disclaimer:
> 
> This message (including any attachments) contains confidential information 
> intended for a specific individual and purpose. If you are not the intended 
> recipient, you should delete this message and notify the sender and The Hong 
> Kong Polytechnic University (the University) immediately. Any disclosure, 
> copying, or distribution of this message, or the taking of any action based 
> on it, is strictly pr

Re: PQ Capability HVDC Converter

2014-11-04 Thread Ray Zimmerman
Hi Christian,

See Table B-5 in the User’s Manual 
. I think the QMINF, QMAXF, 
QMINT, QMAXT are the parameters you are looking for, right?

   Ray


> On Nov 4, 2014, at 3:54 AM, Christian Orberger 
>  wrote:
> 
> Hi Uriel,
> 
> thank you for your answer. 
> I saw in the user manual under point 7.5.3 "DC Transmission lines" that DC 
> Lines are implemented with "Dummy Generators". I would assume that these 
> dummy Generators can be seen in general as Converters. So, I think I just 
> have to put constraints on these dummy generators. But where are these 
> constraints defined or in other words: are there already constraints at all? 
> What do you think about my thoughts? Would you agree?
> 
> From: uriel_sando...@ieee.org 
> Subject: Re: PQ Capability HVDC Converter
> Date: Mon, 3 Nov 2014 07:02:30 -0600
> To: matpowe...@list.cornell.edu 
> 
> Hi Christian,
> 
> 
> As far as i know, matpower does not include FACTS devices (such HVDC), you 
> will have to code it.
> 
> Best regards,
> 
> Uriel
> 
> El 03/11/2014, a las 6:51, Christian Orberger  > escribió:
> 
> Hello,
> 
> I want to extend the P-Q constraints of an HVDC Converter in the OPF in 
> Matpower. My question is, if there already are any constraints regarding 
> these converters in the OPF and if yes, where I can find them in the 
> programm? Or do I have to implement completely new constraints?
> Thank you for your help!
> 
> Best regards,
> Christian



Re: Way to avoid the pretty-printing of results on the Command Window

2014-11-04 Thread Ray Zimmerman
Marco,

What you want to do is not currently possible simply by setting an option (and 
I consider this a bug worth fixing). But this is the great thing about 
open-source software, you can very trivially make a modification to suit your 
needs.

In your case, an easy fix would be to make a copy of runpf.m under a different 
name, and comment out the second call to printf() (line 357 in my current 
version), and then call this function instead of runpf().

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


> On Nov 3, 2014, at 10:29 AM, Simone Cochi  wrote:
> 
> I've never used it before but maybe the MP function printpf could fit
> your needs.
> 
> 
> 
> 2014-11-03 15:11 GMT+01:00 Marco Barbetta :
>> Thank you for answers, but i'm looking for a way to avoid the
>> pretty-printing of results ONLY on command window, while i need to store the
>> results (pretty - printed) for each cycle in text (and .mat) files. I know
>> that results can be stored in the "results" struct, but i'd prefer another
>> copy in .txt files.
>> 
>> Is it possible?
>> 
>> Thanks,
>> 
>> Marco Barbetta
>> 
>> 2014-11-03 14:59 GMT+01:00 Simone Cochi :
>>> 
>>> mpopt=mpoption('verbose',0,'out.all',0)
>>> 
>>> 
>>> 2014-11-03 14:51 GMT+01:00 Marco Barbetta :
>>>> Dear collegues,
>>>> 
>>>> i'm implementing a code on MatLab, using MATPOWER, and i have to do a
>>>> huge
>>>> number of for-cycles: at the end of every cycle, i have to print the
>>>> results
>>>> on two files (.txt and .mat) in automatic, through the command below:
>>>> 
>>>> results = runpf(mpc,mpopt,['Risultati_step_' num2str(k)
>>>> '.txt'],['Risultati_step_' num2str(k) '.mat']);
>>>> 
>>>> At every cycle, MATPOWER prints the results also in the Command Window.
>>>> I'm
>>>> finding a way to avoid the pretty-printing of results on the Command
>>>> Window,
>>>> in order to visualize properly some warnings and "flags" that i have
>>>> positioned in the code.
>>>> 
>>>> Can you help me? I'm searching in the Manual (appendix C - MATPOWER
>>>> options)
>>>> but i could not find the answer, yet.
>>>> 
>>>> Best regards,
>>>> 
>>>> Marco Barbetta
>>> 
>> 
> 



Re: What is the syntax used for fast decoupled load flow?

2014-11-04 Thread Ray Zimmerman
See the first example in section 2.3.4 in the User’s Manual 
 on Setting Options.

Ray


> On Nov 3, 2014, at 10:32 AM, vivek rastogi  wrote:
> 
> From
> Vivek Rastogi
> NIT Hamirpur
> Sent from my Nokia phone
> 
> 



Re: PQ Capability HVDC Converter

2014-11-05 Thread Ray Zimmerman
Hi Christian,

But it is precisely these values of the dcline field that are used to set the 
corresponding parameters for the dummy generators in a consistent way. 
Regarding your specific example of line 157, since the PG values of the pair of 
dummy generators are linked via an equality constraint, it is sufficient to 
include finite PMIN and PMAX on only one of the dummy generators (to avoid 
redundant constraints and splitting of shadow prices, etc.). In the case of 
QMIN and QMAX, as you can see in lines 195-198, the values I mentioned are used 
directly to set the QMIN and QMAX of the corresponding dummy generators.

Ray



> On Nov 5, 2014, at 6:20 AM, Christian Orberger 
>  wrote:
> 
> Hi Ray,
> 
> thank your for this hint. 
> It weren't these variables, but the variables of the dummy generators, which 
> are added in "toggle_dcline" from line 153. There I would like to define 
> constraints of the variables "PMAX, PMIN, QMAX, QMIN" of the dummy 
> generators. E.g. not fg(:, PMIN) = -inf; (line 157 ), but fg(:, PMIN) 
> = -2*x^2; (Just an example. That equation doesn't have to make 
> sense.) The same I would do for QMIN/MAX. 
> 
> Thank you for every help.
> Christian
> 
> From: r...@cornell.edu 
> Subject: Re: PQ Capability HVDC Converter
> Date: Tue, 4 Nov 2014 11:19:47 -0500
> To: matpowe...@list.cornell.edu 
> 
> Hi Christian,
> 
> See Table B-5 in the User’s Manual 
> . I think the QMINF, QMAXF, 
> QMINT, QMAXT are the parameters you are looking for, right?
> 
>Ray
> 
> 
> On Nov 4, 2014, at 3:54 AM, Christian Orberger 
> mailto:christian.orber...@outlook.com>> 
> wrote:
> 
> Hi Uriel,
> 
> thank you for your answer. 
> I saw in the user manual under point 7.5.3 "DC Transmission lines" that DC 
> Lines are implemented with "Dummy Generators". I would assume that these 
> dummy Generators can be seen in general as Converters. So, I think I just 
> have to put constraints on these dummy generators. But where are these 
> constraints defined or in other words: are there already constraints at all? 
> What do you think about my thoughts? Would you agree?
> 
> From: uriel_sando...@ieee.org 
> Subject: Re: PQ Capability HVDC Converter
> Date: Mon, 3 Nov 2014 07:02:30 -0600
> To: matpowe...@list.cornell.edu 
> 
> Hi Christian,
> 
> 
> As far as i know, matpower does not include FACTS devices (such HVDC), you 
> will have to code it.
> 
> Best regards,
> 
> Uriel
> 
> El 03/11/2014, a las 6:51, Christian Orberger  > escribió:
> 
> Hello,
> 
> I want to extend the P-Q constraints of an HVDC Converter in the OPF in 
> Matpower. My question is, if there already are any constraints regarding 
> these converters in the OPF and if yes, where I can find them in the 
> programm? Or do I have to implement completely new constraints?
> Thank you for your help!
> 
> Best regards,
> Christian



Re: Order of data in mpc struct affect MatPower functionalities?

2014-11-10 Thread Ray Zimmerman
The (external) bus numbers used in the bus, gen, and branch matrices in your 
case file are simply unique integer IDs for the buses and are completely 
independent from any ordering of the rows of any of the matrices. The only 
significance of the ordering is that the output and results will appear in the 
same order as the inputs. So any correspondence between the external bus 
numbers and the row number in the matrix is completely coincidental.

Ray

-- 
Ray Zimmerman
Senior Research Associate
B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
phone: (607) 255-9645


> On Nov 9, 2014, at 2:44 PM, Abhyankar, Shrirang G.  
> wrote:
> 
> Try it out and send an email if you encounter errors.
> 
> Shri
> 
> From: Marco Barbetta  <mailto:marco.barbetta1...@gmail.com>>
> Reply-To: MATPOWER discussion forum  <mailto:matpowe...@list.cornell.edu>>
> Date: Sun, 9 Nov 2014 17:41:24 +0100
> To: MATPOWER discussion forum  <mailto:matpowe...@list.cornell.edu>>
> Subject: Re: Order of data in mpc struct affect MatPower functionalities?
> 
> Thank you again! What about generators' order?
> 
> 2014-11-09 17:28 GMT+01:00 Abhyankar, Shrirang G.  <mailto:abhy...@mcs.anl.gov>>:
> The branch "from bus" and "to bus" numbers don't need to be sorted.
> 
> Shri
> 
> From:  Marco Barbetta  <mailto:marco.barbetta1...@gmail.com>>
> Reply-To:  MATPOWER discussion forum  <mailto:matpowe...@list.cornell.edu>>
> Date:  Sun, 9 Nov 2014 17:13:58 +0100
> To:  MATPOWER discussion forum  <mailto:matpowe...@list.cornell.edu>>
> Subject:  Re: Order of data in mpc struct affect MatPower functionalities?
> 
> 
> >Thank you for your answer. Did you try to change branches' order instead
> >of bus order?
> >
> >2014-11-09 16:07 GMT+01:00 Abhyankar, Shrirang G.  ><mailto:abhy...@mcs.anl.gov>>:
> >
> >I don't think there should be any issue even if the bus numbers are
> >unsorted. I tested it with case9.m and there weren't any errors.
> >
> >Shri
> >
> >From: Marco Barbetta  ><mailto:marco.barbetta1...@gmail.com>>
> >Reply-To: MATPOWER discussion forum  ><mailto:matpowe...@list.cornell.edu>>
> >Date: Sat, 8 Nov 2014 12:34:00 +0100
> >To: mailto:matpower-l@cornell.edu>>
> >Subject: Order of data in mpc struct affect MatPower functionalities?
> >
> >
> >
> >Dear collegues,
> >
> >i would like to ask a simple question about the order of data in the mpc
> >struct.
> >
> >Every "caseXXX.m" that i analyzed presents bus, generators and branches
> >in ascending order, for example in "case_ieee30.m":
> >
> >mpc.bus = [
> >13 00 00 11.06 0132 1
> >22 21.712.7 00 11.043 -5.48132 1
> >31 2.41.2 00 11.021 -7.96132 1
> >
> >mpc.gen = [
> >1260.2 -16.110 01.06 1001 360.2
> >240 5050 -401.045 1001 140
> >50 3740 -401.01 1001 100
> >
> >mpc.branch = [
> >12 0.01920.0575 0.05289900
> >13 0.04520.1652 0.04089900
> >24 0.0570.1737 0.03689900
> >34 0.01320.0379 0.00849900
> >25 0.04720.1983 0.04189900
> >
> >
> >For my master thesis i'm implementing a code to import datas in a certain
> >format from a Excel file in order to "create" (or, better, overwrite) a
> >mpc struct. My question is: if i don't put datas in ascending order, but
> >in "sparse" order, for example:
> >
> >mpc.branch = [
> >211212 0.01920.0575 0.05289900
> >123 0.04520.1652 0.04089900
> >
> >170 1710.0452 0.16520.0408 9900
> >
> >
> >MatPower funcionalities and behavior will suffer?
> >
> >Obviously the question is about the order of the matrix's rows: in case
> >of "switch" of the matrix's rows, other datas (BR_R , BR_X , BR_B , ecc)
> >must follow their row, and my code makes sure that this happens.
> >
> >Thank you in advance for your help.
> >
> >Best regards,
> >
> >Marco Barbetta
> >
> >
> >
> >
> >
> >
> >
> >
> >
> 
> 
> 
> 



Re: save constraints

2014-11-10 Thread Ray Zimmerman
Please clarify what you mean by “convert the dcopf codings into acopf”. Both 
ACOPF and DCOPF are optimization problems that MATPOWER can attempt to solve 
given the required data in MATPOWER format.

   Ray


> On Nov 9, 2014, at 9:30 AM, priya alagumalai  wrote:
> 
> Hello sir,
> 
> Is there any possibility to convert the dcopf codings into acopf?
> 
> On 11/4/14, Ray Zimmerman  wrote:
>> What do you mean by “save all constraints”? If you mean save the
>> pretty-printed output, you can simply supply filename to runopf() in the 3rd
>> argument. If you mean collect the indexes of binding constraints, then I
>> suggest you use the find() command on the constraint multipliers of interest
>> (see Table 6-1 in the User’s Manual
>> <http://www.pserc.cornell.edu/matpower/manual.pdf> for details on where to
>> find the constraints).
>> 
>> --
>> Ray Zimmerman
>> Senior Research Associate
>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>> phone: (607) 255-9645
>> 
>>> On Oct 31, 2014, at 8:06 AM, Abdel-Fattah El-Adl 
>>> wrote:
>>> 
>>> Dear all
>>> How i can save all constraints which printed in multi-runopf
>>> 
>>> Best regards
>>> =
>>> Abdel-Fattah El-Adl
>>> Associate Lecturer
>>> Mansoura University
>>> Faculty of Engineering
>>> Electrical Engineering Dept.
>>> Mansoura - Egypt
>>> Tel   :  +20127074312
>>> Fax  :  +2050-2244690
>>> e-mail:  elad...@yahoo.com <mailto:elad...@yahoo.com>
>>>  elad...@mans.edu.eg <mailto:elad...@mans.edu.eg>
>>>  elad...@gmail.com <mailto:elad...@gmail.com>
>>> =
>> 
>> 
> 
> 
> -- 
> <http://sig.graphicsfactory.com/>
> Emoticons <http://sig.graphicsfactory.com/>
> 
> 





Re: Converting DCOPF code to ACOPF

2014-11-10 Thread Ray Zimmerman
Sorry, Shri, I didn’t realize you’d responded to this … and yes, I agree about 
not hi-jacking threads.

Ray


> On Nov 9, 2014, at 10:19 AM, Abhyankar, Shrirang G.  
> wrote:
> 
> No, this is not possible. There are fundamental differences between the
> two in terms of assumptions and the way they get solved.
> 
> Shri
> 
> Please do not hijack a thread and start a new topic on it. It is important
> to maintain subject relevance of email threads so that it can be easily
> accessed later
> via https://www.mail-archive.com/matpower-l@cornell.edu/
> 
> -Original Message-
> From: priya alagumalai 
> Reply-To: MATPOWER discussion forum 
> Date: Sun, 9 Nov 2014 20:00:46 +0530
> To: MATPOWER discussion forum 
> Subject: Re: save constraints
> 
>> Hello sir,
>> 
>> Is there any possibility to convert the dcopf codings into acopf?
>> 
>> On 11/4/14, Ray Zimmerman  wrote:
>>> What do you mean by ³save all constraints²? If you mean save the
>>> pretty-printed output, you can simply supply filename to runopf() in
>>> the 3rd
>>> argument. If you mean collect the indexes of binding constraints, then I
>>> suggest you use the find() command on the constraint multipliers of
>>> interest
>>> (see Table 6-1 in the User¹s Manual
>>> <http://www.pserc.cornell.edu/matpower/manual.pdf> for details on where
>>> to
>>> find the constraints).
>>> 
>>> --
>>> Ray Zimmerman
>>> Senior Research Associate
>>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>>> phone: (607) 255-9645
>>> 
>>>> On Oct 31, 2014, at 8:06 AM, Abdel-Fattah El-Adl 
>>>> wrote:
>>>> 
>>>> Dear all
>>>> How i can save all constraints which printed in multi-runopf
>>>> 
>>>> Best regards
>>>> =
>>>> Abdel-Fattah El-Adl
>>>> Associate Lecturer
>>>> Mansoura University
>>>> Faculty of Engineering
>>>> Electrical Engineering Dept.
>>>> Mansoura - Egypt
>>>> Tel   :  +20127074312
>>>> Fax  :  +2050-2244690
>>>> e-mail:  elad...@yahoo.com <mailto:elad...@yahoo.com>
>>>>  elad...@mans.edu.eg <mailto:elad...@mans.edu.eg>
>>>>  elad...@gmail.com <mailto:elad...@gmail.com>
>>>> =
>>> 
>>> 
>> 
>> 
>> -- 
>> <http://sig.graphicsfactory.com/>
>> Emoticons <http://sig.graphicsfactory.com/>
>> 
>> 
> 
> 
> 





Re: loss sensitivity factor

2014-11-11 Thread Ray Zimmerman
I just finished adding a get_losses() function for MATPOWER 5 and the test file 
for it (both of which I will send to you off-list) has some code to compute 
loss sensitivity factors.

   Ray



> On Nov 5, 2014, at 9:54 AM, nivedita arunachalam 
>  wrote:
> 
> Dear all,
>   I’m working with reactive power optimization; in with I’m going to
> integrate renewable energy. I’m in need to calculate the loss
> sensitivity factor (LSF) for placement of the renewable. Can anyone
> help me find the values for the LSF in matpower.
> 
> 
> Please anyone reply as soon as possible.
> 
> -- 
> *Nivedita.*
> 
> 



Re: Subtle bug in runpf when enforcing q_lims (strange behavior of MATLAB's union)

2014-11-11 Thread Ray Zimmerman
Good catch … and thanks for the detailed description and patch. I ended up 
simply doing …

infeas = union(mx', mn')’;

… which I think should handle the problem as well. Matlab’s union returns a row 
or column vector depending on whether the inputs are rows or columns. But if 
they’re scalars, then it has to default to something, and they chose “row”, 
which I obviously never checked.

Thanks again,

   Ray


> On Nov 11, 2014, at 11:04 AM, Jose Luis Marin  wrote:
> 
> [I'm re-sending this to the list, I don't think it got through the first time]
> 
> Hello Ray,
> 
> I think I've stumbled upon a bug. It appears when enforcing generator q_lims, 
> but only when there's exactly *one* generator violating the QMAX constraint 
> AND *one* generator violating the QMIN constraint. Here's the error:
> 
> Error using  == 
> Matrix dimensions must agree.
> 
> Error in runpf (line 250)
> if length(infeas) == length(remaining) && all(infeas == 
> remaining)
> 
> 
> I think this happens because of the weird behavior of MATLAB's union.  Have a 
> look at line 246 in runpf.m:
> 
> infeas = union(mx, mn);
> 
> Variables mx and mn are normally column vectors, in which case their union is 
> also a column vector.  But if *both* mx and mn happen to be scalars, then the 
> result of the union is a *row* vector (go figure).
> 
> I don't know if there's an elegant solution to this, but I just went ahead 
> with the simple patch that I'm attaching here.
> 
> Regards,
> 
> -- 
> Jose L. Marin
> Gridquant España SL
> Grupo AIA
> 
> 



Re: violated flow limit in power flow solution (was: save constraints)

2014-11-14 Thread Ray Zimmerman
The short answer is … redispatch your generators to decrease the flow on that 
line.

However, assuming it is possible at all, there are probably an infinite number 
of ways of redispatching your generation to meet that goal. An OPF is one 
method of redispatching to ensure all flow limits are respected.

Ray


> On Nov 13, 2014, at 7:20 AM, priya alagumalai  
> wrote:
> 
> Sir,
> i have simply run a power flow for "case_ieee30".. But,the line 1-2
> exceeds the flow limit under this condition...
> What's the solution for this?
> 
> 
> On 11/11/14, Ray Zimmerman  wrote:
>> Please clarify what you mean by “convert the dcopf codings into acopf”. Both
>> ACOPF and DCOPF are optimization problems that MATPOWER can attempt to solve
>> given the required data in MATPOWER format.
>> 
>>   Ray
>> 
>> 
>>> On Nov 9, 2014, at 9:30 AM, priya alagumalai 
>>> wrote:
>>> 
>>> Hello sir,
>>> 
>>> Is there any possibility to convert the dcopf codings into acopf?
>>> 
>>> On 11/4/14, Ray Zimmerman  wrote:
>>>> What do you mean by “save all constraints”? If you mean save the
>>>> pretty-printed output, you can simply supply filename to runopf() in the
>>>> 3rd
>>>> argument. If you mean collect the indexes of binding constraints, then I
>>>> suggest you use the find() command on the constraint multipliers of
>>>> interest
>>>> (see Table 6-1 in the User’s Manual
>>>> <http://www.pserc.cornell.edu/matpower/manual.pdf> for details on where
>>>> to
>>>> find the constraints).
>>>> 
>>>> --
>>>> Ray Zimmerman
>>>> Senior Research Associate
>>>> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
>>>> phone: (607) 255-9645
>>>> 
>>>>> On Oct 31, 2014, at 8:06 AM, Abdel-Fattah El-Adl 
>>>>> wrote:
>>>>> 
>>>>> Dear all
>>>>> How i can save all constraints which printed in multi-runopf
>>>>> 
>>>>> Best regards
>>>>> =
>>>>> Abdel-Fattah El-Adl
>>>>> Associate Lecturer
>>>>> Mansoura University
>>>>> Faculty of Engineering
>>>>> Electrical Engineering Dept.
>>>>> Mansoura - Egypt
>>>>> Tel   :  +20127074312
>>>>> Fax  :  +2050-2244690
>>>>> e-mail:  elad...@yahoo.com <mailto:elad...@yahoo.com>
>>>>> elad...@mans.edu.eg <mailto:elad...@mans.edu.eg>
>>>>> elad...@gmail.com <mailto:elad...@gmail.com>
>>>>> =
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> <http://sig.graphicsfactory.com/>
>>> Emoticons <http://sig.graphicsfactory.com/>
>>> 
>>> 
>> 
>> 
>> 
>> 
> 
> 
> -- 
> <http://sig.graphicsfactory.com/>
> Emoticons <http://sig.graphicsfactory.com/>
> 
> 





Re: Customize bus data

2014-11-14 Thread Ray Zimmerman
If you are talking about the pretty-printed output, the only way to add the 
BUS_TYPE is by modifying the printpf() function directly.

   Ray

> On Nov 13, 2014, at 4:28 PM, Afif Abu Bakar  wrote:
> 
> Hi,
> 
> May I know how can I customize the output for Bus Data? I would like to 
> include BUS_TYPE in the result from runpf(‘case14’) but I don’t know how can 
> I customize it. I have go through the documentation where it mentions to use 
> mpoption but I don’t quite understand how to implement it. 
> 
> Thank you.



Re: Modeling a Battery in OPF

2014-11-14 Thread Ray Zimmerman
A battery is fundamentally a device whose operation is linked through time. And 
an OPF optimizes dispatch at a single instant of time. So it can’t actually 
handle the full optimal scheduling of battery usage.

In the context of a single OPF, a battery is simply a device that can either 
produce or consume power. You can think of it as a generator whose maximum 
output is positive and minimum output is negative in general. In reality 
though, these generator bounds will depend on the current state of charge (e.g. 
if it is fully discharged or fully charged, your upper or lower bounds on 
generation, respectively, will be zero) and possibly any future plans (i.e. I 
must not discharge now if I will need to use that energy in future hours).

So in this context you basically have two things you can use to specify how the 
OPF should schedule your battery usage: (1) the upper and lower generation 
bounds, (2) the “cost” (that is, the opportunity cost for discharging now, or 
the cost of charging now vs. waiting). Presumably, either or both of these 
would change from period to period according to some sort of storage “plan”.

Hope this helps,

Ray



> On Nov 14, 2014, at 9:25 AM, Manish Thapa  wrote:
> 
> Hello All,
> 
> I am looking to model a battery in MATPOWER OPF. The battery should charge 
> when a particular transmission line wants to store the power, and discharge 
> when another line needs the power. Does anybody has any idea to model the 
> battery on MATPOWER. I am quite new to the software, and don't really know 
> where to begin from.
> 
> Thanking you,
> 
> Jung





Re: maximum power of branches in IEEE Test systems

2014-11-17 Thread Ray Zimmerman
(no need to post multiple times)

I am not aware of any versions of these fields that include the flow limits on 
the lines. If they exist, and somebody can point me to the reference, I’ll be 
happy to include them in MATPOWER.

Ray


> On Nov 17, 2014, at 10:20 AM, ahmad rezaee  wrote:
> 
> Dear All
> 
> Can anyone help me to find the pmax (maximum real power) of branches in IEEE 
> 57 bus and 300 bus test systems? 
> 
> Thank you very much
> 
> Sincerely,
> 
> Ahmad
> 



Re: Modeling a Battery in OPF

2014-11-18 Thread Ray Zimmerman
I’m sorry, but I have no idea what “garver.m configuration” is.

Ray


> On Nov 17, 2014, at 7:40 PM, Manish Thapa  wrote:
> 
> Dear Prof. Ray,
> 
> I am also in addition thinking to model virtual generators on a number of 
> buses. These virtual generators could in practice act as my battery. My 
> question is: does garver.m configuration include modeling of virtual 
> generators? 
> 
> Best,
> 
> J T
> 
> On Sat, Nov 15, 2014 at 3:04 AM, Ray Zimmerman  <mailto:r...@cornell.edu>> wrote:
> A battery is fundamentally a device whose operation is linked through time. 
> And an OPF optimizes dispatch at a single instant of time. So it can’t 
> actually handle the full optimal scheduling of battery usage.
> 
> In the context of a single OPF, a battery is simply a device that can either 
> produce or consume power. You can think of it as a generator whose maximum 
> output is positive and minimum output is negative in general. In reality 
> though, these generator bounds will depend on the current state of charge 
> (e.g. if it is fully discharged or fully charged, your upper or lower bounds 
> on generation, respectively, will be zero) and possibly any future plans 
> (i.e. I must not discharge now if I will need to use that energy in future 
> hours).
> 
> So in this context you basically have two things you can use to specify how 
> the OPF should schedule your battery usage: (1) the upper and lower 
> generation bounds, (2) the “cost” (that is, the opportunity cost for 
> discharging now, or the cost of charging now vs. waiting). Presumably, either 
> or both of these would change from period to period according to some sort of 
> storage “plan”.
> 
> Hope this helps,
> 
> Ray
> 
> 
> 
> > On Nov 14, 2014, at 9:25 AM, Manish Thapa  > <mailto:thapamanish...@gmail.com>> wrote:
> >
> > Hello All,
> >
> > I am looking to model a battery in MATPOWER OPF. The battery should charge 
> > when a particular transmission line wants to store the power, and discharge 
> > when another line needs the power. Does anybody has any idea to model the 
> > battery on MATPOWER. I am quite new to the software, and don't really know 
> > where to begin from.
> >
> > Thanking you,
> >
> > Jung
> 
> 
> 
> 



Re: PQ Capability HVDC Converter

2014-11-18 Thread Ray Zimmerman
Hi Christian,

Well, if you were looking for some explicit lines of code like the equation you 
imagine, you are not going to find it. The problem is defined in the form found 
in equations (6.1)-(6.4) in the manual and then passed to the chosen solver, 
which handles the variable bounds and non-linear constraints in its own way. 
The constraints in question for the DC lines end up in the variable bounds.

You can see the setup for these bounds, for example in lines 246-247 of 
opf_setup() ...

  om = add_vars(om, 'Pg', ng, Pg, Pmin, Pmax);
  om = add_vars(om, 'Qg', ng, Qg, Qmin, Qmax);

… and line 114 of mipsopf_solver() …

  [x0, xmin, xmax] = getv(om);

Hope this helps,

Ray




> On Nov 17, 2014, at 11:04 AM, Christian Orberger 
>  wrote:
> 
> Hello Ray,
> 
> I want to come back to my issue above.
> I am still looking for a solution and I would like to know where exactly the 
> constraints are considered. For example  if there are given constraints on 
> dclines like you said QMINF,QMINT and Pmax etc. When you run the opf, where 
> in the whole programm are these mentioned constraints considered? E.g. where 
> is checked for example if the active power calculated by the opf is smaller 
> than Pmax, so that the constraints are satisfied? I imagine an equation like 
> this: if (active power <=Pmax) { finalActivePowerFlow=active power}. This 
> should be just an example to make clear for what I am searching.
> Thank you for your help.
> Christian
> 
> 
>> Am 06.11.2014 um 09:16 schrieb Christian Orberger 
>> mailto:christian.orber...@outlook.com>>:
>> 
>> Hi Ray,
>> 
>> thank you for your answer. I will think about that and if I don't get 
>> further I will write an other E-Mail.
>> 
>> Christian
>> 
>> From: r...@cornell.edu 
>> Subject: Re: PQ Capability HVDC Converter
>> Date: Wed, 5 Nov 2014 10:25:28 -0500
>> To: matpowe...@list.cornell.edu 
>> 
>> Hi Christian,
>> 
>> But it is precisely these values of the dcline field that are used to set 
>> the corresponding parameters for the dummy generators in a consistent way. 
>> Regarding your specific example of line 157, since the PG values of the pair 
>> of dummy generators are linked via an equality constraint, it is sufficient 
>> to include finite PMIN and PMAX on only one of the dummy generators (to 
>> avoid redundant constraints and splitting of shadow prices, etc.). In the 
>> case of QMIN and QMAX, as you can see in lines 195-198, the values I 
>> mentioned are used directly to set the QMIN and QMAX of the corresponding 
>> dummy generators.
>> 
>> Ray
>> 
>> 
>> 
>> On Nov 5, 2014, at 6:20 AM, Christian Orberger 
>> mailto:christian.orber...@outlook.com>> 
>> wrote:
>> 
>> Hi Ray,
>> 
>> thank your for this hint. 
>> It weren't these variables, but the variables of the dummy generators, which 
>> are added in "toggle_dcline" from line 153. There I would like to define 
>> constraints of the variables "PMAX, PMIN, QMAX, QMIN" of the dummy 
>> generators. E.g. not fg(:, PMIN) = -inf; (line 157 ), but fg(:, 
>> PMIN) = -2*x^2; (Just an example. That equation doesn't have to make 
>> sense.) The same I would do for QMIN/MAX. 
>> 
>> Thank you for every help.
>> Christian
>> 
>> From: r...@cornell.edu 
>> Subject: Re: PQ Capability HVDC Converter
>> Date: Tue, 4 Nov 2014 11:19:47 -0500
>> To: matpowe...@list.cornell.edu 
>> 
>> Hi Christian,
>> 
>> See Table B-5 in the User’s Manual 
>> . I think the QMINF, 
>> QMAXF, QMINT, QMAXT are the parameters you are looking for, right?
>> 
>>Ray
>> 
>> 
>> On Nov 4, 2014, at 3:54 AM, Christian Orberger 
>> mailto:christian.orber...@outlook.com>> 
>> wrote:
>> 
>> Hi Uriel,
>> 
>> thank you for your answer. 
>> I saw in the user manual under point 7.5.3 "DC Transmission lines" that DC 
>> Lines are implemented with "Dummy Generators". I would assume that these 
>> dummy Generators can be seen in general as Converters. So, I think I just 
>> have to put constraints on these dummy generators. But where are these 
>> constraints defined or in other words: are there already constraints at all? 
>> What do you think about my thoughts? Would you agree?
>> 
>> From: uriel_sando...@ieee.org 
>> Subject: Re: PQ Capability HVDC Converter
>> Date: Mon, 3 Nov 2014 07:02:30 -0600
>> To: matpowe...@list.cornell.edu 
>> 
>> Hi Christian,
>> 
>> 
>> As far as i know, matpower does not include FACTS devices (such HVDC), you 
>> will have to code it.
>> 
>> Best regards,
>> 
>> Uriel
>> 
>> El 03/11/2014, a las 6:51, Christian Orberger 
>> mailto:christian.orber...@outlook.com>> 
>> escribió:
>> 
>> Hello,
>> 
>> I want to extend the P-Q constraints of an HVDC Converter in the OPF in 
>> Matpower. My question is, if there already are any constraints regarding 
>> 

  1   2   3   4   5   6   7   8   9   10   >