---
url: /dyad/stable/stdlib/TranslationalComponents/components/Sensors.PowerSensor.md
description: >-
  Dyad Sensors.PowerSensor docs.  Ideal sensor measuring the translational power
  flowing through a point.
---

# `Sensors.PowerSensor` {#Sensors.PowerSensor}

Ideal sensor measuring the translational power flowing through a point.

This component measures the instantaneous mechanical translational power. It is intended to measure power calculated at `flange_a`. The sensor is ideal: it does not dissipate energy or introduce any mechanical impedance beyond its defining equations. A key characteristic is the constraint $flange_a.s = flange_b.s$, which means both flanges share the same position and, consequently, the same velocity. The sensor thus measures the power flowing through the connection point `flange_a`, while `flange_b` serves to complete the mechanical path with identical motion. The measured power $P$ is defined as:

$$P = F \cdot v$$

math

where $F$ corresponds to the force `flange_a.f` at `flange_a` and $v$ corresponds to the velocity `der(flange_a.s)` of `flange_a`.

This component extends from [`TranslationalComponents.Interfaces.PartialRelativeSensor`](../types/Interfaces.PartialRelativeSensor.md)

## Usage {#Usage}

`TranslationalComponents.Sensors.PowerSensor()`

## Connectors {#Connectors}

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

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

* `power` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

$$ \begin{align}
0 &= \mathtt{flange_a.f}\left( t \right) + \mathtt{flange_b.f}\left( t \right) \\
\mathtt{flange_a.s}\left( t \right) &= \mathtt{flange_b.s}\left( t \right) \\
\mathtt{power}\left( t \right) &= \frac{\mathrm{d}\mathtt{flange_a.s}\left( t \right)}{\mathrm{d}t} ~ \mathtt{flange_a.f}\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Ideal sensor measuring the translational power flowing through a point.

This component measures the instantaneous mechanical translational power.
It is intended to measure power calculated at `flange_a`.
The sensor is ideal: it does not dissipate energy or introduce any mechanical impedance beyond its defining equations.
A key characteristic is the constraint $flange_a.s = flange_b.s$, which means
both flanges share the same position and, consequently, the same velocity.
The sensor thus measures the power flowing through the connection point `flange_a`,
while `flange_b` serves to complete the mechanical path with identical motion.
The measured power $P$ is defined as:

```math
P = F \cdot v
```math

where $F$ corresponds to the force `flange_a.f` at `flange_a` and $v$ corresponds
to the velocity `der(flange_a.s)` of `flange_a`.
"""
component PowerSensor
  extends TranslationalComponents.Interfaces.PartialRelativeSensor
  "Output signal representing the measured power, calculated as power in flange `flange_a`."
  power = RealOutput(units = "W") {
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }
relations
  flange_a.s = flange_b.s
  power = flange_a.f * der(flange_a.s)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/RelativeSensor.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1198, "rot": 0}]
  }
}
end
````

````dyad
"""
Ideal sensor measuring the translational power flowing through a point.

This component measures the instantaneous mechanical translational power.
It is intended to measure power calculated at `flange_a`.
The sensor is ideal: it does not dissipate energy or introduce any mechanical impedance beyond its defining equations.
A key characteristic is the constraint $flange_a.s = flange_b.s$, which means
both flanges share the same position and, consequently, the same velocity.
The sensor thus measures the power flowing through the connection point `flange_a`,
while `flange_b` serves to complete the mechanical path with identical motion.
The measured power $P$ is defined as:

```math
P = F \cdot v
```math

where $F$ corresponds to the force `flange_a.f` at `flange_a` and $v$ corresponds
to the velocity `der(flange_a.s)` of `flange_a`.
"""
component PowerSensor
  "Negative connection flange of the sensor, often considered the reference point."
  flange_a = Flange() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Positive connection flange of the sensor, where the measurement is taken relative to flange_a."
  flange_b = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Output signal representing the measured power, calculated as power in flange `flange_a`."
  power = RealOutput(units = "W") {
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }
relations
  0 = flange_a.f + flange_b.f
  flange_a.s = flange_b.s
  power = flange_a.f * der(flange_a.s)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/RelativeSensor.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1198, "rot": 0}]
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
