Skip to main content

Example: How to overlay results with real-world data

How to overlay results with real-world data

Last updated: 23 July 2024

Software required:

PSS®E
PSCAD
PowerFactory

Quick start

Before running this example, complete the following:

  • Each Start Node has in its title the name of the software it is associated with. If you do not have access to the software (e.g PSS®E, PSCAD™ or PowerFactory), disable the Node.

Background

Example file to demonstrate how to use gridmo's Data node, perform manual and automatic alignment of data, and overlay results with real-world data. Also includes an example for initialising power system software from data files.

Tutorial

note

This multi-part example assumes you have a basic understanding of the gridmo platform. If you are new to gridmo, please see the Getting started guide.

Part 1 - Loading data into gridmo

In this first part of the data benchmarking series, we will show you how to import real-world data (in .csv format) into the gridmo platform, so you can use it to overlay with dynamic study results.

In this part, we will:

  • Import real-world data from a generating system into the gridmo platform.
  • Plot the real-world data.

1) Add the data you want to import into your Engine's Inputs folder

In gridmo, you can import generic time-series data by using the Data Node.

Place the data file in the Inputs folder of your gridmo Engine (including subfolders as desired) and paste the relative file path to the inputs folder in the Data Node's Input file name field, such as gridmo\data\e002_q_step_data.csv.

danger

Currently, only .csv files are currently supported by the Data Node.

2) Create a new gridmo Project and add the following Nodes

  • Start Node
  • Data Node
  • Plot Node
  • End Node

And connect the Nodes together as shown below.

example of a data connected to a plot

3) Configure the Data Node

  • Double click on the Data Node to open the configuration window.
  • Set the Input file name to the relative path of the .csv file you want to import, such as gridmo\data\e002_q_step_data.csv.
  • Switch to the Define outputs tab.
  • Add the following OUTPUT commands to convert the columns in the .csv file to Internode Variables for use in gridmo.
Data Node's Outputs field
// Convert from CSV column names into Internode Variables
OUTPUT, COL=V_pu, NAME=i_ch_poc_v
OUTPUT, COL=P_MW, NAME=i_ch_poc_p
OUTPUT, COL=Q_MVAr, NAME=i_ch_poc_q

The above commands convert each column from the name in the .csv file to an Internode Variable for use in gridmo. Specifically:

  • The column V_pu can be accessed by Nodes connected to this Data Node using i_ch_poc_v
  • The column P_MW can be accessed by Nodes connected to this Data Node using i_ch_poc_p
  • The column Q_MVAr can be accessed by Nodes connected to this Data Node using i_ch_poc_q
tip

If your .csv file is using a different unit than the unit you want for your simulation, you can use the optional argument VALSCALE= to apply a multiplicative scale.

You do not need to directly modify the source .csv file.

For example, if you .csv data file has voltage in kV (with a 33 kV base) you can use the following command:

Example of using VALSCALE= to convert kV to per unit
OUTPUT, COL=V_at_33kV, NAME=i_ch_poc_v, VALSCALE=1/33

4) Configure the Plot Node

  • Double click on the Plot Node to open the configuration window.
  • Set the Plot type to PDF to output a PDF file.
  • Enter an output file name, such as Data example import.
  • Enter a plot title, such as Imported real-world data into gridmo.
  • In the Define Subplots tab:
    • Set the x-axis minimum 3 and maximum to 10
    • Under Subplots select 1 page, 2 rows and 3 columns.
    • Click on the + to add a new subplot. For each subplot:
      • Enter a title in Subplot title, such as Vpoc.
      • Under y-axis Channels enter each of the Internode Variables with the double curly brackets, such as {{i_ch_poc_v}}
example screenshot of configured subplots in plot Node

5) Launch the simulation

  • Launch the simulation
  • The output plot should show the real-world data you imported plotted as per your configuration of the Plot Node.

6) Review the results

  • We can see in our outputs folder (example below) that we have plotted the real-world data:
    • ✅ Point of connection voltage, active power and reactive power are all plotted.
    • ✅ We can see in our data that the test being recorded appears to be a single reactive power step.
example of results from step 1, showing data only, POC P Q and V

Next part

In the next part, we will overlay the real-world data we added in this step with the results of a dynamic study.

Part 2 - Adding a dynamic simulation

In this second part of the data benchmarking series, we will show you how to overlay real-world data with dynamic simulation results. This is a common task when benchmarking dynamic simulations against real-world data, such as hold-point testing data (R1, R2) or site data.

