---
url: /dyad/stable/stdlib/ElectricalComponents/components/Analog.Basic.Inductor.md
description: >-
  Dyad Analog.Basic.Inductor docs.  Ideal inductor characterized by its
  inductance L.
---

# `Analog.Basic.Inductor` {#Analog.Basic.Inductor}

Ideal inductor characterized by its inductance L.

This component models a linear inductor, a fundamental passive two-terminal electrical component. It defines the relationship between voltage `v` and current `i` based on its inductance `L`. The behavior is described by the equation:

$$v = L \frac{di}{dt}$$

math where `v` is the voltage across the inductor (difference between pin `p` and pin `n`), `i` is the current flowing through the inductor (from pin `p` to pin `n`), and `L` is its inductance.

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

## Usage {#Usage}

`ElectricalComponents.Analog.Basic.Inductor(L)`

## Parameters: {#Parameters:}

| Name |                                      Description | Units | Default value |
| ----:| ------------------------------------------------:| -----:| -------------:|
|  `L` | Inductance value of the component in Henries (H) |     H |               |

## 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 \\
\frac{\mathrm{d}i\left( t \right)}{\mathrm{d}t} ~ L &= v\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Ideal inductor characterized by its inductance L.

This component models a linear inductor, a fundamental passive two-terminal electrical component.
It defines the relationship between voltage `v` and current `i` based on its inductance `L`.
The behavior is described by the equation:
```math
v = L \frac{di}{dt}
```math
where `v` is the voltage across the inductor (difference between pin `p` and pin `n`), `i` is the current flowing through the inductor (from pin `p` to pin `n`), and `L` is its inductance.
"""
component Inductor
  extends ElectricalComponents.Analog.Interfaces.OnePort
  "Inductance value of the component in Henries (H)"
  parameter L::Inductance
relations
  L * der(i) = v
metadata {
  "Dyad": {
    "labels": [
      {"label": "$(instance)", "x": 500, "y": 710, "rot": 0},
      {"label": "L=$(L)H", "x": 500, "y": 150, "rot": 0}
    ],
    "icons": {"default": "dyad://ElectricalComponents/Inductor.svg"}
  }
}
end
````

````dyad
"""
Ideal inductor characterized by its inductance L.

This component models a linear inductor, a fundamental passive two-terminal electrical component.
It defines the relationship between voltage `v` and current `i` based on its inductance `L`.
The behavior is described by the equation:
```math
v = L \frac{di}{dt}
```math
where `v` is the voltage across the inductor (difference between pin `p` and pin `n`), `i` is the current flowing through the inductor (from pin `p` to pin `n`), and `L` is its inductance.
"""
component Inductor
  "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
  "Inductance value of the component in Henries (H)"
  parameter L::Inductance
relations
  v = p.v - n.v
  i = p.i
  p.i + n.i = 0
  L * der(i) = v
metadata {
  "Dyad": {
    "labels": [
      {"label": "$(instance)", "x": 500, "y": 710, "rot": 0},
      {"label": "L=$(L)H", "x": 500, "y": 150, "rot": 0}
    ],
    "icons": {"default": "dyad://ElectricalComponents/Inductor.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`SaturatingInductor`](Analog.Basic.Inductor.md)
