Code Monkey home page Code Monkey logo

pandapower's People

Contributors

ascheidl avatar baraaunikassel avatar chefpony avatar dlohmeier avatar elodin avatar florianshepherd avatar friederikemeier avatar jhmenke avatar jkisse avatar jkrstulo avatar jkupka avatar julffers avatar jurasofish avatar jwiemer112 avatar ks-htk avatar lthurner avatar lvzhibai avatar maddinonline avatar mmajidi137 avatar mrifraunhofer avatar nitbharambe avatar pawellytaev avatar rbolgaryn avatar shankhoghosh avatar simonrubendrauz avatar steffenmeinecke avatar vogt31337 avatar wangzhenassd avatar winfriedl avatar zhengliu1119 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pandapower's Issues

zip loads integration

Here's my first e-mail to Leon about zip loads integration:

I have just finished first version of zip loads integration in pandapower. I have tested it against GridCal on a GridCal's 5-bus case and I get the same results, you can have a look on a test ipynb. However there are some questions about integration of this new option through pandapower that I wanted to discuss with you (only constant current part is problematic, constant Z loads are seamlessly integrated through shunts):

  • generally about integration to pf: I have looked through GridCal code and implemented it on the same way...so as we said, constant Z loads go as shunt elements to ppc['bus'] in columns GS and BS (no any problems, I've added them in _calc_shunts_and_add_on_ppc()). Constant current are elegantly considered by defining Ibus_cc vector, which is vector with constant current injections and it is needed in pf at two places:

    • dSbus_dV (and dSbus_dV_calc): where Ibus was Ibus = Ybus * V and now is Ibus = Ybus * V - Ibus_cc
    • _evaluate_Fx: where mis is now evaluated as: mis = V * conj(Ybus * V - Ibus_cc) - Sbus
  • integration to ppc: the biggest question is now what is the most elegant way to get Ibus_cc vector in power flow calculation. In regard to inputs of _run_newton_raphson_pf(ppci, options), (no access to net) there are 2 (or 3) possible options :

  1. through ppci - I made it like this for now as it was the simple preliminary solution...although I am aware that you probably prefer not to touch structure of the ppc. So the idea is to add added 13th and 14th column to ppc["bus"] for real and imaginary part of the constant current vector
  2. through options - alternative to ppc changes could be writing it to options dictionary which seems to me more like a workaround
  3. through **kwargs (or additional input) so that if options["voltage_depend_loads"] is True
  • integration to pf functions: in any case vector Ibus_cc will be defined in _powerflow or at the latest in _run_ac_pf_without_qlims_enforced, and afterwards it will go as one of the input parameters in functions: newtonpf, _evaluate_Fx, _create_J_with_numba, _create_J_without_numba, dSbus_dV and dSbus_dV_calc
    In order to avoid potential problems with calling any of these functions elsewhere, I've added it as a keyword argument Ibus_cc=None, and then in the functions where we use Ibus_cc I've defined it as: I = zeros(len(V)) if I is None else I so it does not impact calculations when options["voltage_depend_loads"] == False

  • integration to net.load: in GridCal, input data for zip loads are defined as, power in MVA, impedance in ohm, and current in kA. I have looked at other software (e.g. Digsilent PowerFactory) and it seems to me maybe more logical and practical to set it with coefficients of each of constant power, impedance and current part. In that case we should add 3 new columns in net.load, lets say: const_p, const_z, const_i (please suggest if you prefer some more convenient names and way of defining). These values would be considered only when runpp is called as runpp(net, voltage_depend_loads=True) and in that case a test that const_p + const_z + const_i = 1 could be performed.

Rearrangment of pandapower file structure

since we're discussing the standardization of the idx files and decided to integrate the pypower files (since the current PIP version is not compatible with numpy 1.12), It may be better to reorder the pandapower files in the main directory to increase readability. The current subfolders (converter, plotting, networks...) are extensions to pandapower, all remaining files are somehow classified as "framework". When I look at pp/tests, there is already some structure (api for example tests the toolbox, loadflow the powerflow and so on). Maybe we should try to keep that consistent. Here is a suggestion:

  • converter, estimation, networks, plotting, shortcircuit, topology stay as they are
  • powerflow will be added
    
  • opf will be added
    
  • core / framework / tbd will be added (contains build files, pd2ppc, idx files, results)
    
  • pypower_extensions will be deleted and the files moved to powerflow / opf
    

I'm undecided about api in tests. Isn't an API a programming interface for other services to use the functionality of the software?

11 tests fail with Linux

Eleven tests are failing with pandapower 1.4.0 and pandas 0.19. Many more are failing with pandas > 0.19
I have tried both Python 2.7.10 and 3.6.

../pandapower/test/api/test_auxiliary.py .
../pandapower/test/api/test_create.py FF
../pandapower/test/api/test_diagnostic.py .....................
../pandapower/test/api/test_file_io.py ...
../pandapower/test/api/test_std_types.py ..........
../pandapower/test/api/test_toolbox.py .....
../pandapower/test/converter/test_from_mpc.py .
../pandapower/test/converter/test_from_ppc.py ....
../pandapower/test/converter/test_to_ppc_and_mpc.py .
../pandapower/test/estimation/test_wls_estimation.py .............
../pandapower/test/loadflow/test_results.py ..................
../pandapower/test/loadflow/test_rundcpp.py .F..
../pandapower/test/loadflow/test_runpp.py .F..................
../pandapower/test/loadflow/test_scenarios.py .......
../pandapower/test/networks/test_cigre_networks.py ...
../pandapower/test/networks/test_create_example.py ..
../pandapower/test/networks/test_kerber_extreme_networks.py ..........
../pandapower/test/networks/test_kerber_networks.py ..........
../pandapower/test/networks/test_mv_oberrhein.py .
../pandapower/test/networks/test_power_system_test_cases.py ..................
../pandapower/test/networks/test_simple_pandapower_test_networks.py ....
../pandapower/test/networks/test_synthetic_voltage_control_lv_networks.py FFFFF
../pandapower/test/opf/test_basic.py .........F.
../pandapower/test/opf/test_costs_mixed.py .
../pandapower/test/opf/test_costs_pol.py ..
../pandapower/test/opf/test_costs_pwl.py .....
../pandapower/test/opf/test_costs_pwl_q.py ....
../pandapower/test/opf/test_curtailment.py .
../pandapower/test/opf/test_dcline.py ...
../pandapower/test/opf/test_oberrhein.py .
../pandapower/test/opf/test_opf_cigre.py .
../pandapower/test/shortcircuit/test_gen.py ...
../pandapower/test/shortcircuit/test_impedance.py ..
../pandapower/test/shortcircuit/test_meshing_detection.py ....
../pandapower/test/shortcircuit/test_motor.py .
../pandapower/test/shortcircuit/test_ring.py ...
../pandapower/test/shortcircuit/test_sgen.py ...
../pandapower/test/shortcircuit/test_trafo3w.py ..
../pandapower/test/shortcircuit/test_transformer.py .....
../pandapower/test/topology/test_graph_searches.py .F

== 11 failed, 206 passed in 298.59 seconds ==

nets equal error

toolbox.nets_equal results in an error if a compare a deepcopy version of net with net when numba = True/ False. Example:

    import pandapower as pp
    import pandapower.networks as nw
    import pandapower.toolbox as tb
    net = nw.case4gs()
    net_copy = copy.deepcopy(net)
    pp.runpp(net_copy, numba=True)
    pp.runpp(net, numba=False)
    tb.nets_equal(net, net_copy, check_only_results=True, tol=1e-4)

Even though the results and dataframes seem to be equal if I compare manually

Converting data to Pandapower format

Hi all,
I got a question regarding the possibility to convert network data form commercial software like Neplan or PSS Sincal into the Pandapower format. Is there any possibility to do so or is it necessary to do it manually recreating the networks? Help is appreciated :)

