> 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/smart-power-simulation-software-sps/example-models/get-started-with-sps/transient-analysis-of-a-linear-circuit.md).

# Transient Analysis of a Linear Circuit

This example shows steady-state and transient simulation of a linear circuit.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-b0f4274dbac7fa522e25248feff46e691910ddab%2FTransient_analysis_linear_circuit.png?alt=media" alt=""><figcaption></figcaption></figure>

## Description

This circuit is a simplified model of a 230 kV three-phase power system. Only one phase of the transmission system is represented. The equivalent source is modeled by a voltage source (230 kV rms/sqrt(3) or 187.8 kV peak, 60 Hz) in series with its internal impedance (Rs Ls) corresponding to a 3-phase 2000 MVA short circuit level and X/R = 10.

* X = 230e3^2 / 2000e6 = 26.45 Ω → L = 0.0702 H, R = X/10 = 2.645 Ω.
* The source feeds an RL load through a 150 km transmission line.

The line distributed parameters (R = 0.035 Ω/km, L = 0.92 mH/km, C = 12.9 nF/km) are modeled by a single pi section (RL1 branch 5.2 Ω; 138 mH and two shunt capacitances C1 and C2 of 0.967 µF). The load (75 MW - 20 MVAr per phase) is modeled by a parallel RLC load block.

A circuit breaker is used to switch the load at the receiving end of the transmission line. The breaker which is initially closed is opened at t = 2 cycles, then it is reclosed at t = 7 cycles. Current and Voltage Measurement blocks provide signals for visualization purpose.

## Simulation

{% stepper %}
{% step %}

### Simulation using a continuous solver (ode23tb)

Start the simulation and observe line voltage and load current transients during load switching and note that the simulation starts in steady-state. Use the zoom buttons of the oscilloscope to observe the transient voltage at breaker reclosing.
{% endstep %}

{% step %}

### Using the powergui to obtain steady-state phasors and set initial states

Open the powergui block and select "Steady State Voltage and Currents" to measure the steady-state voltage and current phasors. Using the powergui select now "Initial States Setting" to obtain the initial state values (voltage across capacitors and current in inductances).

Now, reset all the initial states to zero by clicking the "to zero" button and then "Apply" to confirm changes. Restart the simulation and observe transients at simulation starting. Using the same powergui window, you can also set selected states to specific values.
{% endstep %}

{% step %}

### Discretizing your circuit and simulating at fixed steps

The powergui block can also be used to discretize your circuit and simulate it at fixed steps. Open the powergui. Select "Discretize electrical model" and specify a sample time of 50e-6 s. The state-space model will now be discretized using trapezoidal fixed step integration. The precision of results is now imposed by the sample time.

Restart the simulation and compare simulation results with the continuous integration method. Vary the sample time of the discrete system and note the impact on precision of fast transients.
{% endstep %}

{% step %}

### Using the phasor simulation method

The "phasor simulation" method consists of replacing the circuit state-space model by a set of algebraic equations evaluated at a fixed frequency and replacing sinusoidal voltage and current sources by phasors (complex numbers). This method allows a fast computation of voltage and current phasors at a selected frequency, disregarding fast transients. It is particularly efficient to study electromechanical transients of generators and motors involving low frequency oscillation modes.

Open the powergui block and select "Phasor simulation". Restart the simulation. Observe that the magnitude of 60 Hz voltage and current is now displayed on the scope. If you double click on the voltage or current measurement block you can choose to output phasor signals in four different formats: Complex, Real/Imag, Magnitude/Angle (in degrees), or just Magnitude (default value). Notice that you cannot send a complex signal to an oscilloscope.
{% endstep %}
{% endstepper %}

### Command

Example model name: power\_transient

{% code lineNumbers="true" %}

```matlab
open('power_transient')
```

{% endcode %}


---

# 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/smart-power-simulation-software-sps/example-models/get-started-with-sps/transient-analysis-of-a-linear-circuit.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.
