To do this you would also need to modify opf_hessfcn.m accordingly, and there are almost certainly numerous other places in the code where the number of non-linear inequality constraints would have to be updated. This isn’t exactly a trivial task. Hopefully some day I’ll get a chance to include user-defined non-linear constraints as a MATPOWER feature, but we’re not there yet.
-- Ray Zimmerman Senior Research Associate B30 Warren Hall, Cornell University, Ithaca, NY 14853 USA phone: (607) 255-9645 On Jul 14, 2014, at 11:49 PM, Abhyankar, Shrirang G. <abhy...@mcs.anl.gov> wrote: > Patrick, > I'm afraid setting Smin limit on tie line flow is not as > straightforward as I initially thought. The reason being that with > MATPOWER's optimal power flow, the flow constraint for a transmission line > is set as > |S_flow| - Smax^2 \le 0. MATPOWER uses rate_A limit as the flow limit > (Smax) for branches. So, while a Smax can be set for the line flow, Smin > is not implemented. > > You'll have to do a little bit of hackery to do what you want. Here are > the steps: > i) Set the Smin values for branches in branch RATE_B column (RATE_B is not > used anyways for the OPF so this should be fine). Only tie lines will have > a non-zero Smin, others will be zero. This will help > you to identify the tie lines and set constraints only for them. > ii) Modify the file opf_consfcn.m (the routine sets up the equality and > inequality constraints for the OPF) to include additional inequality > constraints for the tie lines in the h vector. Note that the optimization > expects the inequality > constraints in the standard form h(x) \le 0. So your additional > inequality constraints should be Smin(tie_line_idx).^2 - | > S_flow(tie_line_idx)) | > > Shri > > -----Original Message----- > From: Eser Patrick <es...@student.ethz.ch> > Reply-To: MATPOWER discussion forum <matpowe...@list.cornell.edu> > Date: Mon, 14 Jul 2014 17:30:48 +0000 > To: MATPOWER discussion forum <matpowe...@list.cornell.edu> > Subject: AW: Convergence issues: OPF simulation of several interconnected > countries > >> Ray, Carlos, Shri, >> >> Thanks for your inputs, I really appreciate your help. >> >> With regard to your responses: >> >> @Shri: How would I impose the Smin and Smax of the tie-line in the >> MATPOWER intput? I can't see anything alike in the mpc.branch struct, as >> PF, QF, PT and QT are ignored as inputs according to the manual. Fixing >> the S-value to the cross-border flow value would definitely help me! >> >> @Carlos: No, there are no phase shifters in the system. Would including >> phase shifters at crucial points help me? >> >> @Ray,Shri: I have already cooked the problem down to two countries, so I >> totally agree to your boiling-down approach. I will have to look at each >> line in detail, but I wanted to make sure first, that I am not making a >> general mistake that completely prevents convergence. >> >> Thanks again! >> ________________________________________ >> Von: bounce-117289979-69334...@list.cornell.edu >> [bounce-117289979-69334...@list.cornell.edu]" im Auftrag von >> "Abhyankar, Shrirang G. [abhy...@mcs.anl.gov] >> Gesendet: Montag, 14. Juli 2014 17:40 >> An: MATPOWER discussion forum >> Betreff: RE: Convergence issues: OPF simulation of several interconnected >> countries >> >> Patrick, >> The first thing that I would try to do is to make sure 1. and 2. give >> similar solution. I would do this by imposing the cross-border flows in 1 >> as constraints on the tie-lines in 2. So Smax and Smin of the tie-line >> would be set to the cross-border flow value. The OPF may not converge if >> you set Smax=Smin=cross-border-flow so allow a little margin for the flow >> to vary. >> Also, instead of running the OPF on n countries at once, I would start >> with just 2 countries first. This would help to identify any problems >> relatively easily. >> Another thing to consider are your cost function coefficients. If the >> countries have different currencies then you'll have to convert the >> coefficients accordingly. >> >> Good luck, >> Shri >> ________________________________________ >> From: bounce-117288115-33970...@list.cornell.edu >> [bounce-117288115-33970...@list.cornell.edu] on behalf of Eser Patrick >> [es...@student.ethz.ch] >> Sent: Monday, July 14, 2014 8:34 AM >> To: MATPOWER-L@cornell.edu >> Subject: Convergence issues: OPF simulation of several interconnected >> countries >> >> Dear MATPOWER Community, >> >> I am trying to solve a relatively large (>1000 buses) AC OPF problem. It >> consists of several individual countries (200-300 buses each). Please >> allow me to describe my procedures, to paint the full picture. >> >> 1. In a first study, I simulated all countries individually. The >> cross-border power flows to the neighboring countries is known to me from >> a database. I include these cross-border flows by implementing >> "pseudo-generators" of zero production cost or "pseudo-demand" at the >> borders. This procedure works nicely, I get convergence in almost every >> case I run. >> >> 2. Now I would like to simulate not only one country, but all my >> countries interconnected as one large system. I have "stitched" the >> transmission grids of the individual countries together in a realistic >> manner. If I run the OPF without further constraints, I receive >> converging simulations. But unfortunately, the flow between my countries >> is massively too high, probably due to price level differences between my >> countries. I would like to prevent these high cross-border flows, which >> leads to point 3. >> >> 3. I would like to limit the power flow (especially the real power flow) >> between my countries (so on individual branches in my full system), but >> am not able to get a converging simulation. I have played around >> extensively the MVA ratings of the lines (long and short term), but as >> soon as I impose realistic line ratings, I only get "infeasible solution" >> problems. As a workaround, I tried replacing the AC cross-border >> transmission lines with DC lines (and limiting real power flow in those >> DC lines). This does converge sometimes, but not always. I am using MIPS >> and/or IPOPT. >> >> I would massively appreciate any help in this regard. Some questions >> about the problem: >> >> What is the best ways to limit the power flow in an individual branch? >> Why are my simulations never converging, if I impose MVA ratings? >> Has anybody solved such a problem before? It seems quite straightforward, >> I am sure someone has already done something like this with MATPOWER. >> What would you suggest me to do? >> Should I rather use other solvers than MIPS or IPOPT? >> As I am not an expert of transmission system, what indicators should I be >> looking at to find out, where my simulations are going wrong? >> >> Thanks a lot for your comments. >> >> Best Regards, >> >> Patrick >> >> >> >> >> > > >