Greetings

improvements of the estimation module

Some improvements can be made to the estimation module in order to increase reliability:

  • bad data removal (rn_max) is not reliable all the time

I don't expect to work much on this this year though. Any help from potential users is highly appreciated.
The estimation module is still very much usable, but has some limitations.

Also there is some refactoring/testing work, which i plan to do this year:

  • wls_matrix_ops should be refactored to use the ppc and its matrices more
  • writing unit tests for bad data detection, line current measurements from examples in the "Power System State Estimation" book

Storing Prices after OPF

It looks like in the _copy_results_ppci_to_ppc function, you only take the first 13 columns of the result['bus'] matrix. This means that the stored results don't include the Lagrange multipliers (in other words, the marginal prices).

Would it be possible to include those in the results that are saved after an OPF?

OPF: simulation of network including batteries over time snapshots

Dear developers,

I'd like to add a battery and do simulations over several time snapshots.
In your code I only found some batteries in the CIGRE example as non-controllable static generators. I added a battery using a controllable non-static generator.
Is it possible to simulate a battery in pp over several time steps - does pp actually support OPF over time?

I couldn't find any time- or SOC-related code but to be sure: I assume the answer is no?

Bug in Optimal DC Power Flow

The command pandapower.rundcopp() does not work and results in the following error:

Traceback (most recent call last):

