Mechanical Modeling
One-dimensional mechanics describe the mechanical interaction between bodies that have exactly one degree of freedom. A translational body (or Mass) can move along a single axis, and a rotational body (or Inertia) can rotate around a single axis. With this limitation one-dimensional mechanical systems can be modeled similarly to electrical systems using simple analogies that are listed in the following table.
Electrical | Translational | Rotational |
Voltage | Velocity | Angular velocity |
Current | Force | Torque |
Capacitor | Body (mass) | Body (moment of inertia) |
Inductor | Spring | Spring |
Resistor | Damper | Damper |
Transformer | Gear | Lever |
Switch | Clutch | Clutch |
Flanges and Connections
The two mechanical subdomains use separate connectors: a translational flange
and a rotational flange
. You can draw connections between flanges of the same
type. By creating branch connections you can connect more than two flanges. Flanges
that are connected to each other have the same displacement (i.e. position or angle),
and the connection will exert whatever force is necessary in order to maintain this
relationship.
Body components (i.e. the translational Mass and the rotational Inertia) have two rigidly connected flanges so that the two systems shown below are equivalent:
Equivalent connections of three translational bodies
Force/Torque Flows and Sign Conventions
As the above table of electrical and mechanical analogies suggests, forces or torques acting on components are modeled as flows from one flange to another. The direction of a positive flow is indicated either with a dot next to a flange or with an arrow in the component icon.
Force and torque flows must be balanced, i.e. the sum of all flows towards a component must generally be zero, but there are two exceptions to this rule:
- Reference components only have a single flange so balancing is not possible for a single instance. Reference components in fact represent connectors of a single, global reference frame, and it is the net flow towards this reference frame that must be zero.
- Body components have an implicit internal connection to the global reference frame. A positive net flow towards a body causes the body to accelerate in the positive direction.
In this context it is important to note that the positive direction does not necessarily correlate with the graphical orientation of the components. For instance, the schematic shown below models the equation
i.e. both forces accelerate the body in the positive direction, even though in the schematic the two forces might appear to oppose each other.
Mass and two forces
Positions and Angles
In contrast to other modeling environments, PLECS does not generally use flange displacements as state variables in the component equations in order to avoid having to solve Index-2 problems. Instead, absolute or relative displacements are only calculated when required e.g. in a hard-stop component or if you explicitly measure them using a sensor. The displacements are then calculated by integrating the corresponding absolute or relative speed.
Initial Conditions
As with all integrators, displacement meters must be provided with proper initial values. PLECS allows you to specify these initial values directly in the components that require them or indirectly via neighboring components. For this purpose, most components have an initial displacement parameter that defaults to an empty string, which means "don't care" or "don't know".
At simulation start, PLECS will automatically calculate required but unknown initial values from the values that you have provided. An error will be flagged if you do not supply enough data to determine required initial values. On the other hand, an error will also be flagged, if you provide too many and inconsistent data.
The example shown below models a body with mass that is subject to
a gravitational force
and suspended from a spring. The spring is
initially unstretched (
) but its equilibrium displacement
is not
specified.
Spring and mass
If the model is run as is, PLECS will flag an error because it does not have enough data to calculate this equilibrium length and the initial value of the position sensor. To fix this, you can specify any one of the following three parameters:
- the initial value
of the position sensor
- the initial position
of the body
- the equilibrium displacement
of the spring
Note that you may specify more than one of the above values, but if you do so, the settings must be consistent.
Angle Wrapping
When calculating angles by integrating angular speed, care must be taken to
avoid numerical problems during longer simulations. For this reason, PLECS
automatically wraps the integral in the interval between and
when
you measure an absolute angle with a position sensor that has one flange
internally connected to the rotational reference frame. Note that relative
angles - measured with a position sensor that has two accessible flanges - are
not wrapped because you can e.g. wind a torsion spring by more than one
turn.
Ideal Clutches
Analogous to its ideal electrical switches, PLECS features ideal mechanical clutches that engage and disengage instantaneously. While engaged they make an ideal rigid connection between their flanges and while disengaged they transmit zero force (or torque).
Inelastic Collisions
PLECS permits you to connect an ideal clutch between two bodies and engage the clutch while they move (or rotate) at different speeds. PLECS models such an event as a perfectly inelastic collision and calculates the common speed after the collision based on the conservation law of angular momentum so that e.g.
where and
are the moments of inertia of the two bodies,
and
are
the two angular speeds prior to the collision and
is the common angular speed
after the collision.
It is important to note that kinetic energy is lost during an inelastic collision even
though the clutch is ideal and lossless. Assuming for simplicity that so
that
, the kinetic energy of the system before and after the
collision is for example
This is demonstrated using the simple example shown below consisting of
two bodies with the same inertia . One initially rotates with
while the other is stationary
. There is no friction or
external torque acting on the bodies. When the clutch engages at
,
the two bodies immediately rotate with the same speed
and
the total kinetic energy of the system reduces instantaneously from
to
.
Inelastic collision with ideal clutch
It is interesting to compare this response with that of a more detailed model, in which the clutch is modeled with a finite damping coefficient when engaged. Additionally the two shafts connecting the bodies with the clutch are assumed to have a certain elasticity and damping coefficient. The corresponding schematic and plots are shown below; for comparison the response from the idealized model is superimposed with dashed lines.
The damping coefficients and spring constants have been exaggerated so that there is visible swinging. Note however, that after the transients have settled, the two bodies rotate at the same common speed as in the idealized model. Likewise, the final mechanical energy stored in the system is the same as in the idealized model.
Inelastic collision with non-ideal clutch and elastic shafts