---
url: /dyad/stable/stdlib/ElectricalComponents/components/Analog.Basic.TranslationalEMF.md
description: >-
  Dyad Analog.Basic.TranslationalEMF docs.  Electromotive force
  (electric/translational-mechanic transformer).
---

# `Analog.Basic.TranslationalEMF` {#Analog.Basic.TranslationalEMF}

Electromotive force (electric/translational-mechanic transformer).

Converts electrical energy into translational mechanical energy and vice versa. The induced voltage is proportional to the translational velocity, and the generated force is proportional to the current:

$$v = k \cdot vel$$

$$f = -k \cdot i$$

where `k` is the electrical force constant (N/A), `vel` is the velocity of the `flange` relative to the `support`, and `f` is the force on the `flange`.

The `support` connector is always exposed. To ground the support, connect it to `TranslationalComponents.Components.Fixed()` externally. This replaces the Modelica `useSupport` conditional parameter, which is not yet supported in Dyad.

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

## Usage {#Usage}

`ElectricalComponents.Analog.Basic.TranslationalEMF(k=1)`

## Parameters: {#Parameters:}

| Name |                Description | Units | Default value |
| ----:| --------------------------:| -----:| -------------:|
|  `k` | Transformation coefficient |   N/A |             1 |

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

* `flange` - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. ([`Flange`](/stdlib/Dyad/connectors/Flange#Flange))

* `support` - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. ([`Flange`](/stdlib/Dyad/connectors/Flange#Flange))

## Variables {#Variables}

|          Name |                                   Description | Units |
| -------------:| ---------------------------------------------:| -----:|
|           `v` |             Voltage drop between the two pins |     V |
|           `i` | Current flowing from positive to negative pin |     A |
|           `s` |        Position of flange relative to support |     m |
|         `vel` |        Velocity of flange relative to support |   m/s |
|           `f` |                               Force of flange |     N |
| `fElectrical` |                              Electrical force |     N |

## Behavior {#Behavior}

$$ \begin{align}
v\left( t \right) &=  - \mathtt{n.v}\left( t \right) + \mathtt{p.v}\left( t \right) \\
0 &= \mathtt{n.i}\left( t \right) + \mathtt{p.i}\left( t \right) \\
i\left( t \right) &= \mathtt{p.i}\left( t \right) \\
s\left( t \right) &= \mathtt{flange.s}\left( t \right) - \mathtt{support.s}\left( t \right) \\
\mathtt{vel}\left( t \right) &= \frac{\mathrm{d}s\left( t \right)}{\mathrm{d}t} \\
k ~ \mathtt{vel}\left( t \right) &= v\left( t \right) \\
f\left( t \right) &=  - i\left( t \right) ~ k \\
\mathtt{fElectrical}\left( t \right) &=  - f\left( t \right) \\
f\left( t \right) &= \mathtt{flange.f}\left( t \right) \\
\mathtt{support.f}\left( t \right) &=  - f\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Electromotive force (electric/translational-mechanic transformer).

Converts electrical energy into translational mechanical energy and vice versa.
The induced voltage is proportional to the translational velocity, and the
generated force is proportional to the current:
```math
v = k \cdot vel
```
```math
f = -k \cdot i
```
where `k` is the electrical force constant (N/A), `vel` is the velocity of
the `flange` relative to the `support`, and `f` is the force on the `flange`.

The `support` connector is always exposed. To ground the support, connect it
to `TranslationalComponents.Components.Fixed()` externally. This replaces the Modelica
`useSupport` conditional parameter, which is not yet supported in Dyad.

Corresponds to `Modelica.Electrical.Analog.Basic.TranslationalEMF`.
"""
component TranslationalEMF
  "Positive electrical pin"
  p = Pin() {
    "Dyad": {
      "placement": {"icon": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50}}
    }
  }
  "Negative electrical pin"
  n = Pin() {
    "Dyad": {
      "placement": {"icon": {"iconName": "default", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
    }
  }
  "Translational flange"
  flange = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Support/housing flange"
  support = Flange() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Transformation coefficient"
  parameter k::ElectricalForceConstant = 1
  "Voltage drop between the two pins"
  variable v::Voltage
  "Current flowing from positive to negative pin"
  variable i::Current
  "Position of flange relative to support"
  variable s::Position
  "Velocity of flange relative to support"
  variable vel::Velocity
  "Force of flange"
  variable f::Force
  "Electrical force"
  variable fElectrical::Force
relations
  v = p.v - n.v
  0 = p.i + n.i
  i = p.i
  s = flange.s - support.s
  vel = der(s)
  k * vel = v
  f = -k * i
  fElectrical = -f
  f = flange.f
  support.f = -f
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1200, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/TranslationalEMF.svg"}
  }
}
end
````

````dyad
"""
Electromotive force (electric/translational-mechanic transformer).

Converts electrical energy into translational mechanical energy and vice versa.
The induced voltage is proportional to the translational velocity, and the
generated force is proportional to the current:
```math
v = k \cdot vel
```
```math
f = -k \cdot i
```
where `k` is the electrical force constant (N/A), `vel` is the velocity of
the `flange` relative to the `support`, and `f` is the force on the `flange`.

The `support` connector is always exposed. To ground the support, connect it
to `TranslationalComponents.Components.Fixed()` externally. This replaces the Modelica
`useSupport` conditional parameter, which is not yet supported in Dyad.

Corresponds to `Modelica.Electrical.Analog.Basic.TranslationalEMF`.
"""
component TranslationalEMF
  "Positive electrical pin"
  p = Pin() {
    "Dyad": {
      "placement": {"icon": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50}}
    }
  }
  "Negative electrical pin"
  n = Pin() {
    "Dyad": {
      "placement": {"icon": {"iconName": "default", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
    }
  }
  "Translational flange"
  flange = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Support/housing flange"
  support = Flange() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Transformation coefficient"
  parameter k::ElectricalForceConstant = 1
  "Voltage drop between the two pins"
  variable v::Voltage
  "Current flowing from positive to negative pin"
  variable i::Current
  "Position of flange relative to support"
  variable s::Position
  "Velocity of flange relative to support"
  variable vel::Velocity
  "Force of flange"
  variable f::Force
  "Electrical force"
  variable fElectrical::Force
relations
  v = p.v - n.v
  0 = p.i + n.i
  i = p.i
  s = flange.s - support.s
  vel = der(s)
  k * vel = v
  f = -k * i
  fElectrical = -f
  f = flange.f
  support.f = -f
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1200, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/TranslationalEMF.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`Fixed`](Analog.Basic.TranslationalEMF.md)

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

  * [`Mass`](Analog.Basic.TranslationalEMF.md)

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

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

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

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