---
url: /dyad/dev/stdlib/ElectricalComponents/components/Analog.Basic.NonlinearResistor.md
description: >-
  Dyad Analog.Basic.NonlinearResistor docs.  A nonlinear resistor with a
  piecewise-linear current-voltage characteristic, commonly known as Chua's
  Resistor.
---

# `Analog.Basic.NonlinearResistor` {#Analog.Basic.NonlinearResistor}

A nonlinear resistor with a piecewise-linear current-voltage characteristic, commonly known as Chua's Resistor.

This component models a voltage-controlled nonlinear resistor where the current `i` is a function of the voltage `v` across its terminals. The current-voltage relationship is piecewise-linear, defined by three distinct regions: For voltages within the range `[-Ve, Ve]`, the resistor has a conductance `Ga`. For voltages outside this range (`v > Ve` or `v < -Ve`), the resistor exhibits a different conductance `Gb` for the portion of the voltage exceeding `+/-Ve`. The mathematical relationship is:

$$i = \begin{cases}
Gb(v + Ve) - Ga Ve & \text{if } v < -Ve \\
Ga v & \text{if } -Ve \le v \le Ve \\
Gb(v - Ve) + Ga Ve & \text{if } v > Ve
\end{cases}$$

This behavior is characteristic of the nonlinear resistor element in Chua's circuit.

This component extends from [`ElectricalComponents.Analog.Interfaces.OnePort`](../types/Analog.Interfaces.OnePort.md)

## Usage {#Usage}

`ElectricalComponents.Analog.Basic.NonlinearResistor(Ga, Gb, Ve)`

## Parameters: {#Parameters:}

| Name |                                                                      Description | Units | Default value |
| ----:| --------------------------------------------------------------------------------:| -----:| -------------:|
| `Ga` |                            Conductance in the central region (`-Ve <= v <= Ve`). |     S |               |
| `Gb` |                        Conductance in the outer regions (`v < -Ve` or `v > Ve`). |     S |               |
| `Ve` | Breakpoint voltage defining the boundaries of the different conductance regions. |     V |               |

## Connectors {#Connectors}

* `p` - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. ([`Pin`](/stdlib/Dyad/connectors/Pin#Pin))

* `n` - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. ([`Pin`](/stdlib/Dyad/connectors/Pin#Pin))

## Variables {#Variables}

| Name |                                                  Description | Units |
| ----:| ------------------------------------------------------------:| -----:|
|  `v` |      Voltage across the component (between pin p and pin n). |     V |
|  `i` | Current flowing through the component (from pin p to pin n). |     A |

## Behavior {#Behavior}

$$ \begin{align}
v\left( t \right) &=  - \mathtt{n.v}\left( t \right) + \mathtt{p.v}\left( t \right) \\
i\left( t \right) &= \mathtt{p.i}\left( t \right) \\
\mathtt{n.i}\left( t \right) + \mathtt{p.i}\left( t \right) &= 0 \\
i\left( t \right) &= ifelse\left( v\left( t \right) <  - \mathtt{Ve},  - \mathtt{Ga} ~ \mathtt{Ve} + \mathtt{Gb} ~ \left( \mathtt{Ve} + v\left( t \right) \right), ifelse\left( \mathtt{Ve} < v\left( t \right), \mathtt{Ga} ~ \mathtt{Ve} + \mathtt{Gb} ~ \left(  - \mathtt{Ve} + v\left( t \right) \right), \mathtt{Ga} ~ v\left( t \right) \right) \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
A nonlinear resistor with a piecewise-linear current-voltage characteristic, commonly known as Chua's Resistor.

This component models a voltage-controlled nonlinear resistor where the current `i` is a function of the voltage `v` across its terminals.
The current-voltage relationship is piecewise-linear, defined by three distinct regions:
For voltages within the range `[-Ve, Ve]`, the resistor has a conductance `Ga`.
For voltages outside this range (`v > Ve` or `v < -Ve`), the resistor exhibits a different conductance `Gb` for the portion of the voltage exceeding `+/-Ve`.
The mathematical relationship is:

```math
i = \begin{cases}
Gb(v + Ve) - Ga Ve & \text{if } v < -Ve \\
Ga v & \text{if } -Ve \le v \le Ve \\
Gb(v - Ve) + Ga Ve & \text{if } v > Ve
\end{cases}
```

This behavior is characteristic of the nonlinear resistor element in Chua's circuit.
"""
component NonlinearResistor
  extends ElectricalComponents.Analog.Interfaces.OnePort
  "Conductance in the central region (`-Ve <= v <= Ve`)."
  parameter Ga::Conductance
  "Conductance in the outer regions (`v < -Ve` or `v > Ve`)."
  parameter Gb::Conductance
  "Breakpoint voltage defining the boundaries of the different conductance regions."
  parameter Ve::Voltage
relations
  i = ifelse(v < -Ve, Gb * (v + Ve) - Ga * Ve, ifelse(v > Ve, Gb * (v - Ve) + Ga * Ve, Ga * v))
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 850, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/NonlinearResistor.svg"}
  }
}
end
````

````dyad
"""
A nonlinear resistor with a piecewise-linear current-voltage characteristic, commonly known as Chua's Resistor.

This component models a voltage-controlled nonlinear resistor where the current `i` is a function of the voltage `v` across its terminals.
The current-voltage relationship is piecewise-linear, defined by three distinct regions:
For voltages within the range `[-Ve, Ve]`, the resistor has a conductance `Ga`.
For voltages outside this range (`v > Ve` or `v < -Ve`), the resistor exhibits a different conductance `Gb` for the portion of the voltage exceeding `+/-Ve`.
The mathematical relationship is:

```math
i = \begin{cases}
Gb(v + Ve) - Ga Ve & \text{if } v < -Ve \\
Ga v & \text{if } -Ve \le v \le Ve \\
Gb(v - Ve) + Ga Ve & \text{if } v > Ve
\end{cases}
```

This behavior is characteristic of the nonlinear resistor element in Chua's circuit.
"""
component NonlinearResistor
  "Positive electrical pin."
  p = Pin() {
    "Dyad": {
      "placement": {"icon": {"iconName": "pos", "x1": -50, "y1": 450, "x2": 50, "y2": 550}}
    }
  }
  "Negative electrical pin."
  n = Pin() {
    "Dyad": {
      "placement": {"icon": {"iconName": "neg", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }
  "Voltage across the component (between pin p and pin n)."
  variable v::Voltage
  "Current flowing through the component (from pin p to pin n)."
  variable i::Current
  "Conductance in the central region (`-Ve <= v <= Ve`)."
  parameter Ga::Conductance
  "Conductance in the outer regions (`v < -Ve` or `v > Ve`)."
  parameter Gb::Conductance
  "Breakpoint voltage defining the boundaries of the different conductance regions."
  parameter Ve::Voltage
relations
  v = p.v - n.v
  i = p.i
  p.i + n.i = 0
  i = ifelse(v < -Ve, Gb * (v + Ve) - Ga * Ve, ifelse(v > Ve, Gb * (v - Ve) + Ga * Ve, Ga * v))
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 850, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/NonlinearResistor.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
