Skip to main content

Python Scripting for DIgSILENT PowerFactory: Leveraging the Python API for Scenario Manipulation and Analysis of Large Datasets

  • Chapter
  • First Online:

Part of the book series: Green Energy and Technology ((GREEN))

Abstract

The need to set up and simulate different scenarios, and later analyse the results, is widespread in the power systems community. However, scenario management and result analysis can quickly increase in complexity as the number of scenarios grows. This complexity is particularly high when dealing with modern smart grids. The Python API provided with DIgSILENT PowerFactory is a great asset when it comes to automating simulation-related tasks. Additionally, in combination with the well-established Python libraries for data analysis, analysis of results can be greatly simplified. This chapter illustrates the synergic relationship that can be established between DIgSILENT PowerFactory and a set of Python libraries for data analysis by means of the Python API, and the simplicity with which this relationship can be established. The examples presented here show that it can be beneficial to exploit the Python API to combine DIgSILENT PowerFactory with other Python libraries and serve as evidence that the possible applications are mainly limited by the creativity of the user.

The original version of this chapter was revised: ESM files have been included. The erratum to this chapter is available at https://doi.org/10.1007/978-3-319-50532-9_15

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   99.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   129.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    Detailed installation instructions for the Python interpreter are provided in Chap. 19 of the PowerFactory 15 user manual (DIgSILENT PowerFactory Version 15 User Manual, DIgSILENT GmbH, Gomaringen, Germany, 2015). See Sect. 4.1 of this chapter for a discussion on how to manage multiple versions of the Python interpreter simultaneously.

  2. 2.

    In Python, the __init__ method of a class is automatically called when the class is instantiated. The line pfsim = PowerFactorySim() causes the __init__ method from Fig. 3 to be called.

  3. 3.

    CSV (Comma-Separated Values, csv) are plain text that files store data in tabular form by separating values with commas.

  4. 4.

    Python iterables are objects capable of returning their members one at a time. For example, the line for member_object in iterable_object: makes the iterable iterable_object return its members one by one, where iterable_object can be a list, a dictionary, etc.

  5. 5.

    https://virtualenv.pypa.io.

  6. 6.

    https://www.continuum.io/.

  7. 7.

    http://conda.pydata.org/miniconda.html.

References

  1. K.J. Millman, M. Aivazis, Python for scientists and engineers. Comput. Sci. Eng. 13(2), 9–12 (2011)

    Article  Google Scholar 

  2. S. van der Walt, S.C. Colbert, G. Varoquaux, The NumPy array: a structure for efficient numerical computation. Comput. Sci. Eng. 13(2), 22–30 (2011)

    Article  Google Scholar 

  3. T.E. Oliphant, Python for scientific computing. Comput. Sci. Eng. 9(3), 10–20 (2007)

    Article  Google Scholar 

  4. W. McKinney, Data Structures for Statistical Computing in Python, in Proceedings of the 9th Python in Science Conference, ed. by S. van der Walt, J. Millman (2010), pp. 51–56

    Google Scholar 

  5. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, E. Duchesnay, Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011)

    MathSciNet  MATH  Google Scholar 

  6. J.D. Hunter et al., Matplotlib: A 2D graphics environment. Comput. Sci. Eng. 9(3), 90–95 (2007)

    Article  Google Scholar 

  7. P. Kundur, N.J. Balu, M.G. Lauby, Power system stability and control, vol 7 (McGraw-hill New York, 1994)

    Google Scholar 

  8. S. Teimourzadeh, B. Mohammadi-Ivatloo, Probabilistic Power Flow Module for PowerFactory DIgSILENT, in PowerFactory Applications for Power System Analysis, eds. by F.M. Gonzalez-Longatt, J.L. Rueda (Springer International Publishing, 2014), pp. 61–84

    Google Scholar 

  9. B. Slatkin, Effective Python: 59 Specific Ways to Write Better Python (Pearson Education, Mar. 2015)

    Google Scholar 

  10. S. Gupta, R. Kambli, S. Wagh, F. Kazi, Support-vector-machine-based proactive cascade prediction in smart grid using probabilistic framework. IEEE Trans. Industr. Electron. 62(4), 2478–2486 (2015)

    Article  Google Scholar 

  11. P. Zhang, X. Wu, X. Wang, S. Bi, Short-term load forecasting based on big data technologies. CSEE J. Power Energy Syst. 1(3), 59–67 (2015)

    Article  Google Scholar 

  12. J. Zhang, C.Y. Chung, Z. Wang, X. Zheng, Instantaneous electromechanical dynamics monitoring in smart transmission grid. IEEE Trans. Industr. Inf. 12(2), 844–852 (2016)

    Article  Google Scholar 

  13. M. Ozay, I. Esnaola, F.T.Y. Vural, S.R. Kulkarni, H.V. Poor, Machine learning methods for attack detection in the smart grid. IEEE Trans. Neural Networks Learn. Sys. 27(8), 1773–1786 (2016)

    Article  MathSciNet  Google Scholar 

  14. R.K. Pandey, S. Kumar, C. Kumar, Development of Cluster Algorithm for Grid Health Monitoring, in 2016 2nd International Conference on Control, Instrumentation, Energy Communication (CIEC) (Jan. 2016), pp. 377–381

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Claudio David López .

Editor information

Editors and Affiliations

2.1 Electronic Supplementary Material

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

López, C.D., Rueda Torres, J.L. (2018). Python Scripting for DIgSILENT PowerFactory: Leveraging the Python API for Scenario Manipulation and Analysis of Large Datasets. In: Gonzalez-Longatt, F., Rueda Torres, J. (eds) Advanced Smart Grid Functionalities Based on PowerFactory. Green Energy and Technology. Springer, Cham. https://doi.org/10.1007/978-3-319-50532-9_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-50532-9_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-50531-2

  • Online ISBN: 978-3-319-50532-9

  • eBook Packages: EnergyEnergy (R0)

Publish with us

Policies and ethics