Skip to content
LIBRARY
Analog.Basic.VariableInductor.md

Analog.Basic.VariableInductor

Ideal linear electrical inductor with variable inductance.

The inductance value L is provided as an external input signal. A lower bound Lmin prevents the effective inductance from reaching zero, which would cause a variable index change:

Ψ=max(L,Lmin)i

The branch voltage follows from the time derivative of flux linkage:

v=dΨdt

This flux-based formulation correctly accounts for time-varying inductance, producing v = L \dot{i} + \dot{L} i.

Corresponds to Modelica.Electrical.Analog.Basic.VariableInductor.

This component extends from ElectricalComponents.Analog.Interfaces.OnePort

Usage

ElectricalComponents.Analog.Basic.VariableInductor(Lmin=1e-16)

Parameters:

NameDescriptionUnitsDefault value
LminLower bound for variable inductanceH1e-16

Connectors

  • p - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • n - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • L - This connector represents a real signal as an input to a component (RealInput)

Variables

NameDescriptionUnits
vVoltage across the component (between pin p and pin n).V
iCurrent flowing through the component (from pin p to pin n).A
PsiMagnetic flux linkageWb

Behavior

v(t)=p.v(t)n.v(t)i(t)=p.i(t)p.i(t)+n.i(t)=0Psi(t)=max(L(t),Lmin) i(t)v(t)=d Psi(t)dt

Source

dyad
"""
Ideal linear electrical inductor with variable inductance.

The inductance value `L` is provided as an external input signal.
A lower bound `Lmin` prevents the effective inductance from reaching
zero, which would cause a variable index change:

math \Psi = \max(L, L_{min}) \cdot i

The branch voltage follows from the time derivative of flux linkage:

math v = \frac{d\Psi}

This flux-based formulation correctly accounts for time-varying
inductance, producing `v = L \dot{i} + \dot{L} i`.

Corresponds to `Modelica.Electrical.Analog.Basic.VariableInductor`.
"""
component VariableInductor
  extends ElectricalComponents.Analog.Interfaces.OnePort
  "Inductance input signal"
  L = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -100, "x2": 550, "y2": 0, "rot": 90}
      },
      "tags": []
    }
  }
  "Lower bound for variable inductance"
  parameter Lmin::Inductance = 1e-16
  "Magnetic flux linkage"
  variable Psi::MagneticFlux
relations
  assert(L >= 0, "Inductance L has to be >= 0!")
  Psi = max(L, Lmin) * i
  v = der(Psi)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/Inductor.svg"}
  }
}
end
Flattened Source
dyad
"""
Ideal linear electrical inductor with variable inductance.

The inductance value `L` is provided as an external input signal.
A lower bound `Lmin` prevents the effective inductance from reaching
zero, which would cause a variable index change:

math \Psi = \max(L, L_{min}) \cdot i

The branch voltage follows from the time derivative of flux linkage:

math v = \frac{d\Psi}

This flux-based formulation correctly accounts for time-varying
inductance, producing `v = L \dot{i} + \dot{L} i`.

Corresponds to `Modelica.Electrical.Analog.Basic.VariableInductor`.
"""
component VariableInductor
  "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 input signal"
  L = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -100, "x2": 550, "y2": 0, "rot": 90}
      },
      "tags": []
    }
  }
  "Lower bound for variable inductance"
  parameter Lmin::Inductance = 1e-16
  "Magnetic flux linkage"
  variable Psi::MagneticFlux
relations
  v = p.v - n.v
  i = p.i
  p.i + n.i = 0
  assert(L >= 0, "Inductance L has to be >= 0!")
  Psi = max(L, Lmin) * i
  v = der(Psi)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/Inductor.svg"}
  }
}
end


Test Cases

No test cases defined.