In this part, we will

  • Add a PSS®E simulation to the gridmo project we started in the previous step.
  • Overlay the PSS®E simulation results with the real-world data.

In the previous section, we imported real-world data and plotted it using the Data and Plot Nodes. We could see a single reactive power step in our real-world data. Specifically, we could see a step from 0 MVAr to about 26 MVAr during the simulation.

In this section, we will add a dynamic simulation to the gridmo project and plot the real-world data against the dynamic simulation results.

1) Add PSS®E Nodes to your Flow

  • PSS®E Static Node (or PowerFactory Static Node)
  • PSS®E Dynamic Node (or PowerFactory Dynamic Node)

2) Connect the Nodes as shown below

  • The PSS®E Static Node should be connected to the PSS®E Dynamic Node.
  • The existing Data Node should be connected from the Start Node to the Plot Node.
  • The PSS®E Dynamic Node should also be connected to the Plot Node.
example of a data Node in parallel with a psse static and dynamic Node, both being plotted

3) Configure the PSS®E Static Node

  • Set the Model to gridmo\wecc-solar\psse\solar.sav to use an example 175 MW solar farm's PSS®E case file.
  • Under the Commands field add the following commands, which describe what we want the PSS®E model to initialize to:
PSS®E Static Node's Commands field
// Set SCR, XR, and POC P, Q and V - then apply all CONTROL commands at the same time
SET, LINE=1000->999#1, STATUS=IN, SCR=7.5, XR=4
CONTROL, GEN=999#1, Q=VDIRECT, ATBUS=1000, VTARGET=1.00, QMIN=-9999, QMAX=9999
CONTROL, GEN=91003#S1, ATLINE=1001->1000#1, P=175
CONTROL, GEN=91003#S1, ATLINE=1001->1000#1, Q=FIXED, QTARGET=0
SOLVE

The above commands:

  • Set the SCR and X/R ratio for this example SMIB model to 7.5 and 4 respectively.
  • It then controls the example solar farm to achieve P=175 MW, Q=0 MVAr at the solar farm's connection point.
  • It also uses the infinite bus generator to achieve 1.00 pu voltage at the connection point.

4) Configure the PSS®E Dynamic Node

  • Select the tickbox to enable Use model from linked PSS®E Static Node
  • Set the Dynamics model data to gridmo\wecc-solar\psse\solar.dyr to use an example 175 MW solar farm's PSS®E dynamic data record.
  • In the Define simulation tab:
    • Set the Simulation time [seconds] to 60 seconds.
    • Add the following commands into the Commands field:
PSS®E Dynamic Node's Actions field
// Put solar farm in Q control mode (see PSSE Model PDF docs for ICON reference)
CONTROL, AT=0, ICON=M+5, GEN=91003#S1, DYRMODEL=REPCA1, VAL=0

// Set initial P and Q at POC
CONTROL, AT=0, VAR=L+3, GEN=91003#S1, DYRMODEL=REPCA1, VAL=175, VALSCALE=1/200
CONTROL, AT=0, VAR=L+1, GEN=91003#S1, DYRMODEL=REPCA1, VAL=0

// Make a single Q to 26.25 MVAr (on S base of 200 MVA - which this PSSE model requires)
CONTROL, AT=5, VAR=L+1, GEN=91003#S1, DYRMODEL=REPCA1, VAL=26.25, VALSCALE=1/200
  • The above commands:

    • Set the solar farm's controller into fixed reactive power reference mode.
    • Set the initial active power to 175 MW and sets the initial reactive power to 0 MVAr.
    • Performs a single reactive power reference step at 5 seconds from 0 MVAr to 26.25 MVAr.
  • In the Define outputs tab, add the following outputs:

PSS®E Dynamic Node's Outputs field
OUTPUT, BUS=1000, VAL=V, NAME=i_ch_poc_v
OUTPUT, LINE=1001->1000#1, VAL=P, NAME=i_ch_poc_p
OUTPUT, LINE=1001->1000#1, VAL=Q, NAME=i_ch_poc_q
  • The above commands:
    • Measure the voltage magnitude at the connection point and assign the name i_ch_poc_v.
    • Measure the active power at the connection point and assign the name i_ch_poc_p.
    • Measure the reactive power at the connection point and assign the name i_ch_poc_q.

5) Launch the simulation

  • Launch the simulation using the green Launch button in the top right of the web-app and enter your Engine ID.
