Skip to main content

A python package that makes PowerWorld Simauto easier yet more powerful to use

Project description

ESA

A python package that makes PowerWorld Simauto easier yet more powerful to use. There are two major scripts in this collection:

  • Manager.py
  • Workers.py
  • PYSimAuto.py

Environment

python 3.5 or above (recommend the latest Anaconda 3)

Installation

pip install esa

Usage

Before using the package, make sure you have PowerWorld Simulator and SimAuto add-on installed. Use script below to start:

from ssimauto import Manager

from ssimauto import Workers

from ssimauto import PYSimAuto

from ssimauto import PYSimAuto

PYSimAuto is a wrapper for the PowerWorld SimAuto COM object. It is designed to be easy to use, and it includes most of the SimAuto functions and script actions included in the script sections of the Auxiliary Files. Most common methods are listed below.

Function Action Argument
openCase(pwb_file_path) Opens case defined by the full file path pwb_file_path: string (Required). This string includes the directory location and full file name.
saveCase() Saves case with changes to existing file name and path.
saveCaseAs(pwb_file_path) If file name and path are specified, saves case as a new file.Overwrites any existing file with the same name and path. pwb_file_path: string (Optional)
saveCaseAsAux(file_name, FilterName, ObjectType, ToAppend, FieldList) If file name and path are specified, saves case as a new aux file.Overwrites any existing file with the same name and path. file_name=string (Optional). FilterName: string (Optional). ObjectType: string (Optional). ToAppend: boolean (Optional) Default is True. FieldList: variant (Optional) Default is 'all'
closeCase() Closes case without saving changes.
getListOfDevices(ObjType, filterName) Request a list of objects and their key fields ObjType: string (Required), filterName: string (Required)
runScriptCommand(script_command) Input a script command as in an Auxiliary file SCRIPT{} statement or the PowerWorld Script command prompt. script_command: string (Required)
loadAuxFileText(self, auxtext) Creates and loads an Auxiliary file with the text specified in auxtext parameter. auxtext: string (Required)
getFieldList(ObjectType) The GetFieldList function is used to find all fields contained within a given object type. ObjectType: string (Required)
getParametersSingleElement(element_type, field_list, value_list) Retrieves parameter data according to the fields specified in field_list. element_type: string (Required). field_list: variant (Required) A variant array storing strings. value_list: variant (Required) A variant array storing variants.
getParametersMultipleElement(elementtype, fieldlist, filtername) The GetParametersMultipleElement function is used to request the values of specified fields for a set of objects in the load flow case. elementtype: string (Required). fieldlist: string (Required). filtername: string (Optional).
get3PBFaultCurrent(busnum) Calculates the three phase fault; this can be done even with cases which only contain positive sequence impedances busnum: string (Required)
createFilter(condition, objecttype, filtername, filterlogic, filterpre, enabled) Creates a filter in PowerWorld. The attempt is to reduce the clunkiness of creating a filter in the API, which entails creating an aux data file condition, objecttype, filtername: string (Required). filterlogic: string (Optional) Default is 'AND'. filterpre: string (optional) Default is 'NO'. enabled: string (Optional) Default is 'YES'
saveState() SaveState is used to save the current state of the power system.
loadState() LoadState is used to load the system state previously saved with the SaveState function.
changeParameters(ObjType, Paramlist, ValueArray) ChangeParameters is used to change single or multiple parameters of a single object. ObjType: string (Required). Paramlist: variant of array (Required), ValueArray: A variant array storing variants (Required)
sendToExcel(ObjectType, FilterName, FieldList) Send data from the Simulator Automation Server to an Excel spreadsheet. ObjectType: String (Required). FilterName: String (Required). FieldList: Variant This parameter must either be an array of fields for the given object or the string "ALL".
tsCalculateCriticalClearTime(Branch) Use this action to calculate critical clearing time for faults on the lines that meet the specified filter. Branch: string (Required)
tsResultStorageSetAll(objectttype, choice) This command will allow setting which object types are stored in memory during a transient stability run. This will affect all fields and states for the specified objecttype. objectttype: string (Required). choice: string (Required).
tsSolve(ContingencyName) Solves only the specified contingency ContingencyName: string (Required).
tsGetContingencyResults(CtgName, ObjFieldList, StartTime, StopTime) Read transient stability results directly into the SimAuto COM obkect and be further used. This function should ONLY be used after the simulation is run CtgName: string (Required). ObjFieldList: string (Required). StartTime: string (Optional). StopTime: string (Optional)
setData(ObjectType, FieldList, ValueList, Filter) Use this action to set fields for particular objects. ObjectType: string (Required). FieldList: A variant of string (Required). ValueList: A variant of string (Required). Filter: string (Optional)
delete(ObjectType) Use this delete objects of a particular type. A filter may optionally be specified to only delete objects that meet a filter. ObjectType: string (Required)
createData(ObjectType, FieldList, ValueList) Use this action to create particular objects. ObjectType: string (Required). FieldList: A variant of string (Required). ValueList: A variant of string. (Required).
writeAuxFile(FileName, FilterName, ObjectType, FieldList, ToAppend, EString) This function can be used to write data from the case in the Simulator Automation Server to a PowerWorld Auxiliary file. FileName: string (Required). FilterName: string (Required). ObjectType: string (Required). FieldList: A variant of string (Required). ToAppend =True. EString=None
calculateLODF(Branch, LinearMethod, PostClosureLCDF) Use this action to calculate the Line Outage Distribution Factors (or the Line Closure Distribution Factors) for a particular branch. Branch: string (Required). LinearMethod: string (Oprional) Default is 'DC'. PostClosureLCDF: string (Optional) Default is 'YES'.

Developer

If you have any questions, feel free to contact the developers.

Zeyu Mao, PhD student in Texas A&M University, zeyumao2@tamu.edu

Yijing Liu, PhD student in Texas A&M University, yiji21@tamu.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esa-0.1.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

esa-0.1.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file esa-0.1.1.tar.gz.

File metadata

  • Download URL: esa-0.1.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for esa-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2523cb868ad682e1c30b861e178f118167eb5a9d9b28292e794aebedd864532f
MD5 9b2b37797961d7e7165a7dd27abdd6a7
BLAKE2b-256 95469b52c4b45b0562b709e457ca51b9b6ca965b17964e9a0d4aa4b721861f93

See more details on using hashes here.

File details

Details for the file esa-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: esa-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for esa-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99f4afb978cdf4f5905230a2e2cb143f89b02fb1891dc83fdb2be431e703ebb6
MD5 d4ccc200ec5020c4fb648a7de909f003
BLAKE2b-256 160d65e513e337a0146e07528dc921e591fc79978229ddd1a7c68c0de490c20b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page