Skip to content

albertjlguo/sfcNordic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secondary Frequency Control (SFC)/ Automatic Generation Control (AGC) in Nordic grid

Installing Python 3 applications and libraries with Conda

Download the Miniconda installer

At a command prompt, enter (Mac):

curl -o ./Miniconda3-latest-MacOSX-x86_64.sh -k https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh

In Linux (Ubuntu, CentOS, ...):

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

Run the installer

Mac:

bash Miniconda3-latest-MacOSX-x86_64.sh

Linux:

bash Miniconda3-latest-Linux-x86_64.sh

Setting the install directory

Follow the prompts on the installer screens.

If you are unsure about any setting, accept the defaults. You can change them later.

To make the changes take effect, close and then re-open your terminal window.

To test your installation, in your terminal window or Anaconda Prompt, run the command conda list.

For a successful installation, a list of installed packages appears.

To check if the Python has been installed successfully, in terminal:

python -V

It's done if the python version is 3.x nor 2.x.

For Mac users (macOS 10.15 Catalina, macOS 11.0 Big Sur, and later)

The default shell of terminal is now "zsh" instead of "bash".

According to the offcial doc from conda (search "zsh" in the webpage), we need to find the path/direction of miniconda3's folder, for instance, in my case:

/Users/realgjl/miniconda3

Then in the Terminal.app:

source /Users/realgjl/miniconda3/bin/activate
conda init zsh

Check the python version again and/or check if "conda" command works.

Suggestions: add path to the system

Go to the file "/etc/paths", and add the path of python binary folder (like "/Users/realgjl/miniconda3/bin") to it. Make sure this new miniconda directory is the first one, meaning that it will have precedence.

p.s., to show the hidden files in Mac, press: "command" + "shift" + ".".

Configuring Conda

Before first use, the conda package management system needs some initial configuration.

Make sure all the components are updated to their latest versions by entering:

conda update conda

at the command prompt. If there are any updates, you will be prompted to agree their installation.

Add the a number of channels. This step is required so that the conda installer knows where to get the installation files for your applications from. At the command prompt:

conda config --add channels conda-forge
conda config --add channels anaconda
conda config --add channels apetros

Installing Python packages and applications

It's preferred to install scipy instead of independently installing numpy, mkl and other independencies. Scipy will automatically install packages like intel-openmp, mkl, mkl-service, numpy and blas.

conda install -c anaconda scipy

conda install -c anaconda jupyterlab

To make sure that you have the MKL libraries installed, you can test via ipython:

ipython
import numpy as np
np.__config__.show()

"blas_mkl_info" should NOT shown as "not available", like:

mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/home/home01/el17jg/miniconda3/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/home/home01/el17jg/miniconda3/include']
conda install -c conda-forge pandas 
conda install -c conda-forge matplotlib 
conda install -c apetros pyramses

Test if pyramses is in your path via ipython:

import pyramses
ram = pyramses.sim()

Alternatively, you can install pyramses via pypi.

Other package(s) and application(s)

intel

If the error "libifport.so.5: : cannot open shared object file" occurs, you may have to install Intel's redistributables package. You can review this intel's forum as a reference.

gnuplot

You _may need to install gnuplot although it is not necessary if you remote to a supercomputer. You can choose to use gnuplot or not in ~/settings.dat:

$CALL_GP F;
$CALL_GP T;
# $CALL_GP F;

Start

  1. Clone this respository;
  2. Move to examples folder, start with nordic.ipynb

Frequency and Power

Some Reference

  1. PES_TR19_Test-Systems-for-Voltage-Stability-Analysis-and-Security-Assessment1.pdf (Page 12: Nordic Grid map);

  2. PID control from Caltech;

  3. My Interim Report;

  4. eth - Deterministic Sizing of the Frequency Bias Factor of Secondary Control.pdf & eth-Frequency Control in the European Power System Considering the Organisational Structure and Division of Responsibilities.pdf;

  5. Delay-Robust Distributed Secondary Frequency Control: A Case Study, Alghamdi, S, Smith, N, Schiffer, J, Aristidou, P.

License

Nordic-Test-System is licensed under GPLv3. See LICENSE.txt for more details.

About

Leeds bachelor final project: Centralized control algorithms for Nordic Smart Grid operation (Python x MATLAB).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published