---
url: /dyad/stable/stdlib/ElectricalComponents/components/Analog.Basic.VariableConductor.md
description: >-
  Dyad Analog.Basic.VariableConductor docs.  Ideal linear electrical conductor
  with variable conductance.
---

# `Analog.Basic.VariableConductor` {#Analog.Basic.VariableConductor}

Ideal linear electrical conductor with variable conductance.

The conductance value `G` is provided as an external input signal. An optional linear temperature coefficient `alpha` adjusts the actual conductance based on the heat port temperature:

$$G\_{actual} = \frac{G}{1 + \alpha \cdot (T\_{heatPort} - T\_{ref})}$$

The electrical behavior follows Ohm's law in conductance form:

$$i = G\_{actual} \cdot v$$

Power dissipated in the conductor is transferred as heat through the thermal port `heat_port`.

Corresponds to `Modelica.Electrical.Analog.Basic.VariableConductor`.

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

## Usage {#Usage}

`ElectricalComponents.Analog.Basic.VariableConductor(T_ref=300.15, alpha=0.0)`

## Parameters: {#Parameters:}

|    Name |                                   Description | Units | Default value |
| -------:| ---------------------------------------------:| -----:| -------------:|
| `T_ref` |                         Reference temperature |     K |        300.15 |
| `alpha` | Linear temperature coefficient of conductance |   1/K |           0.0 |

## 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))

* `G` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

* `heat_port` - This connector represents a thermal port with temperature and heat flow as the potential and flow variables, respectively. ([`HeatPort`](/stdlib/Dyad/connectors/HeatPort#HeatPort))

## 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 |
|  `G_actual` |                Actual conductance accounting for temperature |     S |
| `LossPower` |                            Power dissipated in the conductor |     W |

## 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 \\
\mathtt{G_actual}\left( t \right) &= \frac{G\left( t \right)}{1 + \left(  - \mathtt{T_ref} + \mathtt{heat_port.T}\left( t \right) \right) ~ \mathtt{alpha}} \\
i\left( t \right) &= \mathtt{G_actual}\left( t \right) ~ v\left( t \right) \\
\mathtt{LossPower}\left( t \right) &= i\left( t \right) ~ v\left( t \right) \\
\mathtt{heat_port.Q_flow}\left( t \right) &=  - \mathtt{LossPower}\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Ideal linear electrical conductor with variable conductance.

The conductance value `G` is provided as an external input signal.
An optional linear temperature coefficient `alpha` adjusts the
actual conductance based on the heat port temperature:
```math
G_{actual} = \frac{G}{1 + \alpha \cdot (T_{heatPort} - T_{ref})}
```
The electrical behavior follows Ohm's law in conductance form:
```math
i = G_{actual} \cdot v
```
Power dissipated in the conductor is transferred as heat through
the thermal port `heat_port`.

Corresponds to `Modelica.Electrical.Analog.Basic.VariableConductor`.
"""
component VariableConductor
  extends ElectricalComponents.Analog.Interfaces.OnePort
  "Conductance input signal"
  G = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -100, "x2": 550, "y2": 0, "rot": 90}
      },
      "tags": []
    }
  }
  "Thermal port for heat exchange"
  heat_port = HeatPort() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 460, "y1": 950, "x2": 560, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Reference temperature"
  parameter T_ref::Temperature = 300.15
  "Linear temperature coefficient of conductance"
  parameter alpha::LinearTemperatureCoefficient = 0.0
  "Actual conductance accounting for temperature"
  variable G_actual::Conductance
  "Power dissipated in the conductor"
  variable LossPower::Power
relations
  assert((1 + alpha * (heat_port.T - T_ref)) >= 1e-15, "Temperature outside scope of model!")
  G_actual = G / (1 + alpha * (heat_port.T - T_ref))
  i = G_actual * v
  LossPower = v * i
  heat_port.Q_flow = -LossPower
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 805, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/Conductor.svg"}
  }
}
end
````

````dyad
"""
Ideal linear electrical conductor with variable conductance.

The conductance value `G` is provided as an external input signal.
An optional linear temperature coefficient `alpha` adjusts the
actual conductance based on the heat port temperature:
```math
G_{actual} = \frac{G}{1 + \alpha \cdot (T_{heatPort} - T_{ref})}
```
The electrical behavior follows Ohm's law in conductance form:
```math
i = G_{actual} \cdot v
```
Power dissipated in the conductor is transferred as heat through
the thermal port `heat_port`.

Corresponds to `Modelica.Electrical.Analog.Basic.VariableConductor`.
"""
component VariableConductor
  "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 input signal"
  G = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -100, "x2": 550, "y2": 0, "rot": 90}
      },
      "tags": []
    }
  }
  "Thermal port for heat exchange"
  heat_port = HeatPort() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 460, "y1": 950, "x2": 560, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Reference temperature"
  parameter T_ref::Temperature = 300.15
  "Linear temperature coefficient of conductance"
  parameter alpha::LinearTemperatureCoefficient = 0.0
  "Actual conductance accounting for temperature"
  variable G_actual::Conductance
  "Power dissipated in the conductor"
  variable LossPower::Power
relations
  v = p.v - n.v
  i = p.i
  p.i + n.i = 0
  assert((1 + alpha * (heat_port.T - T_ref)) >= 1e-15, "Temperature outside scope of model!")
  G_actual = G / (1 + alpha * (heat_port.T - T_ref))
  i = G_actual * v
  LossPower = v * i
  heat_port.Q_flow = -LossPower
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 805, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/Conductor.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`FixedTemperature`](Analog.Basic.VariableConductor.md)

  * [`Ground`](Analog.Basic.VariableConductor.md)

  * [`Ramp`](Analog.Basic.VariableConductor.md)

  * [`Resistor`](Analog.Basic.VariableConductor.md)

  * [`Sine`](Analog.Basic.VariableConductor.md)

  * [`VariableConductor`](Analog.Basic.VariableConductor.md)

  * [`VariableConductor`](Analog.Basic.VariableConductor.md)

  * [`VoltageSource`](Analog.Basic.VariableConductor.md)
