Coder Social home page Coder Social logo

pglib-opf's Introduction

Power Grid Lib - Optimal Power Flow

This benchmark library is curated and maintained by the IEEE PES Task Force on Benchmarks for Validation of Emerging Power System Algorithms and is designed to evaluate a well established version of the the AC Optimal Power Flow problem. This introductory video and detailed report present the motivations and goals of this benchmark library. In particular, these cases are designed for benchmarking algorithms that solve the following Non-Convex Nonlinear Program,

  The Mathematical Model of the Optimal Power Flow Problem  

A detailed description of this mathematical model is available here. All of the cases files are curated in the MATPOWER data format. Open-source reference implementations are available in MATPOWER and PowerModels.jl and baseline results are reported in BASELINE.md.

Problem Variants

These cases may also be useful for benchmarking the following variants of the Optimal Power Flow problem,

  • DC Optimal Power Flow
  • AC Optimal Transmission Switching
  • DC Optimal Transmission Switching

That said, these cases are curated with the AC Optimal Power Flow problem in mind. Application to other domains and problem variants should be done with discretion.

Case File Overview

A forthcoming technical report will detail the sources, motivations, and procedures for curating these case files.

In this repository the network data files are organized into the following three broad groups:

  • /*.m - base case benchmarks as originally specified
  • /api/*.m - heavily loaded test cases (i.e. binding thermal limit constraints)
  • /sad/*.m - small phase angle difference cases (i.e. binding phase angle difference constraints)

Contributions

All case files are provided under a Creative Commons Attribution License, which allows anyone to share or adapt these cases as long as they give appropriate credit to the orginal author, provide a link to the license, and indicate if changes were made.

Community-based recommendations and contributions are welcome and encouraged in all PGLib repositories. Please feel free to submit comments and questions in the issue tracker. Corrections and new network contributions are welcome via pull requests. All data contributions are subject to a quality assurance review by the repository curator(s).

Citation Guidelines

This repository is not static. Consequently, it is critically important to indicate the version number when referencing this repository in scholarly work.

Users of this these cases are encouraged to cite the original source documents that are indicated in the file headers and the achrive report.

pglib-opf's People

Contributors

ccoffrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pglib-opf's Issues

Creating a DOI & citation for the dataset

Dear PGLib team,

Would it be possible to create DOIs and bibtex-like citations for specific versions of PGLib?
It can be done with, e.g., Zenodo.
This would help a lot in tracking which version of PGLib is used in publications (despite the recommendation in the README to always mention the version of PGLib in publications, I have seen multiple publications that do not follow it).

Many thanks!

Shunt Parameter Precision

Check if the shunt parameter precision can be made consistent in all data files. This will make the spacing in the data files cleaner. Note that the current precision in the pegase cases varies widely from bus to bus.

radial test cases

It seems none of the test cases in pglib-opf are radial? That makes it hard to use any of these benchmarks to use/extend them for models that require a consistent definition of upstream/downstream, e.g. as in [1] below.

I recall that the NESTA archive had a /rad m file collection. Was there any discussion on including that in pglib-opf? What happened to it?

[1] Dvorkin, V., Fioretto, F., Van Hentenryck, P., Kazempour, J., & Pinson, P. (2020). Differentially Private Optimal Power Flow for Distribution Grids, 1, 1–9. Retrieved from http://arxiv.org/abs/2004.03921

Add 68-Bus System

Dark mode MODEL.tex

Add dark mode image.

Can you render this code in texit and produce the inverted MODEL_inv.png for dark mode reader?

% \documentclass{article}
\documentclass[convert]{standalone}
\usepackage{amssymb, amsmath, bm}

\usepackage{xcolor}

% \pagecolor[rgb]{0,0,0}
\color[rgb]{1,1,1}

\begin{document}
\begin{equation*}
\begin{aligned}
 %
\mbox{\bf data:} & \nonumber \\ 
& \bm {S^{gl}}_k, \bm {S^{gu}}_k \;\; \forall k \in G \nonumber \\
& \bm c_{2k}, \bm c_{1k}, \bm c_{0k} \;\; \forall k \in G \nonumber \\
& \bm {v^l}_i, \bm {v^u}_i \;\; \forall i \in N \nonumber \\
& \bm S^d_i, \bm Y^s_{i} \;\; \forall i \in N \nonumber \\
& \bm Y_{ij}, \bm {b^c}_{ij}, \bm{T}_{ij} \;\; \forall (i,j) \in E \nonumber \\
& \bm {s^u}_{ij}, \bm {\theta^{\Delta l}}_{ij}, \bm {\theta^{\Delta u}}_{ij} \;\; \forall (i,j) \in E \nonumber \\
& \bm r \nonumber \\
%
\mbox{\bf variables: } & \nonumber \\
& S^g_k \;\; \forall k\in G \nonumber \\
& V_i \;\; \forall i\in N \nonumber \\
& S_{ij} \;\; \forall (i,j) \in E \cup E^R \nonumber \\
%
\mbox{\bf minimize: } & \sum_{k \in G} \bm c_{2k} (\Re(S^g_k))^2 + \bm c_{1k}\Re(S^g_k) + \bm c_{0k} \\
%
\mbox{\bf subject to: } & \nonumber \\
& \angle V_{\bm r} = 0 \\
& \bm {S^{gl}}_k \leq S^g_k \leq \bm {S^{gu}}_k \;\; \forall k \in G  \\
& \bm {v^l}_i \leq |V_i| \leq \bm {v^u}_i \;\; \forall i \in N \\
& \sum_{\substack{k \in G_i}} S^g_k - {\bm S^d_i} - \bm Y^s_{i} |V_i|^2 = \sum_{\substack{(i,j)\in E_i \cup E_i^R}} S_{ij} \;\; \forall i\in N \\ 
& S_{ij} = \left( \bm Y^*_{ij} - \bm i\frac{\bm {b^c}_{ij}}{2} \right) \frac{|V_i|^2}{|\bm{T}_{ij}|^2} - \bm Y^*_{ij} \frac{V_i V^*_j}{\bm{T}_{ij}} \;\; \forall (i,j)\in E \\
& S_{ji} = \left( \bm Y^*_{ij} - \bm i\frac{\bm {b^c}_{ij}}{2} \right) |V_j|^2 - \bm Y^*_{ij} \frac{V^*_i V_j}{\bm{T}^*_{ij}} \;\; \forall (i,j)\in E \\
& |S_{ij}| \leq \bm {s^u}_{ij} \;\; \forall (i,j) \in E \cup E^R \\
& \bm {\theta^{\Delta l}}_{ij} \leq \angle (V_i V^*_j) \leq \bm {\theta^{\Delta u}}_{ij} \;\; \forall (i,j) \in E
%
\end{aligned}
\end{equation*}

\end{document}

Thanks

Line limits units (`rateA`)

Hi, first, thanks for your work aggregating and building this library!

I'm trying to use the 1354pegase case and am implementing my own simplified opf model where I want to impose line current constraints for line l = (i,j) according to

(|y_ij| |V_i - V_j|)^2 <= rhs

for V_i, V_j the complex voltages at buses i and j and |y_ij| is the magnitude of the (i,j) element of the admittance matrix. (Btw, I'm ignoring tap adjustments now...)

However, I'm not sure what the units of the rhs should be from the pglib case. According to Table V of the report (https://arxiv.org/abs/1908.02788), it seems that rateA is a thermal limit that was determined by the TL-UB method from Section V.B.2. Does this mean that the rateA is already normalized by baseMVA and given in p.u. form? Or should I divide rateA by 100 to get the p.u. (and then square it to set the value of the rhs).

Thanks!

Error when solving case89_pegase__api and case240_pserc__api

Hello,

I got the following error when solving OPF for 2 test cases: case89_pegase__api and case240_pserc__api with the MATPOWER function runopf. It seems that there is a problem when generator bound Pmax is 0.

Error using makeAvl (line 52)
makeAvl: either Qmin or Qmax must be equal to zero for each dispatchable load.

Error in opf_setup (line 171)
[Avl, lvl, uvl] = makeAvl(baseMVA, gen);

Error in opf (line 198)
om = opf_setup(mpc, mpopt);

Error in runopf (line 75)
[r, success] = opf(casedata, mpopt);

Best regards,

Christian

Move to TYP folder

Dear dr @rdzman, I propose that we move files to Typical Operating Conditions (TYP) folder to make the code structure more consistent.

I can make a PR if you agreed,

Thanks,

Generator LB higher than UB in 1888_rte__api

In pglib_opf_case1888_rte__api.m, the real power lower bound for the generator at bus 1689 (line 2,044 of the `.m' file) is 280.0, but the upper bound has been modified to be 64 (from 930 in the original case). Is this intentional? If so, what does it mean if the generator is turned on?

Thank you for your help!

Tranformer Parameter Checks

In some cases all tap settings are 1.0, I check should be made so that this only occurs when the value is not 1.0 or the branch is connecting two voltage levels.

DCOPF - Problem Formulation & Optimal solutions

Dear maintainers,

I am currently working on a project where we try to approach DCOTS ( Direct Current Transmission Switching ) with a new approach.

The algorithm I try to implement uses the classical DCOPF as a building block, and hence I have been coding it up in CVXPY in Python. However, I have been encountering some strange phenomena when trying my code out on the dataset, and comparing with the baseline values found in BASELINE.md. For the smaller systems, I seem to find the same optimal values, but for bigger systems they seem to differ a little bit. In general, I find slightly better solutions to the DC problem than what is presented in this repository.

For example ( All cases presented are the standard ones, not SAD or API)

case300_ieee: 5.1785e+05 vs 51780e+05 ( -0.01 % )
case2848_rte: 1.2677e+06 vs 1.2298e+06 ( -3.0 % )
case8387_pegase: 2.5028e+06 vs 2.5010 ( -0.07 % )

To clarify, these are not implemented the switching problem yet, but only the normal DCOPF.

So far, I have 3 possible theories to why this might happen:

  1. Could it be that the solutions presented in BASELINE.md are sometimes not global, but local optima? According to BASELINE.md, the solver being used is IPOPT. When reading the documentation of IPOPT, they state that the solver finds local optima to problems.
  2. I am using a different formulation of the DCOPF than you. I could not find any reference in the repository to the DCOPF which you have implemented. Could it be that I am using a slightly different formulation, which somehow results in small variations in the final solution?
  3. I have made a mistake in my code implementation...

What do you think?

A big thanks for a great repository and dataset 👍

Typo in OPF formulation in README

Equation (5) currently contains the term $-\mathbf{Y_i}^s|V_i|^2$.

However, I believe this should be $-(\mathbf{Y_i}^s)^*|V_i|^2$ -- that is, the shunt admittance should be conjugated.

Inverted Generator Bounds

Some inactive generators have infeasible active power bounds (i.e. pmax < pmin). Resolve this by ensuring,

pmin = min(pmin,pmax)
pmax = min(pmin,pmax)

in all generators.

DC Baselines, Constraints, and Inf

Hello, I have some related questions about the DC OPF baselines.

  1. It seems that for many of the typical operating conditions, the DC approximation better minimizes the cost than the full AC solution. Is this expected? Does this factor in any constraint violations?

  2. In some of the small angle difference cases, the objective values for the DC approximation are listed as "Inf". Does that indicate a constraint violation?

Infinite Generator Bounds

Add checks that the reactive power bounds are not inf. An example can be found in pglib_opf_case3375wp_k.m

Help In SDP-Relaxation method for solving OPF Problem

Hello Sir,
i came to know about you from your videos of Convex Relaxations in Youtube...
Sir i need help from you, i am stuck in my project work....i am trying to find an optimze a system 3m9b for test....

and i wrote the optimization problem like this....
for i=1:1
cvx_begin
cvx_solver sedumi

variables u(npv,1)
variable W(2n,2n) symmetric
summ=trace(YYreal(:,:,1)*W);
for i=2:n
summ=summ+trace(YYreal(:,:,i)*W);
end
for i=1:npv
u(i,1)==trace(YYreal(:,:,i+npq)W);
(This u contais the PV buses active power generation...(whose optimal value has to be found))
end
minimize(w
(sum(u)+trace(YYreal(:,:,n)*W)))

subject to
for i=1:npq (this are equality constraints "calculated active power=specified active power" for pv&pq buses)
trace(YYreal(:,:,i)*W)-(Pg(i,1)-Pl(i,1))==0;
trace(YYreal(:,:,i)*W)-(Pg(i,1)-Pl(i,1))==0;
end
for i=1:npv
(this bounds i thought to apply after getting a local optimal solution from Newtons Method)
trace(YYreal(:,:,i+npq)*W)+Pl(i+npq,1)>=-0.2
trace(YYreal(:,:,i+npq)*W)+Pl(i+npq,1)<=3
end

for i=1:npq (this are equality constraints "calculated reactive power=specified reactive power" for only pq buses)
trace(YYimag(:,:,i)*W)-(Qg(i,1)-Ql(i,1))==0;
trace(YYimag(:,:,i)*W)-(Qg(i,1)-Ql(i,1))==0;
end

W==semidefinite(2*n);
W>=0;
cvx_end
w=w+1
for i=1:npv
Pg(i+npq,1)=trace(YYreal(:,:,i+npq)*W)+Pl(i+npq,1);
end
end

Sir,
in the paper it is "Zero Duality Gap In Optimal Power Flow" that rank of W matrix variable should come=1 when the duality gap is "0". and for that we applied weight method.(w is the weight)..

Sir..
for some values of w i get solution as 'NAN'.
and for some i get an optimal solution...but the 'W matrix' never comes of rank 1...

i dont know where i am going wrong...but please help me with this....

Thermal Limit Details

Filter MVA limits to say three significant figures. A notable example will be case8387 where these can be cleaned up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.