forked from modelica/ModelicaStandardLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PowerSensor.mo
33 lines (33 loc) · 1.16 KB
/
PowerSensor.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
within Modelica.Mechanics.Translational.Sensors;
model PowerSensor
"Ideal sensor to measure the power between two flanges"
extends Translational.Interfaces.PartialRelativeSensor;
Modelica.Blocks.Interfaces.RealOutput power(unit="W")
"Power in flange flange_a as output signal" annotation (Placement(
transformation(
origin={-80,-110},
extent={{10,-10},{-10,10}},
rotation=90)));
equation
flange_a.s = flange_b.s;
power = flange_a.f*der(flange_a.s);
annotation (
Documentation(info="<html>
<p>
Measures the <em>power</em> between two flanges
in an ideal way and provides the result as output signal <code>power</code>
(to be further processed with blocks of the
<a href=\"modelica://Modelica.Blocks\">Modelica.Blocks</a> library), i.e.
</p>
<blockquote><pre>
power = flange_a.f * der(flange_a.s)
</pre></blockquote>
</html>"),
Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},
{100,100}}), graphics={ Line(points={{-80,
-100},{-80,0}}, color={0,0,127}),
Text(
extent={{-24,20},{66,-40}},
textColor={64,64,64},
textString="W")}));
end PowerSensor;