C++ Newton Raphson power flow code for power systems
This is the first attempt to publish C++ code related to power systems operation.
The aim is to create a benchmark library of emerging power system algorithms in order to evaluate them in any microprocessor platform.
Acquire the source code by cloning the git repository:
$ git clone https://github.com/harryskon/Newton-Raphson-Power-Flow.git
Enter the directory and compile
$ make
Important notes:
- The files are compiled using C++14 standard.
- Using godbolt.org it appears that the earilest version to support -std=c++14 is GCC 4.9.0 or Clang 3.5.0. Thus, to use the -std=c++14 flag, update g++/gcc.
- To update gcc/g++ on Raspberry Pi 2 (wheezy) could be could be to install the g++ 4.9 packages from "Jessie".
First bring the current Wheezy up-to-date:
$ sudo apt-get update
$ sudo apt-get upgrade
Then edit /etc/apt/sources.list so that you replace the string "wheezy" with "jessie":
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.wheezy
$ sudo vi /etc/apt/sources.list
Now update the package list and install the 4.9 version of GCC/G++:
$ sudo apt-get update
$ sudo apt-get install gcc-4.9 g++-4.9
After this revert to the "original" package list:
$ sudo cp /etc/apt/sources.list.wheezy /etc/apt/sources.list
$ sudo apt-get update
This leaves the original gcc,g++ in place. Now, to compile with the 4.9 version, then either set the CC and CXX env vars accordingly or invoke the compilers as gcc-4.9 or g++-4.9 explicitly.
The Makefile of the project has been updated accordingly to use any gcc/g++ version >= 4.9.
The executable after compilation nrpowerflow
takes one argument which is the number(#) of IEEE-bus system.
Example (IEEE 14-bus system):
$ ./nrpowerflow 14
- Harrys Konstantinou - Website
This project is licensed under the MIT License - see the LICENSE file for details