> 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/basics/passives/variable-resistor.md).

# Variable Resistor

## Description

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

The **Variable Resistor** block, located in the **OPAL-RT SPS Software/Passives** library, represents a linear time-varying resistor. It implements a discrete variable resistor as a current source. The resistance is specified by the Simulink® input signal. The resistance value can be negative.

#### Equations

The block uses the following equations for the relationship between the voltage, *v*, across the device and the current through the inductor, *i*, when the resistance at port **R** is *R*:

$$
v=R\*i
$$

When you use a Variable Resistor block in your model, set the powergui block **Simulation type** to `Discrete` and select the **Automatically handle Discrete solver and Advanced tab solver settings of blocks** parameter in the **Preferences** tab. The robust discrete solver is used to discretize the electrical model. Simulink signals an error if the robust discrete solver is not used.

## Ports

#### Input

<table data-header-hidden><thead><tr><th width="206.99993896484375"></th><th></th></tr></thead><tbody><tr><td><strong>R</strong> — Resistance<br>Simulink signal</td><td>Input port associated with the resistor. The resistance can be negative.</td></tr></tbody></table>

#### Conserving

<table data-header-hidden><thead><tr><th width="200.39996337890625"></th><th></th></tr></thead><tbody><tr><td><strong>+</strong> — Positive terminal<br>SPS electrical</td><td>SPS electrical conserving port associated with the resistor positive voltage.</td></tr><tr><td><strong>-</strong> — Negative terminal<br>SPS electrical</td><td>SPS electrical conserving port associated with the resistor negative voltage.</td></tr></tbody></table>

### Parameters

<table data-header-hidden><thead><tr><th width="211.20001220703125"></th><th></th></tr></thead><tbody><tr><td><strong>Minimal resistance absolute value (Ohms)</strong> — Minimal resistance<br>1e-4 (default) | nonnegative scalar</td><td>Lower limit on the absolute value of the signal at port <strong>R</strong>. This limit prevents the signal from reaching a value that has no physical meaning. The value of this parameter must be greater than 0.</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/smart-power-simulation-software-sps/blocks-functions-tools/basics/passives/variable-resistor.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.
