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 |
Speed |
Angular speed |
Current |
Force |
Torque |
Capacitor |
Body (mass) |
Body (moment of inertia) |
Inductor |
Spring |
Spring |
Resistor |
Damper |
Damper |
Transformer |
Lever |
Gear |
Switch |
Clutch |
Clutch |
Example Model
The example model “Analogies Between the Electrical and Mechanical Domain” shows the analogy of mechanical masses and electrical capacitors and how they behave in simulation.
Find it in PLECS under Help > PLECS Documentation > List of Example Models.
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 in Fig. 86 are equivalent:
Fig. 86 Equivalent connections of three translational bodies
Force/Torque Flows and Sign Conventions
As the table of electrical and mechanical analogies (Tab. 9) 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 in Fig. 87 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.
Fig. 87 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 much and inconsistent data.
The example shown in Fig. 88 models a body with mass \(m\) that is subject to a gravitational force \(m\cdot g\) and suspended from a spring. The spring is initially unstretched (\(\mathrm{d}x_0=0\)) but its equilibrium displacement \(x_0\) is not specified.
Fig. 88 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 \(x_0\) of the position sensor
the initial position \(x_0\) of the body
the equilibrium displacement \(x_0\) 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 \(-\pi\) and \(+\pi\) 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 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 \(J_1\) and \(J_2\) are the moments of inertia of the two bodies, \(\omega_1^-\) and \(\omega_2^-\) are the two angular speeds prior to the collision and \(\omega^+\) 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 \(J_1 = J_2 = J\) so that \(\omega^+ = \frac12(\omega_1^- + \omega_2^-)\), the kinetic energy of the system before and after the collision is for example:
This is demonstrated using the simple example shown in Fig. 89 consisting of two bodies with the same inertia \(J = 1\frac{\mathrm{kg}\cdot\mathrm{m^2}}{\mathrm{rad^2}}\)(see the example model below). One initially rotates with \(\omega_1^- = 1\frac{\mathrm{rad}}{\mathrm{s}}\) while the other is stationary \(\omega_2^- = 0\). There is no friction or external torque acting on the bodies. When the clutch engages at \(t = 1\,\mathrm{s}\), the two bodies immediately rotate with the same speed \(\omega^+ = .5 \frac{\mathrm{rad}}{\mathrm{s}}\) and the total kinetic energy of the system reduces instantaneously from \(.5\,\mathrm{J}\) to \(.25\,\mathrm{J}\).
Example Model
See the example model “Inelastic Collisions”.
Find it in PLECS under Help > PLECS Documentation > List of Example Models.
Fig. 89 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 in Fig. 90; 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.
Fig. 90 Inelastic collision with non-ideal clutch and elastic shafts