Whirligig Example for Modeler2D Output FunctionsRobert Beretta
Whirligig Animation DiscussionWhirligig FunctionThis sample notebook analyzes the motion of a five-body mechanism with no known application, except to demonstrate kinematic mechanism analysis. All of the output functions defined by Modeler2D are utilized in this package.
The whirligig mechanism is driven by rotating the crank (body 2). A connecting rod attaches an eccentric point on the crank to a point at the center of the slider (body 3), which is forced to reciprocate on the track (body 4). The translation of the slider on the inclined track causes the rocker (body 5) to rock back and forth via the second connecting rod that ties the slider to the rocker. The last connecting rod ties the rocker to the the end of the track, which is forced to rotate about its pivotal axis on the ground which accentuates the motion of the rocker. Whirligig BodiesThe whirligig mechanism consists of five bodies. 1. Ground (black) 2. Crank (red) 3. Slider (blue) 4. Track (green) 5. Rocker (magenta)
The ground body serves as the stationary reference frame for the entire model. There are three obvious missing parts in this model--the three connecting rods. These parts are modeled by simple kinematic constraints that prescribe a specified distance between two points on two different bodies, which is the function of a connecting rod. Whirligig CoordinatesThe global coordinate system used in this model is a Cartesian coordinate system attached to the ground body. Each mechanism body has its own local coordinate system attached to it, in which each local point is defined. Kinematic ModelPreparationThis loads the Modeler2D package. Names are defined for each body number for clarity. Body DefinitionsBody objects are defined for each body in the model. These are assigned to the array variables bd[1], bd[2], and so on. GroundThree points need to be defined on the ground (body 1). P1. The rotational axis of the crank. P2. The lower pivot point of the track. P3. The pivot point of the rocker. CrankTwo points are defined on the crank (body 2). P1. The axis of the crank (at the local origin). P2. The attachment point of the first connecting rod. SliderThree points are defined on the slider (body 3). P1 and P2. Two points defining the translation line of the slider. P3. The attachment point of both the first and second connecting rod. TrackTwo points are defined on the track (body 4). P1. The point where the track pivots on the ground (at the local origin of the track). P2. The attachment point of the third connecting rod. These two points also serve to define the translation line of the slider. RockerThree points are defined on the rocker (body 5). P1. The point where the rocker pivots on the ground. P2. The attachment point of the second connecting rod. P3. The attachment point of the third connecting rod. Build bodiesSetBodies incorporates the body objects into the current model. Constraint DefinitionsHere are the constraints required to model the whirligig mechanism. Here is the rotational driving constraint. Here is the revolute joint at the crank axis. Here is the translational joint between the slider and the track. Here is the first connecting rod. Here is the pivot point of the track. Here is the third connecting rod. Here is the pivot point of the rocker. Here is the second connecting rod. This incorporates the constraints into the current model. Initial GuessesSetGuess is used to set initial guesses for the numerical solution block. The variable guesslist is defined so that SetGuess[guesslist] may be called whenever the current guesses need to be reset to their initial values. Running the ModelCheckSystem checks the mathematical model for errors. A return value of True is OK. SolveMech[time] seeks a solution to the mechanism model with a specified value for time, T. GraphicsMechanism Images
AnimationHere is a table of 20 solution sets, spaced over a full revolution of the crank. This table is used for generating an animation of the whirligig and other time domain graphics. The following input will generate the series of 10 graphics in the animation cell at the beginning of this notebook. Output FunctionsLocationHere is a symbolic expression for the global coordinates of the connecting rod pivot on the slider. Here are the actual global coordinates. Here is a plot of the X coordinate of the connecting rod pivot on the slider as a function of time.
DirectionHere is the vector from the pivot point of the track to the center of the slider. UnitHere is the unit vector pointed in the same direction as the result of the previous call to Direction. MagnitudeHere is the absolute distance from the pivot point of the track to the center of the slider. Here is the same unit vector as was returned previously. AngleHere is the direction angle of the first connecting rod. PointToLineDistanceHere is the distance that the rocker axis lies to the left of the line defined by the track. ProjectOnLineHere is the location of the center of the rocker, projected on the track. Here is an X vector on the rocker projected on the track. IntersectionPointHere is the point at which the track and an extension of the first connecting rod intersect. Vector Algebra FunctionsRotationMatrixHere is a rotation matrix representing a counterclockwise rotation of ang radians. RotationMatrix is useful for building up other vector algebra output functions. Here is the definition of the Location function. RMatrix and IMatrixPointToLocalHere are the local coordinates on the track of a point located at the global coordinates {2.0, -1.5}. Here is the same point converted back to global coordinates with Location. XYToPolar and PolarToXYHere are the polar coordinates of the Cartesian point {3, 4}. This converts the polar coordinates back to Cartesian coordinates. Velocity and Acceleration Output FunctionsOnly the most basic velocity and acceleration output functions are defined by Modeler2D. The time derivatives of other functions are produced by differentiation. Velocity and AccelerationHere are the velocity and acceleration vectors of the center of the slider. Here are the absolute velocity and acceleration of the center of the slider. DDistanceDT and D2DistanceDT2The speed at which the slider is moving towards the pivot point of the track is only slightly less than the previously calculated absolute velocity of the slider. Differentiation with Respect to TimeThe dependent variables used by Modeler2D, X2, Y4, 5, and so on, have been automatically defined by SetConstraints such that they may be differentiated with respect to time using the Mathematica Dt function. The DDistanceDT function can be reproduced by differentiating Distance. Any function of time T, or dependent variables that are recognized as being dependent on T, can be differentiated in this way. Here, essentially, is the definition of the Acceleration function. If the application of Dt results in terms of higher than second-order, no symbol is defined to replace those derivatives, so they are returned as derivatives that are explicitly functions of T. End
|