Skip to content

Quickstart Guide PSCAD

Mathias Kristensen edited this page Mar 21, 2023 · 7 revisions

System Requirements

Developed with PSCAD release 5.0.1.0 (2022/05/05) with Python 3.7.2 (embedded) dependent on python packages as specified in requirements.txt

Since the script uses the embedded PSCAD python environment (for now #109), the external packages cannot be installed and imported in the standard way. The easiest way around this is the following procedure:

  1. Install Python 3.7.2
  2. Install requirements from PSCAD requirements.txt into the python 3.7.2 installation (or a virtual environment). This can be done by executing “python -m pip install -r requirements.txt”.
  3. Adapt the path in line 2 of execute.py so it points to the python 3.7.2 installations site-packages folder. The default path is C:\Program Files\Python37\Lib\site-packages.

Preperation

  • Extract or copy all test bench files and your model (.pscx-file) into the same common folder on your PC.


  • Fill in the model-specific information of the 'Input' sheet in the 'TestCases.xlsx' file.

NOTE: 'ProjectName' should be the same as the name of the specific model/project (.pscx file). Do not use any Danish special letters (Æ/æ, Ø/ø, Å/å).

Model Setup in PSCAD

  • Open a workspace with all the models and libraries required for running simulations. This includes ETRAN libraries and any resources.
  • Load in the 'PP-MTB Library_Energinet_VX.X.pslx' into the workspace.
  • Load in the 'PP-MTB Execute_Energinet_VX.X.py'. Do this by right-clicking the Resources folder, click 'Add' -> 'Script\Apps (*.py, *.exe, *.bat)'.


  • Disconnect and disable the power grid from POC in the model. Make sure to keep any measurements present at POC (Shown below in the red dotted box.). Otherwise the model might not work properly.


  • Copy the test bench from the 'PP-MTB Library_Energinet_VX.X.pslx' into the model. Do this by right-clicking the 'MTB VXXX*' and then right-click 'Definitions' -> 'Paste Special' -> 'Paste With Dependents' in the model.

  • When the test bench definition is copied into the model, connect the test bench to the model. This is done bt right-clicking the definition of the MTB, copying it into the schematic and connect it to the rest of the model.


  • Cut the 'Plant Control' block from inside the 'Model Test Bench (MTB)' block and connect it to the PPC control signals of the model.

Script Execution

  • Right-click the python script in the model and press 'Run' and the test bench will automatically run and plot the cases defined in 'TestCases.xlsx'.

Script Execution Finished

  • Once the script has finished and the simulation runs are complete, individual results can be view under 'Simulation Sets' -> 'PMR' -> 'Model Name' with numbers corresponding to the rank of the case set in 'TestCases.xlsx'. Acces the MTB block to view different plots. Keep in mind, that this is only possible until you close the application.

  • The test bench also creates a set of '.csv'- and corresponding '.inf'-files that can be used with the PP-MTB Plotter to plot the results and optionally compare it with results from PowerFactory. These files are found under the folder 'Output'.

Running individual cases without the script

Individual cases can be run by replacing the "Rank#" components in both the "Model testbench (MTB)" and "Plant control" blocks with a constant integer with the desired case id.

image image