File "<ipython-input-22-cc482b66fe4a>", line 1, in <module> runfile('/Users/Mahdi/Drive/Lab/Python/PandaPower_Tutorial/opf_basic.py', wdir='/Users/Mahdi/Drive/Lab/Python/PandaPower_Tutorial')

File "/Volumes/Transcend/Applications/miniconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 866, in runfile
execfile(filename, namespace)

File "/Volumes/Transcend/Applications/miniconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
builtins.execfile(filename, *where)

File "/Users/Mahdi/Drive/Lab/Python/PandaPower_Tutorial/opf_basic.py", line 169, in <module> pp.rundcopp(net)

File "/Users/Mahdi/Drive/Lab/Python/pandapower/pandapower/run.py", line 346, in rundcopp _optimal_powerflow(net, verbose, suppress_warnings, **kwargs)

File "/Users/Mahdi/Drive/Lab/Python/pandapower/pandapower/optimal_powerflow.py", line 48, in _optimal_powerflow
result = opf(ppci, ppopt)

File "/Users/Mahdi/Drive/Lab/Python/pandapower/pandapower/opf/opf.py", line 175, in opf results, success, raw = opf_execute(om, ppopt)

File "/Users/Mahdi/Drive/Lab/Python/pandapower/pandapower/opf/opf_execute.py", line 63, in opf_execute
results, success, raw = dcopf_solver(om, ppopt)

File "/Users/Mahdi/Drive/Lab/Python/pandapower/pandapower/opf/dcopf_solver.py", line 226, in dcopf_solver
opt['cplex_opt'] = cplex_options([], ppopt)

File "/Users/Mahdi/Drive/Lab/Python/PYPOWER/pypower/cplex_options.py", line 94, in cplex_options
lpmethod = ppopt['CPLEX_LPMETHOD']

KeyError: 'CPLEX_LPMETHOD'

pandapower 1.3

Feature/ToDo list for version 1.3:

ZIP loads:

  • integration into Newton-Rapshon
  • integration into backward/forward
  • integration of index files

Interactive plotting:

  • interactive plots with plotly
  • plotting on maps mapbox
  • tutorials / notebooks?

Short circuit:

  • kappa method C
  • consideration of asnychronous motors
  • consideration of full converter elements as current sources according to 2016 revision of IEC standard
  • index file for short circuit parameters
  • speedups and refactoring
  • update documentation with full converter element changes
  • update tutorials

Power Flow:

  • numba speedups of pd2ppc
  • integrating pypower and making individual index files for pandapower
  • numpy 1.12 compatibility
  • improve shunt model (optional)

OPF:

  • numpy 1.12 compatibility
  • tests fail after refactoring of pd2ppc functions
  • ZIP loads (optional)

State Estimation:

  • Results for all elements (not just bus, line) are now available after state estimation
  • Bugfix in bad data removal function for state estimation
  • index file for state estimation parameters

Other:

  • rearranging file structure
  • pegase networks included
  • convenience function for input of load, sgen, shunt (optional)
  • pandas 0.20 compatibility?

test coverage

There are no tests for the topology module. Tests could be derived from the examples in the documentation

html representation

I have made some changes to the html function contributed by @mdipierro in commit 191b234:

  • changed the name to to_html to be consisten with to_pickle, to_excel etc.
  • changed the identation of adding the lines (they were never added for respect_switches=False)
  • added a show_table parameter so showing the tables can be disabled --> i did this because for large networks the tables take up a lot of space and it takes a lot of scrolling to get to the graph. maybe an alternative would be to position the graph at the top?
  • removed the l variable for impedances since it does not exist for impedances
  • removed whitespace

@mdipierro can you look over those changes and comment?

shunt model: input parameters and taps

In #20 we discussed ZIP load parameters and decided to include the shunt-impedance as a a relative value instead of explicit power parameters pz_kw / qz_kvar. Does this also make sense for the shunt model, e.g. to make two parameters rated power and an active power loss percentage instead of pz_kw / qz_kvar?

Also, it would maybe be helpful to have a tap model for shunts as well, so that a rated power for each step can be defined and the shunt power can be increased / decreased stepwise?

plotting raises deprecation warning

Trying to plot a network with pandapower.plotting.simple_plot I get a deprication warning. See the message at file for details.
DepricationWarning.txt
I tryed installing the mentioned igraph project but got the same warning.
I tryed to install jgraph and change "import igraph as ig" to "import jgraph as ig" but I got an AttributeError. Again details in file.
AttributeError.txt

Comparing master and develop branche I learned that both use igraph but could not figure out how it is bound to the depricated one or which one is ment to be used here.

Is that my mistake, a problem of my IDE (brand new PyCharm) or a general one?

