This model consists of a drive train with two inertias that are coupled by a bevel gear (with 90 degree angle between the two gear flanges). This drive train is mounted on a body that is rotated along three axes. The drive train is modeled with 1D rotational elements that take into account 3D effects.
The bevelGear component consists of two rotational flanges (for the gear flanges) and one 3D frame (for the support/mounting). Since the bevelGear does not store energy, the power balance must hold (the total sum of inflowing and outflowing energy must be zero). One has to be careful, when computing the energy flow of hybrid 1D/3D component: The angular velocities of rotational flanges are with respect to the support frame (so the moving body on which the drive train is mounted). Therefore, when computing the energy flow, first the absolute angular velocities of the flanges have to be calculated. In this example model, this is performed in the following way (na and nb are the axes of rotations of the gear flanges, and ws is the angular velocity of the support frame):
import Modelica.Mechanics.MultiBody.Frames; import SI=Modelica.SIunits; SI.Power bevelGearPower; SI.AngularVelocity ws[3] = Frames.angularVelocity2(bevelGear.frame_a.R); equation bevelGearPower = (ws + der(bevelGear.flange_a.phi)*na)*bevelGear.flange_a.tau*na + (ws + der(bevelGear.flange_b.phi)*nb)*bevelGear.flange_b.tau*nb + ws*bevelGear.frame_a.t;
The total energy flow bevelGearPower must be zero. If a relative tolerance of 1e-4 is used for simulation, bevelGearPower is in the order of 1e-8 (and smaller for a smaller relative tolerance).