Skip to content
LIBRARY
Analog.Basic.Potentiometer.md

Analog.Basic.Potentiometer

Adjustable resistor (potentiometer) with three terminals.

The sliding contact is placed between pin_n (r = 0) and pin_p (r = 1), controlled by the input signal r. The total resistance R is split into two sections by the wiper position:

Rp=Ractual(1r),Rn=Ractualr

where r' = \min(1, \max(0, r)) is the clamped wiper position and

Ractual=R(1+α(TheatPortTref))

The voltage drops follow Ohm's law for each section:

vpvc=Rpip,vnvc=Rnin

Kirchhoff's current law at the potentiometer:

ip+in+ic=0

Corresponds to Modelica.Electrical.Analog.Basic.Potentiometer.

Usage

ElectricalComponents.Analog.Basic.Potentiometer(R=1.0, T_ref=293.15, alpha=0.0)

Parameters:

NameDescriptionUnitsDefault value
RTotal resistance at reference temperatureΩ1
T_refReference temperatureK293.15
alphaLinear temperature coefficient of resistance1/K0

Connectors

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

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

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

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

  • heat_port - This connector represents a thermal port with temperature and heat flow as the potential and flow variables, respectively. (HeatPort)

Variables

NameDescriptionUnits
RpResistance from pin_p to contactΩ
RnResistance from contact to pin_nΩ
LossPowerPower dissipated in the potentiometerW

Behavior

pin_p.i(t)+contact.i(t)+pin_n.i(t)=0Rp(t)=R (1+(T_ref+heat_port.T(t)) alpha) (1min(1,max(0,r(t))))Rn(t)=R (1+(T_ref+heat_port.T(t)) alpha) min(1,max(0,r(t)))pin_p.v(t)contact.v(t)=Rp(t) pin_p.i(t)pin_n.v(t)contact.v(t)=pin_n.i(t) Rn(t)LossPower(t)=(pin_n.v(t)contact.v(t)) pin_n.i(t)+pin_p.i(t) (pin_p.v(t)contact.v(t))heat_port.Q_flow(t)=LossPower(t)

Source

dyad
"""
Adjustable resistor (potentiometer) with three terminals.

The sliding contact is placed between `pin_n` (r = 0) and `pin_p`
(r = 1), controlled by the input signal `r`. The total resistance
`R` is split into two sections by the wiper position:

math R_p = R_{actual} \cdot (1 - r'), \quad R_n = R_{actual} \cdot r'

where `r' = \min(1, \max(0, r))` is the clamped wiper position and

math R_{actual} = R \cdot (1 + \alpha \cdot (T_{heatPort} - T_{ref}))

The voltage drops follow Ohm's law for each section:

math v_p - v_c = R_p \cdot i_p, \quad v_n - v_c = R_n \cdot i_n

Kirchhoff's current law at the potentiometer:

math i_p + i_n + i_c = 0


Corresponds to `Modelica.Electrical.Analog.Basic.Potentiometer`.
"""
component Potentiometer
  "Positive pin"
  pin_p = Pin() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Negative pin"
  pin_n = Pin() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Wiper (sliding contact)"
  contact = Pin() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 950, "x2": 1050, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Wiper position input: 0 = at pin_n, 1 = at pin_p"
  r = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 50, "y1": 1000, "x2": -50, "y2": 1100, "rot": 90}
      },
      "tags": []
    }
  }
  "Thermal port for heat exchange"
  heat_port = HeatPort() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "node_a", "x1": 460, "y1": 960, "x2": 560, "y2": 1060, "rot": 0}
      },
      "tags": []
    }
  }
  "Total resistance at reference temperature"
  parameter R::Resistance = 1.0
  "Reference temperature"
  parameter T_ref::Temperature = 293.15
  "Linear temperature coefficient of resistance"
  parameter alpha::LinearTemperatureCoefficient = 0.0
  "Resistance from pin_p to contact"
  variable Rp::Resistance
  "Resistance from contact to pin_n"
  variable Rn::Resistance
  "Power dissipated in the potentiometer"
  variable LossPower::Power
relations
  pin_p.i + pin_n.i + contact.i = 0
  Rp = R * (1 + alpha * (heat_port.T - T_ref)) * (1 - min(1, max(0, r)))
  Rn = R * (1 + alpha * (heat_port.T - T_ref)) * min(1, max(0, r))
  pin_p.v - contact.v = Rp * pin_p.i
  pin_n.v - contact.v = Rn * pin_n.i
  LossPower = (pin_p.v - contact.v) * pin_p.i + (pin_n.v - contact.v) * pin_n.i
  heat_port.Q_flow = -LossPower
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/Potentiometer.svg"}
  }
}
end
Flattened Source
dyad
"""
Adjustable resistor (potentiometer) with three terminals.

The sliding contact is placed between `pin_n` (r = 0) and `pin_p`
(r = 1), controlled by the input signal `r`. The total resistance
`R` is split into two sections by the wiper position:

math R_p = R_{actual} \cdot (1 - r'), \quad R_n = R_{actual} \cdot r'

where `r' = \min(1, \max(0, r))` is the clamped wiper position and

math R_{actual} = R \cdot (1 + \alpha \cdot (T_{heatPort} - T_{ref}))

The voltage drops follow Ohm's law for each section:

math v_p - v_c = R_p \cdot i_p, \quad v_n - v_c = R_n \cdot i_n

Kirchhoff's current law at the potentiometer:

math i_p + i_n + i_c = 0


Corresponds to `Modelica.Electrical.Analog.Basic.Potentiometer`.
"""
component Potentiometer
  "Positive pin"
  pin_p = Pin() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Negative pin"
  pin_n = Pin() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Wiper (sliding contact)"
  contact = Pin() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 950, "x2": 1050, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Wiper position input: 0 = at pin_n, 1 = at pin_p"
  r = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 50, "y1": 1000, "x2": -50, "y2": 1100, "rot": 90}
      },
      "tags": []
    }
  }
  "Thermal port for heat exchange"
  heat_port = HeatPort() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "node_a", "x1": 460, "y1": 960, "x2": 560, "y2": 1060, "rot": 0}
      },
      "tags": []
    }
  }
  "Total resistance at reference temperature"
  parameter R::Resistance = 1.0
  "Reference temperature"
  parameter T_ref::Temperature = 293.15
  "Linear temperature coefficient of resistance"
  parameter alpha::LinearTemperatureCoefficient = 0.0
  "Resistance from pin_p to contact"
  variable Rp::Resistance
  "Resistance from contact to pin_n"
  variable Rn::Resistance
  "Power dissipated in the potentiometer"
  variable LossPower::Power
relations
  pin_p.i + pin_n.i + contact.i = 0
  Rp = R * (1 + alpha * (heat_port.T - T_ref)) * (1 - min(1, max(0, r)))
  Rn = R * (1 + alpha * (heat_port.T - T_ref)) * min(1, max(0, r))
  pin_p.v - contact.v = Rp * pin_p.i
  pin_n.v - contact.v = Rn * pin_n.i
  LossPower = (pin_p.v - contact.v) * pin_p.i + (pin_n.v - contact.v) * pin_n.i
  heat_port.Q_flow = -LossPower
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/Potentiometer.svg"}
  }
}
end


Test Cases

No test cases defined.