simple_plot fails when bus_geodata or line_geodata are deleted

this code fails due to KeyError:

from pandapower.networks import mv_oberrhein
import pandapower.plotting import simple_plot

if name == 'main':

net = mv_oberrhein()

del net.bus_geodata 
del net.line_geodata

ppplot.simple_plot(net)

existance of bus_geodata and line_geodata is checked with assumption that keys line_geodata and bus_geodata exist:
if len(net.line_geodata) == 0 and len(net.bus_geodata) == 0:
logger.warning("No or insufficient geodata available --> Creating artificial coordinates." +
" This may take some time")
create_generic_coordinates(net, respect_switches=respect_switches)

issue loading case9241pegase

The pickle of case case9241pegase seems to be broken in develop branch as

import pandapower.networks as pn
net = pn.case9241pegase()

throws

Traceback (most recent call last):
  File "xxx/python/pypower/pandapower_case2869pegase_opf_test.py", line 10, in <module>
    net = pn.case9241pegase()
  File "xxx/git-repos/pandapower/pandapower/networks/power_system_test_cases.py", line 596, in case9241pegase
    case9241pegase = pp.from_pickle(os.path.join(_get_cases_path(), "case9241pegase.p"))
  File "xxx/git-repos/pandapower/pandapower/file_io.py", line 187, in from_pickle
    net = read(f)
  File "xxx/git-repos/pandapower/pandapower/file_io.py", line 178, in read
    return pickle.load(f, encoding='latin1')
_pickle.UnpicklingError: could not find MARK

Problems with piecewise linear cost functions

Working with the OPF I discovered, that piecewise linear cost functions do not work for loads (does not converge for cost functions with 2 segments or more) and also not for reactive power (Wrong result for cost functions with 2 segments or more). I added this info to the docs. I am developing test cases for this at the moment.
I will check on this with MATPOWER to see how it is handled there.

Inefficient implementation of DC power flow

The DC power flow does not scale well since there is an inefficient implementation of slicing a sparse matrix with a dense matrix. The DC power flow for the case9241pegase network takes 5 seconds (!). This also slows down AC power flow with DC initialization.

Powerflow does not converge when an out of service line is connected to an "dead end" in service bus

See this code example:

import pandapower as pp
import pandapower.networks as networks
net = networks.case14()
b = pp.create_bus(net, vn_kv=135)
l = pp.create_line(net, 1, b, 0.1, std_type="NAYY 4x150 SE")
pp.runpp(net)
net.line.loc[l, "in_service"] = False
pp.runpp(net)

Problem:
Powerflow does not converge when an out of service line is connected to an "dead end" in service bus

ToDo:
Find a solution

GUI discussion

HI,

As stated before I am quite excited about this project. In my country (South-Africa) we have many, many small Municipalities. The network plannning skills and departments is mostly challenged. This leads to the appointment of consultants and therefore it is difficult to train inhouse people.

The software for loadflow is beastly expensive. I have used PSSE and PowerFactory and although they are great products so expensive. We have a great local product called ReticMaster for Radial networks and PowaMaster for meshed networks but it also costs quite a bit of money

Expanding this great project into something a bit more useable for the non-coding engineer would be awesome. Enter the GUI.....

I want to start a discussion on the following.

  • Do people think a simple drag and drop system as a seperate project could help
  • What platform would be the best
  • Something like Kivy? This is native python and cross platform
  • D3, had python bindings
  • QT?
  • Web, HTML, and JS based system - this will make a server based deployment easy, and in my case (South-Africa easier to roll out. We have so many different versions of Windows, installation rules etc at our clients)
  • Any ideas of the appropriate frame work.
  • Should the platform be Python based?
  • This looks like a maybe - http://www.pyqtgraph.org/documentation/flowchart/index.html
  1. I found this example and it is what I have in mind. Its not free but will ive you an idea. I am searching for the appropriate OpenSource framework - http://freegroup.github.io/draw2d_js.app.brainbox/

  2. Is there any interest in this group to get a proof of concept of the ground? I understand that the core of this project needs development so I do not mind starting a project, driving it and trying to get dev's to help?

  3. PyPower - Is the stability of this project a risk? For that matter is there any dependancies that could put this development at risk?

regards Tobie

KeyError: max_p_kw

Hi,

I'm attempting to go through the tutorials on the website including the basic power flow tutorial.

I have just upgraded to pandapower 1.3.1 as a suggestion from a previous bug.

I have pandapower version 1.3.1 and pandas version 0.20.2.

The following is the error I'm receiving after following the steps in the tutorial:

`archimedes@archimedes-desktop:~/PandaConvNet$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.

import pandapower
fr>>> from pandapower import networks as nn
import pandas
import pypower
net = nn.example_simple()
net.bus
name vn_kv type zone in_service
0 HV Busbar 110.0 b None True
1 HV Busbar 2 110.0 b None True
2 HV Transformer Bus 110.0 n None True
3 MV Transformer Bus 20.0 n None True
4 MV Main Bus 20.0 b None True
5 MV Bus 1 20.0 b None True
6 MV Bus 2 20.0 b None True
net.gen
name bus p_kw vm_pu sn_kva min_q_kvar max_q_kvar scaling
0 generator 5 -6000.0 1.03 NaN -3000.0 3000.0 1.0

in_service type
0 True None

pandapower.runopp(net,verbose=True)
Traceback (most recent call last):
File "/home/archimedes/.local/lib/python3.5/site-packages/pandas/core/indexes/base.py", line 2442, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc (pandas/_libs/index.c:5280)
File "pandas/_libs/index.pyx", line 154, in pandas._libs.index.IndexEngine.get_loc (pandas/_libs/index.c:5126)
File "pandas/_libs/hashtable_class_helper.pxi", line 1210, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas/_libs/hashtable.c:20523)
File "pandas/_libs/hashtable_class_helper.pxi", line 1218, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas/_libs/hashtable.c:20477)
KeyError: 'max_p_kw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/home/archimedes/.local/lib/python3.5/site-packages/pandapower/run.py", line 292, in runopp
_optimal_powerflow(net, verbose, suppress_warnings, **kwargs)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandapower/optimal_powerflow.py", line 38, in _optimal_powerflow
ppc, ppci = _pd2ppc(net)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandapower/pd2ppc.py", line 89, in _pd2ppc
_build_gen_ppc(net, ppc)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandapower/build_gen.py", line 22, in _build_gen_ppc
_build_gen_opf(net, ppc)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandapower/build_gen.py", line 355, in _build_gen_opf
_copy_p_limits_to_ppc(net, ppc, eg_end, gen_end, _is_elements['gen'])
File "/home/archimedes/.local/lib/python3.5/site-packages/pandapower/build_gen.py", line 373, in _copy_p_limits_to_ppc
ppc["gen"][eg_end:gen_end, PMIN] = -net["gen"]["max_p_kw"].values[gen_is_mask] * 1e-3 + delta
File "/home/archimedes/.local/lib/python3.5/site-packages/pandas/core/frame.py", line 1964, in getitem
return self._getitem_column(key)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandas/core/frame.py", line 1971, in _getitem_column
return self._get_item_cache(key)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandas/core/generic.py", line 1645, in _get_item_cache
values = self._data.get(item)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandas/core/internals.py", line 3590, in get
loc = self.items.get_loc(item)
File "/home/archimedes/.local/lib/python3.5/site-packages/pandas/core/indexes/base.py", line 2444, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc (pandas/_libs/index.c:5280)
File "pandas/_libs/index.pyx", line 154, in pandas._libs.index.IndexEngine.get_loc (pandas/_libs/index.c:5126)
File "pandas/_libs/hashtable_class_helper.pxi", line 1210, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas/_libs/hashtable.c:20523)
File "pandas/_libs/hashtable_class_helper.pxi", line 1218, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas/_libs/hashtable.c:20477)
KeyError: 'max_p_kw'

pandapower.version
'1.3.1'
pandas.version
'0.20.2'
`

pandapower 1.3.1 was installed using the pip3 tool.

archimedes@archimedes-desktop:~/PandaConvNet$ pip3 check pandapower No broken requirements found.

There are my installed pip3 modules:

`archimedes@archimedes-desktop:~/PandaConvNet$ pip3 list --format=columns
Package Version


appdirs 1.4.3
apturl 0.5.2
beautifulsoup4 4.5.3
bleach 2.0.0
blinker 1.3
boto 2.47.0
Brlapi 0.6.5
bz2file 0.98
certifi 2017.4.17
chardet 3.0.4
checkbox-support 0.22
command-not-found 0.3
conda 4.3.16
cryptography 1.7.1
cycler 0.10.0
Cython 0.25.2
decorator 4.0.11
defer 1.0.6
distro-info 0.14build1
dropbox 7.3.1
entrypoints 0.2.2
feedparser 5.1.3
gensim 2.1.0
guacamole 0.9.2
html5lib 0.999999999
httplib2 0.9.2
idna 2.5
ipykernel 4.6.1
ipython 6.1.0
ipython-genutils 0.2.0
ipywidgets 6.0.0
jedi 0.10.2
Jinja2 2.9.6
jsonschema 2.6.0
jupyter 1.0.0
jupyter-client 5.0.1
jupyter-console 5.1.0
jupyter-core 4.3.0
kegra 0.0.1
Keras 2.0.4
keyring 10.3.1
keyrings.alt 2.2
language-selector 0.1
launchpadlib 1.10.4
lazr.restfulclient 0.13.4
lazr.uri 1.0.3
llvmlite 0.18.0
louis 3.0.0
lxml 3.7.3
Mako 1.0.6
MarkupSafe 1.0
matplotlib 2.0.2
mistune 0.7.4
mysql-connector-python 2.1.5
nbconvert 5.2.1
nbformat 4.3.0
networkx 1.11
notebook 5.0.0
numba 0.33.0
numpy 1.13.0
oauth 1.0.1
oauthlib 2.0.1
onboard 1.4.1
packaging 16.8
padme 1.1.1
pandapower 1.3.1
pandas 0.20.2
pandocfilters 1.4.1
pbr 3.1.1
pexpect 4.2.1
pickleshare 0.7.4
Pillow 4.0.0
pip 9.0.1
plainbox 0.25
prompt-toolkit 1.0.14
protobuf 3.3.0
psutil 5.0.1
ptyprocess 0.5.1
pyasn1 0.1.9
pycosat 0.6.1
pycrypto 2.6.1
pycups 1.9.73
pyfiglet 0.7.5
Pygments 2.2.0
pygobject 3.22.0
PyJWT 1.4.2
pyparsing 2.2.0
PYPOWER 5.1.2
python-apt 1.4.0b2
python-dateutil 2.6.0
python-debian 0.1.30
pytz 2017.2
pyxdg 0.25
PyYAML 3.12
pyzmq 16.0.2
qtconsole 4.3.0
reportlab 3.3.0
requests 2.18.1
ruamel.yaml 0.15.9
scikit-learn 0.18.1
scipy 0.19.1
screen-resolution-extra 0.0.0
SecretStorage 2.3.1
sessioninstaller 0.0.0
setuptools 36.0.1
simplegeneric 0.8.1
simplejson 3.10.0
six 1.10.0
smart-open 1.5.3
ssh-import-id 5.6
system-service 0.3
systemd-python 233
tensorflow-gpu 1.1.0
terminado 0.6
testpath 0.3.1
testresources 2.0.1
Theano 0.9.0
tornado 4.5.1
traitlets 4.3.2
ubuntu-drivers-common 0.0.0
ufw 0.35
unattended-upgrades 0.1
unity-scope-calculator 0.1
unity-scope-chromiumbookmarks 0.1
unity-scope-colourlovers 0.1
unity-scope-devhelp 0.1
unity-scope-firefoxbookmarks 0.1
unity-scope-gdrive 0.7
unity-scope-manpages 0.1
unity-scope-openclipart 0.1
unity-scope-texdoc 0.1
unity-scope-tomboy 0.1
unity-scope-virtualbox 0.1
unity-scope-yelp 0.1
unity-scope-zotero 0.1
urllib3 1.21.1
usb-creator 0.3.3
wadllib 1.3.2
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.12.2
wheel 0.29.0
widgetsnbextension 2.0.0
xdiagnose 3.8.5
xkit 0.0.0
XlsxWriter 0.9.6
zope.interface 4.3.2
`

The array index will not be correctly found when pvpq array is not sorted

Check This line
pvpq_lookup = zeros(pvpq[-1]+1, dtype=int), I think the pvpq[-1] may not always be the largest index of the pvpq array, it should be like pvpq_lookup = zeros(pvpq).max() , dtype=int) to ensure the largest index will be always found. This can help to compatible with common pypower case format.

built-in plolty plots crash without trafos

when e.g. simple_plotly is used to plot a newtork which does not contain any transformers (or any lines) it raises an error (create_trafo_trace returns None instead of empty list).

PPLOG

HI,

I am getting an import error with this line

import pplog
logger = pplog.getLogger(name)

unsure what module to install?

build branches from trafo3w

Issue
In a very specific cases of 3winding transformer parameters, it may happen that short circuit impedance z_sc ends up as smaller than resistance r_sc, specifically this results in this line with negative value in sqrt (and nan value of x_sc and singular jacobian matrix).
Error log:
image

Reason for this behavior is the following: three winding transformers are first transformed to equivalent 2winding transformers (wye-delta transformation) and then branches are created using the same routines as for 2winding transformers (there is a reason for this: 3w and 2w transformer use the same build_branch routines, so in the developing phase any change for 2w holds for 3w). After wye-delta conversion resulting parameters does not represent any physical values, so they can get some unrealistic values (even negative values are possible). More specifically, after conversion of 3w transformers to 2w, resulting vsc_percent and vscr_percent of each transformer for some specific cases can get such values that z_sc<r_sc.

