> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/automation-api-and-scripting/python-ephasorsim-api/api-reference.md).

# API reference

The `opal.ephasorsim` package provides two classes:

* `Network` manages the ePHASORSIM model and its components.
* `Test` defines and executes time-based test sequences.

## Class Network

list\_models()

Network('model\_name')

component\_list(\[include], \[exclude])

types\_of(tag)

get(comp\_name, param\_name)

get(comp\_name, param\_name, time)

get((comp\_name, param\_name, time), ...)

get\_simulation\_time()

set(comp\_name, param\_name, value)

set(comp\_name, param\_name, time, value)

set((comp\_name, param\_name, time, value), ...)

{% hint style="info" %}
**my\_time** is an absolute time, **time** is relative to now
{% endhint %}

## Class Test

Test('Network\_obj\_name')

set(comp\_name, param\_name, value)

set(comp\_name, param\_name, time, value)

set((comp\_name, param\_name, time, value), ...)

get(comp\_name, param\_name, time)

get((comp\_name, param\_name, time), ...)

execute(\[time = 0])

execute\_at(\[my\_time])

{% hint style="info" %}
**my\_time** is an absolute time, **time** is relative to now
{% endhint %}

## Component types and tags for API

The table below lists all native components, along with their corresponding **Python API type names** and associated **group tags**. These type names and tags can be used as inputs to the `component_list()` routine to include or exclude specific components when generating a list.

<table><thead><tr><th width="280">Native component</th><th width="190">Python type names</th><th>Tags (Group of components)</th></tr></thead><tbody><tr><td><strong>Bus</strong></td><td>bus</td><td>node</td></tr><tr><td><strong>SM_T1</strong></td><td>sm_t1</td><td>machine</td></tr><tr><td><strong>SM_T2</strong></td><td>sm_t2</td><td>machine</td></tr><tr><td><strong>SM_T3</strong></td><td>sm_t3</td><td>machine</td></tr><tr><td><strong>PSS_T1</strong></td><td>pss_t1</td><td>controller, pss</td></tr><tr><td><strong>PSS_T2</strong></td><td>pss_t2</td><td>controller, pss</td></tr><tr><td><strong>EX_T1</strong></td><td>ex_t1</td><td>controller, exciter</td></tr><tr><td><strong>EX_T2</strong></td><td>ex_t2</td><td>controller, exciter</td></tr><tr><td><strong>TG_T1</strong></td><td>tg_t1</td><td>controller, turbine_governor</td></tr><tr><td><strong>TG_T2</strong></td><td>tg_t2</td><td>controller, turbine_governor</td></tr><tr><td><strong>LD_CZ</strong></td><td>ld_cz</td><td>load</td></tr><tr><td><strong>LD_CI</strong></td><td>ld_ci</td><td>load</td></tr><tr><td><strong>LD_CP</strong></td><td>ld_cp</td><td>load</td></tr><tr><td><strong>LN_PI</strong></td><td>ln_pi</td><td>branch, line</td></tr><tr><td><strong>XF_OLTC</strong></td><td>xf_oltc</td><td>branch, transformer</td></tr><tr><td><strong>XF_2W</strong></td><td>xf_2w</td><td>branch, transformer</td></tr><tr><td><strong>XF_3W</strong></td><td>xf_3w</td><td>branch, transformer</td></tr><tr><td><strong>Switch</strong></td><td>sw</td><td>branch, switch</td></tr><tr><td><strong>Fixed Shunt</strong></td><td>sh_fixed</td><td>shunt</td></tr><tr><td><strong>Current Injector</strong></td><td>i_inj</td><td>source</td></tr><tr><td><strong>Multiphase Load (Single Phase)</strong></td><td>ld_zip_1p</td><td>load</td></tr><tr><td><strong>Multiphase Load (Two Phase)</strong></td><td>ld_zip_2p</td><td>load</td></tr><tr><td><strong>Multiphase Load (Three Phase)</strong></td><td>ld_zip_3p</td><td>load</td></tr><tr><td><strong>Multiphase Shunt (Single Phase)</strong></td><td>sh_1p</td><td>shunt</td></tr><tr><td><strong>Multiphase Shunt (Two Phase)</strong></td><td>sh_2p</td><td>shunt</td></tr><tr><td><strong>Multiphase Shunt (Three Phase)</strong></td><td>sh_3p</td><td>shunt</td></tr><tr><td><strong>Transformer 3-phase</strong></td><td>xf_3p</td><td>branch, transformer</td></tr><tr><td><strong>Transformer 3-phase Mutual</strong></td><td>xfm_3p</td><td>branch, transformer</td></tr><tr><td><strong>Multiphase Line (Single Phase)</strong></td><td>ln_pi_1p</td><td>branch, line</td></tr><tr><td><strong>Multiphase Line (Two Phase)</strong></td><td>ln_pi_2p</td><td>branch, line</td></tr><tr><td><strong>Multiphase Line (Three Phase)</strong></td><td>ln_pi_3p_</td><td>branch, line</td></tr><tr><td><strong>Multiphase Fault (Single Phase)</strong></td><td>flt_1p</td><td>fault</td></tr><tr><td><strong>Multiphase Fault (Two Phase)</strong></td><td>flt_2p</td><td>fault</td></tr><tr><td><strong>Multiphase Fault (Three Phase)</strong></td><td>flt_3p</td><td>fault</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/automation-api-and-scripting/python-ephasorsim-api/api-reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