tip

As we are naming the outputs i_ch_poc_v, i_ch_poc_p and i_ch_poc_q - which are the same as the names we defined as the outputs of the Data Node - we do not need to make any changes to the Plot Node.

The Plot Node will automatically plot all connected Nodes with the same output names on the same subplot.

6) Review results

  • We can see in our outputs folder (example below) that we have plotted the real-world data against the dynamic simulation results:
    • ✅ There is a reactive power step in both PSS®E and the real-world data
    • ⚠️ The benchmarking is really poor, the reactive power steps are done at different times during the simulation, the initial active power isn't 175 MW and the POC voltage magnitude isn't 1.00 pu.
example of results from step 2, showing psse dynamic and data overlayed but with a very poor benchmark

Next part

In the next part, we will use the manual alignment mode of the Data Node to improve the benchmarking with the PSS®E result.

Part 3 - Using manual alignment mode

In this third part of the data benchmarking series, we will use the Data Node's alignment capability to improve the benchmark with the PSS®E result.

In the previous section, we overlayed a PSS®E dynamic simulation with our real-world data and saw a very poor benchmark. To improve this, we first need to review our source data in Excel (or similar).

1) Open the source data in Excel to find the index of the step

You can find the example data in your gridmo Engine's Inputs folder in the gridmo folder, in a subfolder called data. The file we are using for this example is e002_q_step_data.csv.

We can see:

  • The time column starts from approx 377 seconds, which is relatively common for real-world data which use a timestamp or similar (e.g. it doesn't start at 0 seconds).
  • By creating a 2-D line plot using the Q_MVAr column, we can see that the reactive power step occurs at an index (row number in Excel) of approximately 45500.
  • Our aim is to tell the gridmo platform to shift the real-world data so that the reactive power step occurs at a defined time in the 'simulation' world e.g. at same time as the PSS®E simulation.example of excel showing the row index
danger

gridmo uses row indices (numbers) instead of time values for alignment.

This is because:

  • The data might be in a complex timestamp format, which is common if exported from an Elspec PQM (for example 17/04/2024 7:15:32 PM) which adds unnecessary calculation burden on you (to convert a timestamp into seconds since start of a simulation).
  • Even if the data is in a simple format like seconds (similar to our example data), requiring a time offset requires extra calculations on your behalf if the data doesn't start at 0 seconds - which is common especially if exported from real-world data.

2) Update the Data Node to use manual alignment mode

  • Double click on the Data Node.
  • Select the Process data tab in the Node configuration window.
  • Select Manual align button in the X-axis shift area.
    • In the Row number field enter the row we found from excel, in our example 45464.
    • In the Time [seconds] field enter the time in seconds that the step occurs in the simulation, in our example 5 seconds.
  • Click Apply to save the changes

We have now configured the Data Node to shift the real-world data so that the reactive power step occurs at 5 seconds in the simulation world.

3) Update the PSS®E Dynamic and Plot Node to have a shorter simulation time

Now that we've shifted the real-world data and the reactive power step isn't occurring around the 45-second mark, we can update the PSS®E Dynamic and Plot Nodes to have a shorter simulation time so the output plot is easier to read.

  • Double click on the PSS®E Dynamic Node.
  • Under the Define simulation tab, set the Simulation time [seconds] to 10 seconds.
  • Click Apply to save the changes
  • Double click on the Plot Node.
  • Under the Define subplots tab, set the x-axis Min [seconds] to 4 and the x-axis Max [seconds] to 10.
  • Click Apply to save the changes

We have now configured the Data Node to shift the real-world data so that the reactive power step occurs at 5 seconds in the simulation world.

4) Launch the simulation

  • Launch the simulation using the green Launch bottom in the top right of the web-app and enter your Engine ID.

5) Review results

  • We can see in our outputs folder (example below) that our real-world data has been shifted:
    • ✅ The reactive power step now occurs at 5 seconds in the simulation.
    • ⚠️ The benchmarking is better, but still poor (initial active power, reactive power and voltage are still incorrect) .
example of results from step 3, showing psse dynamic and data overlayed, benchmark still poor but now happens at the same time

Next part

In the next part, we will export the initial values from the Data Node and import them into the PSS®E Static Node to improve the benchmarking even further.

Part 4 - Importing from data into PSS®E Static

In this fourth part of the data benchmarking series, we will export the initial values of POC V, P and Q from the Data Node and import the values into the PSS®E Static Node to improve the benchmark with the dynamic result.

