Enhanced result export features

PyDSS provides users with high level options to export results and variables of interest. Within the Scenario_settings.TOML file there are four settings users are able to change

"Log Results" = true
"Return Results" = false
"Export Mode" = "byClass"
"Export Style" = "Single file"
  • Log Results- [Bool] - Set true if results need to be exported.

  • Return Results- [Bool] - Set true if running PyDSS in Cosimulation environment, dssInstance.RunStep() function will return current system states.

  • Export Mode- [Str] - Possible options “byClass” and “byElement”
    • “byClass” option allows user to export specified variable for each element of a particular class e.g. per unit voltage for all bus or active power losses for each line

    • “byElement” option allows user to export specific results results for each element seperately.

  • Export Style- [Str] - possible options “Single_file” and “Separate_files”
    • “Single_file” merges results to a single file

    • “Separate_files” alternately exports results to seperate files.

The results to be exported need to defined within the ‘ExportLists.json’ file for each scenario. the defination file should contain three tables

  • ExportMode-byClass (Needed only if exporting results ‘byClass’)

  • ExportMode-byElement (Needed only if exporting results ‘byElement’)

  • Helics-Subcriptions (Needed only if interfacing with HELICS in a co-simulation environment)

A example of export definations for ExportMode-byClass

Class

Publish

Property

Property2

Property3

Property4

Loads

TRUE

Powers

Loads

FALSE

VoltagesMagAng

PVSystems

TRUE

Powers

VoltagesMagAng

Storages

FALSE

Powers

VoltagesMagAng

%stored

Buses

FALSE

puVmagAngle

Distance

Circuits

TRUE

TotalPower

LineLosses

Losses

Lines

FALSE

CurrentsMagAng

normamps

bus1

Transformers

FALSE

CurrentsMagAng

normamps

bus

taps

  • First column of the table needs to be a element type in OpenDSS. The definations here are case sensitive so make sure the name convention for the classes follows case convertion in the OpenDSS help file.

  • The second header in the table should always be ‘Publish’. This booleam propoerty is used to filter variable that should be published when using the HELICS interface.

  • All other columns sould contain variable names that need to be exportred. PyDSS wraps around each OpenDSS elements and provides high hevel functions that can be used to extract any information pertaining to an element.
A example of export definations for ExportMode-byElement

Element

Publish

Property 1

Property 2

Line.pvl_110

TRUE

Powers

PVSystem.pvl_110

TRUE

Powers

kw

  • The first column this case should contain complete name of an element defined in OpenDSS model.
    • Class name should follow convention defined for ‘ExportMode-byClass’ definations.

    • Element name should always be lower case.

  • File format for the rest of the table follows the convention defined in for ‘ExportMode-byClass’ definations.

For setting up sucscription when doing co-simulation via HELICS,

Defining sucscriptions for the HELICS interface

Element

Property

Subscription ID

Unit

Subscribe

Data type

Load.mpx000635970

kw

test.Pv1power

kW

TRUE

double

Load.mpx000635971

kw

test.Pv2power

kW

TRUE

double

Load.mpx000635972

kw

test.Pv3power

kW

TRUE

double

  • The first colun should contain a list of element names defined in the OpenDSS model. Naming converion follows the ExportMode-byElement convertion.

  • The second columns defined the property of teh element tat will be updated. This should always be lower case.

  • The third column should contain subscription ID and the forth column should define units. Helics allows user to define units that ensure pyhsical values are not connected incorrectly e.g a power variable is not connected to a voltage variable. The federate publishing the IDs should also be defing the units. for more information visit https://helics.readthedocs.io/en/latest/introduction/index.html.

  • The subscribe column is used to filter IDs that will be subscribed for a given scenario.

  • The final columns defines the expect data type for a given subscription. Possible values are [double, vector, string, boolean, integer]

Once defined correctly, after a simulation run, results will be exported to the ‘Exports’ folder within the project. PyDSS will also intelligently time stamp the results along with assigning units to the exported results. A sample export output is shown below.

Exported feeder active and reactive power consumption

timestamp

frequency

Simulation mode

Circuit.epriJ1 ph:1 [kW]

Circuit.epriJ1 ph:1 [kvar]

1/1/2017 0:15

60

Yearly

-5.979306015

-0.758373919

1/1/2017 0:30

60

Yearly

-4.222427378

-0.493243983

1/1/2017 0:45

60

Yearly

-5.032113971

-0.623377835

1/1/2017 1:00

60

Yearly

-5.123221764

-0.638967114

1/1/2017 1:15

60

Yearly

-5.012706395

-0.621461249

1/1/2017 1:30

60

Yearly

-5.003457528

-0.624658132

1/1/2017 1:45

60

Yearly

-5.30366444

-0.633309333

1/1/2017 2:00

60

Yearly

-5.479844767

-0.618884725

1/1/2017 2:15

60

Yearly

-5.218094992

-0.628835596

1/1/2017 2:30

60

Yearly

-5.068465011

-0.60757949