Solution suggestion:
Instead of transforming a 3winding transformer to 2winding and then building branches from 2winding transformers, a direct building of 3 branches from a 3winding transformer should be implemented. Also, first branch impedance should be calculated and then wye-delta conversion performed.
This should result with exactly the same branch values in all cases, but avoid this issue in such specific cases.

tests fail with numpy 1.12

A deprecated warning from numpy < 1.12 has turned into an error.
Pypower files need to be fixed for this.

Warning in DC OPF when using piecewise linear costs

When using piecewise linear costs for the DC OPF, the following warning is raised:

DC opf cannot handle polynomial costs with higher than quadratic order.

This is confusing, but does not lead to wrong results.
If no costs are specified for an element, the internal "gencost" array still needs to be initialized. I decided to go for a polynomial costs of n coefficients, where all coefficients equal 0.

Here, n is determined by the polynomial cost funcion of the highest grade or the highest order of a piecewise linear cost function. This is done, because all lines in the gencost array have to have the same length. Initializing the gencost array with a piecewise linear function would be more complicated and would lead to an inefficient overhead.

My plan is to modify the check that raises this warning in the dcsolver.py file directly. I need to revise the pypower files anyway, since pypower just made a new release.

change net.line.imax_ka to net.line.max_i_ka

All other variables are named with the convention <min/max>_<variable_name> (e.g. max_loading_percent, max_vm_pu etc.). imax_ka should be max_i_ka to comply with that convention

State estimation problem when using pandapower

I am using pandapower to solve the state estimation model, but I can't get the reasonable SE results for the IEEE-14 bus system. The python code is as follows:
import pandapower as pp
import pandapower.networks as pn
from pandapower.estimation import estimate
import numpy as np

net = pn.case14()
pp.runpp(net)
for i in net.bus.index:
pp.create_measurement(net, "v", "bus", net.res_bus.vm_pu[i] * (np.random.random()*0.01 + 1), .01, i)
pp.create_measurement(net, "p", "bus", net.res_bus.p_kw[i] * (np.random.random()*0.01 + 1), .01, i)
pp.create_measurement(net, "q", "bus", net.res_bus.q_kvar[i] * (np.random.random()*0.01 + 1), .01, i)
for i in net.line.index:
pp.create_measurement(net, "p", "line", net.res_line.p_from_kw[i] * (np.random.random()*0.01 + 1), net.res_line.p_from_kw[i] * 0.01, bus=net.line.from_bus[i], element=i)
pp.create_measurement(net, "q", "line", net.res_line.q_from_kvar[i] * (np.random.random()*0.01 + 1), net.res_line.q_from_kvar[i] * 0.01, bus=net.line.from_bus[i], element=i)

success = estimate(net,init='flat')

And after running the above code, it can be found that the SE results are largely different from the power flow results. So could you please help me to find out what is wrong with my program? Thanks a lot.

opf basic example fails

I ran the first part of your simple OPF example until pp.runopp(net, verbose=True) - it fails stating

Traceback (most recent call last):
  File "xxx/python/pypower/pandapower_test.py", line 11, in <module>
    pp.runopp(net=net)
  File "xxx/virtualenvs/misc/pypower/lib/python3.5/site-packages/pandapower/run.py", line 403, in runopp
    _optimal_powerflow(net, verbose, suppress_warnings, **kwargs)
  File "xxx/virtualenvs/misc/pypower/lib/python3.5/site-packages/pandapower/optimal_powerflow.py", line 38, in _optimal_powerflow
    ppc, ppci = _pd2ppc(net)
  File "xxx/virtualenvs/misc/pypower/lib/python3.5/site-packages/pandapower/pd2ppc.py", line 65, in _pd2ppc
    net["_is_elements"] = aux._select_is_elements_numba(net)
  File "xxx/virtualenvs/misc/pypower/lib/python3.5/site-packages/pandapower/auxiliary.py", line 354, in _select_is_elements_numba
    if net["_options"]["mode"] == "opf" and net._is_elements is not None:
  File "xxx/virtualenvs/misc/pypower/lib/python3.5/site-packages/pandapower/auxiliary.py", line 157, in __getattr__
    cls=self.__class__.__name__, name=key
AttributeError: 'pandapowerNet' instance has no attribute '_is_elements'

Any hints on this?
(pandapower v1.4.0)

save pandapower net as JSON file

The pickle files can only be read from python, so it would be helpful to have a possibility to save pandapower networks in an universally readable format such as JSON.

ImportError: cannot import name 'runpp'

Hi,

I have tried all installation methods from the documentation, but importing the pandapower module (import pandapower) always results in:

ImportError: cannot import name 'runpp'

My current environment is

python --version
Python 3.6.1 :: Anaconda 4.4.0 (64-bit)
pip freeze | grep pandapower
pandapower==1.3.0

where pandapower is directly installed from the development branch.

Couldn't import dot_parser, loading of dot files will not be possible.

Hello, I found a bug in your package.
When I tried to import an MATPOWER case the following error occurred:

Couldn't import dot_parser, loading of dot files will not be possible.
Traceback (most recent call last):
  File "<stdin>", line 32, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pandapower/converter/matpower/from_mpc.py", line 49, in from_mpc
    ppc = _mpc2ppc(mpc_file, casename_mpc_file)
  File "/usr/local/lib/python2.7/dist-packages/pandapower/converter/matpower/from_mpc.py", line 63, in _mpc2ppc
    _adjust_ppc_indices(ppc)
  File "/usr/local/lib/python2.7/dist-packages/pandapower/converter/matpower/from_mpc.py", line 82, in _adjust_ppc_indices
    ppc["gen"][:, 0] -= 1
IndexError: too many indices

This error occurred because sometimes ppc["gen"] could be an array, not a matrix. So, I reshaped the array to transform it in a single line matrix by adding the following code before it.

def _adjust_ppc_indices(ppc):
    # adjust indices of ppc, since ppc must start at 0 rather than 1 (matlab)
    ppc["bus"][:, 0] -= 1
    ppc["branch"][:, 0] -= 1
    ppc["branch"][:, 1] -= 1
    #Start of changes by Vitor Batista
    """
    shp = ppc['gen'].shape
    if len(shp) == 1:
        ppc['gen'] = np.reshape(
            ppc['gen'], [1, shp[0]])
    """
    #End of changes by Vitor Batista
    ppc["gen"][:, 0] -= 1

Probably there is a faster way to solve it, but it fixed my problem.

grids without slack nodes

Pypower allows grids withouth slack nodes and changes the first PV-bus to a slack node if none is available.
I think it would be better if a warning / error is raised instead and the toolbox should get a function to change a PV node to a slack node.

See bustypes.py:
# pick a new reference bus if for some reason there is none (may have been # shut down) if len(ref) == 0: # bugfix Pypower: must be an numpy array! ref = zeros(1, dtype=int) ref[0] = pv[0] # use the first PV bus pv = pv[1:] # take it off PV list

invalid documentation

create_ext_grid has invalid doc for it's parameter va_degree
"va_degree (float, default 0.) - name of of the external grid*"
compare
"name (string, default None) - name of of the external grid"

This is the one mistake I came across until now but bugs seldon come alone and maby someone should take a closer look at the doc in general.

It is no big deal but I liked pp (and python in geral) for beeing well documented and it would be a shame if it could not get rid of this clay feed.

OPF tests fail if connectivity check = True

I removed the non-numba version of the connectivity check, since the reverse lookup (ppc2pd) is not unambiguously. So connectivity check is only available if numba is installed.

Now the OPF tests fail if check_connectivity=True -> I changed the default parameter for check_connectivty to False in runopp()

@friederikemeier could you check what the problem is?

PV generator

What would be the best way to model a fairly large 7MW pv plant as a source
PV = Photo Voltaic in this case
Would I use a static or Voltage Controlled Generator
Sorry for posting here. I could not find the best place to ask questions.

Tobie

incorrect calculation of ZIP-Loads with voltage angles

In the following test case:

  • loads have const_i_percent=100
  • transformer has phase shift != 0 (5*30)
  • calculate_voltage_angles = True

the load flow results are false:

  • negative values in net.res_load
  • wrong voltage magnitudes and degrees in net.res_bus

A simple example to recreate the issue is in the file test.p

test.zip

P. S. see test_zip_loads_results() in test_runpp.py

switches at three winding transformers

switches at three winding transformers are not yet implemented, but the create_switch function did accept "t3" as valid value for the element type. A switch with et="t3" would have no effect however even if open.

I adapted the create function so that an exception is raised (here) as a quick fix. Of course in the long run we should implement switches for three winding transformers...

numba dependency

As raised in this pull request #57 by kdheepak, pandapower can currently not be imported without numba. We should either

  1. Find a way to continously test if pandapower works without numba (e.g. by uninstalling numba in one python version and checking if tests still pass)
  2. Give up the idea that pandapower runs with and without numba and just make numba a mandatory dependency

The problem with numba is that it is a C library that can't be easily installed through pip, which is why we wanted to keep it optional. On the other hand, it would be a lot of work and if people use anaconda, installing numba is not a problem.

Opinions?

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.