Tags and keywords
The Modelica By Example target code is:
connector Rotational
Modelica.SIunits.Angle phi;
flow Modelica.SIunits.Torque tau;
end Rotational;
Unfortunately, we can't just use AMomFlowElement
and FlowingAMom
from the SysPhS , because FlowingAMom
is based on angular velocity rather than angle, which is not how the Modelica By Example chooses to approach it:
Modelica By Example: 'The following table covers four different engineering domains. In each domain, we see the choice of through and across variables that we will be using along with the SI units for those quantities.'
Domain | Through Variable | Across Variable |
---|---|---|
Electrical | Current [A] | Voltage [V] |
Thermal | Heat [W] | Temperature [K] |
Translational | Force [N] | Position [m] |
Rotational | Torque [N.m] | Angle [rad] |
Modelica By Example: 'The first constraint is that the through variable should be the time derivative of some conserved quantity. The reason for this constraint is that the through variable will be used to formulate generalized conservation equations in our system. As such, it is essential that the through variables be conserved quantities.'
Modelica By Example: 'The second constraint is that the across variable should be the lowest order derivative to appear in any of our constitutive or empirical equations in the domain.'
Therefore for this trail angle-based FlowingAngularMomentum
and AngularMomentumFlowElement
are introduced, from which an equivalent Modelica connector can then be generated via SysPhS as part of a minimal rotational system:
model RotationalContext
RotationalContext _RotationalContext;
model RotationalContext
RotationalA a;
RotationalB b;
equation
connect(a.io,b.io);
end RotationalContext;
model RotationalA
AngularMomentumFlowElement io;
end RotationalA;
model RotationalB
AngularMomentumFlowElement io;
end RotationalB;
connector AngularMomentumFlowElement
flow Torque tau;
Angle phi;
end AngularMomentumFlowElement;
type Torque=Real(unit="N·m");
type Angle=Real(unit="rad");
end RotationalContext;