> 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/blocks-functions-tools/power-converters/switches/diode.md).

# Diode

## Description

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

The **Diode** block, located in the **OPAL-RT SPS Software/Power Electronics** library, is a semiconductor device that is controlled by its own voltage Vak and current Iak. When a diode is forward biased (Vak > 0), it starts to conduct with a small forward voltage Vf across it. It turns off when the current flow into the device becomes 0. When the diode is reverse biased (Vak < 0), it stays in the off state.

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

The Diode block is simulated by a resistor, an inductor, and a DC voltage source connected in series with a switch. The switch operation is controlled by the voltage Vak and the current Iak.

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

The Diode block also contains a series Rs-Cs snubber circuit that can be connected in parallel with the diode device (between nodes A and K).

## Assumptions and Limitations

* The Diode block implements a macro model of a diode device. It does not take into account either the geometry of the device or the complex physical processes underlying the state change \[1]. The leakage current in the blocking state and the reverse-recovery (negative) current are not considered. In most circuits, the reverse current does not affect converter or other device characteristics.
* Depending on the value of the inductance Lon, the diode is modeled either as a current source (Lon > 0) or as a variable topology circuit (Lon = 0). The Diode block cannot be connected in series with an inductor, a current source, or an open circuit, unless its snubber circuit is in use.
* The inductance Lon is forced to 0 if you choose to discretize your circuit.

## Ports

### Output

m — Measurement vector (Simulink® signal)\
Measurement vector containing two signals. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library.

<table><thead><tr><th width="245">Signal</th><th width="222.5999755859375">Definition</th><th>Units</th></tr></thead><tbody><tr><td>1</td><td>Diode current</td><td>A</td></tr><tr><td>2</td><td>Diode voltage</td><td>V</td></tr></tbody></table>

Dependencies: To enable this port, check the **Show measurement port** parameter.

### Conserving

<table><thead><tr><th width="207.60003662109375">Port</th><th>Description</th></tr></thead><tbody><tr><td>a — Anode<br>Specialized electrical</td><td>Specialized electrical conserving port associated with the anode.</td></tr><tr><td>k — Cathode<br>Specialized electrical</td><td>Specialized electrical conserving port associated with the cathode.</td></tr></tbody></table>

## Parameters

<table><thead><tr><th width="282.7999267578125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>Resistance Ron (Ohms) — Diode internal resistance<br>0.001 (default)</td><td>Diode internal resistance Ron, in ohms (Ω). Default is 0.001. The <strong>Resistance Ron</strong> parameter cannot be set to 0 when the <strong>Inductance Lon</strong> parameter is set to 0.</td></tr><tr><td>Inductance Lon (H) — Diode internal inductance<br>0 (default)</td><td>Diode internal inductance Lon, in henries (H). Default is 0. The <strong>Inductance Lon</strong> parameter cannot be set to 0 when the <strong>Resistance Ron</strong> parameter is set to 0.</td></tr><tr><td>Forward voltage Vf (V) — Diode forward voltage<br>0.8 (default)</td><td>Forward voltage of the diode device, in volts (V). Default is 0.8.</td></tr><tr><td>Initial current Ic (A) — Initial current<br>0 (default)</td><td>Specifies an initial current flowing in the diode device. Default is 0. It is usually set to 0 to start the simulation with the diode device blocked. If the <strong>Initial Current IC</strong> parameter is set to a value greater than 0, the steady-state calculation considers the initial status of the diode as closed. Initializing all states of a power electronic converter is a complex task. Therefore, this option is useful only with simple circuits.</td></tr><tr><td>Snubber resistance Rs (Ohms) — Snubber resistance<br>500 (default)</td><td>Snubber resistance, in ohms (Ω). Default is 500. Set the <strong>Snubber resistance Rs</strong> parameter to inf to eliminate the snubber from the model.</td></tr><tr><td>Snubber capacitance Cs (F) — Snubber capacitance<br>250e-9 (default)</td><td>Snubber capacitance in farads (F). Default is 250e-9. Set the <strong>Snubber capacitance Cs</strong> parameter to 0 to eliminate the snubber, or to inf to get a resistive snubber.</td></tr><tr><td>Show measurement port — Measurement port visibility option<br>on (default) | off</td><td>If selected, adds a Simulink output to the block returning the diode current and voltage. Default is selected.</td></tr></tbody></table>

## Examples

The power\_diode example illustrates a single pulse rectifier consisting of a Diode block, an RL load, and an AC Voltage source block.


---

# 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/blocks-functions-tools/power-converters/switches/diode.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.