In the previous section, we changed the Data Node to fix the time of the reactive power step to 5 seconds in the simulation.

We're going to modify our Flow so that we can export values from the Data Node into PSS®E Static Node. This will allow us to use the initial values from the real-world data in the PSS®E Static Node.

1) Modify your Flow so the PSS®E Static depends on Data

Update your gridmo Flow by dragging Nodes (left click and drag) and deleting edges (left click, then press the Delete key) so that the PSS®E Static Node depends on the Data Node like the below.

example of updated Flow chart with data first
note

In our re-arranged Flow, the Data Node is still connected to the Plot Node, this means we still do not require any changes to our Plot Node for this step.

2) Update the Data Node to export the initial values

  • Double click on the Data Node.
  • Select the Define outputs tab in the Node configuration window.
  • Add the following rows in addition to those which already exist in this field.
Data Node's Outputs field
// Export values at the start of the data - note the AT=0 arguments have been added
OUTPUT, COL=V_pu, NAME=i_ch_poc_v_initial, AT=0
OUTPUT, COL=P_MW, NAME=i_ch_poc_p_initial, AT=0
OUTPUT, COL=Q_MVAr, NAME=i_ch_poc_q_initial, AT=0
  • The above OUTPUT commands has the optional AT= argument, which means export the single value instead of the entire column of data. We have set them to output at 0 seconds (after being shifted by the manual alignment mode we turned on in the previous step). Specifically:
    • The Internode Variable i_ch_poc_v_initial stores the initial voltage from the Data Node (in per unit - the same unit as the in the .csv file)
    • The Internode Variable i_ch_poc_p_initial stores the initial active power from the Data Node (in MW - the same unit as the in the .csv file)
    • The Internode Variable i_ch_poc_q_initial stores the initial reactive power from the Data Node (in MVAr - the same unit as the in the .csv file)
  • Click Apply to save the changes
tip

If your .csv file is using a different unit than the unit you want for your simulation, you can use the optional argument VALSCALE= to apply a multiplicative scale.

You do not need to directly modify the source .csv file.

For example, if you .csv data file has voltage in kV (with a 33 kV base) you can use the following command:

Example of using VALSCALE= to convert kV to per unit
OUTPUT, COL=V_at_33kV, NAME=i_ch_poc_v_initial, AT=0, VALSCALE=1/33

3) Update the PSS®E Static Node to use the new Internode Variables

Now that the Data Node is exporting the initial values, we can update the PSS®E Static Node to use these values.

  • Double click on the PSS®E Static Node.
  • Select the Define simulation & Define outputs tab in the Node configuration window.
  • Replace the commands in the Commands field with the following (the lines which have changed from the previous steps are highlighted):
PSS®E Static Node's Commands field
// Set SCR, XR, and POC P, Q and V - then apply all CONTROL commands at the same time
SET, LINE=1000->999#1, STATUS=IN, SCR=7.5, XR=4

// Instead of fixed values, we use values imported from the Data Node
CONTROL, GEN=999#1, Q=VDIRECT, ATBUS=1000, VTARGET={{i_ch_poc_v_initial}}, QMIN=-9999, QMAX=9999
CONTROL, GEN=91003#S1, ATLINE=1001->1000#1, P={{i_ch_poc_p_initial}}
CONTROL, GEN=91003#S1, ATLINE=1001->1000#1, Q=FIXED, QTARGET={{i_ch_poc_q_initial}}
SOLVE
  • The above commands:
    • Set the SCR and X/R ratio for this example SMIB model to 7.5 and 4 respectively.
    • It then controls the example solar farm to achieve an active power and reactive power from the Internode Variables we defined in the Data node above.
    • It also uses the infinite bus generator to achieve a voltage at the connection point as per the i_ch_poc_v_initial Internode Variable.
  • Click Apply to save the changes

4) Launch the simulation

  • Launch the simulation using the green Launch bottom in the top right of the web-app and enter your Engine ID.

5) Review results

  • We can see in our outputs folder (example below) that our real-world data has been shifted:
    • ✅ The reactive power step now occurs at 5 seconds in the simulation.
    • ✅ The initial values of the POC voltage, active power and reactive power now match between the real-world data and the dynamic simulation.
improved benchmark

Revision history

  • v1.4.15.6 (23 July 2024)
    • Updated Sticky Node helper text in example.
  • v1.4.15 (20 June 2024)
    • First release of example file.