KINEMATIC AND DYNAMIC ANALYSIS IN MATHEMATICA
MOTION ANALYSIS OF RIGID BODY SYSTEMS
September 2005 Third edition Intended for use with Mathematica 5 or higher Software and manual written by Robert Beretta Partnerships manager: Joy Costa Developer support specialist: Nirmal Malapaka Project manager: Jennifer Peterson Software quality assurance: Rachelle Bergmann, Jay Hawkins, Cindie Strater Document quality assurance: Rebecca Bigelow, Lorri Coey, Marcia Krause, Angela Latham, Wendy Leung, Carol Ordal, Jan Progen, Joyce Tracewell Document production: Richard Miske Graphic design: Megan Gillette, Jody Jasinski, Kimberly Michael Marketing product manager: Yezabel Dooley Special thanks to Karen Beretta, Joy Costa, Monica Davis, Ed Garner, Joe Grohens, Jay Hawkins, Gary Miller, Leszek Sczaniecki, Kristina Zack Published by Wolfram Research, Inc., 100 Trade Center Drive, Champaign, Illinois 61820-7237, USA phone: +1-217-398-0700; fax: +1-217-398-0747; email:
[email protected]; web: www.wolfram.com © 1994–2005 Dynamic Modeling. All rights reserved. No part of this document may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, elec tronic, mechanical, photocopying, recording, or otherwise, without prior written permission of Dynamic Modeling and Wolfram Research, Inc. Dynamic Modeling is the holder of the copyright to the MechanicalSystems software system described in this document, including, without limitation, such aspects of the system as its code, structure, sequence, organization, “look and feel”, programming language, and compilation of command names. Use of the system unless pursuant to the terms of a license granted by Wolfram Research or as otherwise authorized by law is an infringement of the copyright. Dynamic Modeling and Wolfram Research make no representations, express or implied, with respect to this documentation or the software it describes, including, without limitation, any implied warranties of merchantability, interoperability, or fitness for a particular purpose, all of which are expressly disclaimed. Users should be aware that included in the terms and conditions under which Wolfram Research is willing to license MechanicalSystems is a provision that Wolfram Research and its distribution licensees, distributors, and dealers shall in no event be liable for any indirect, incidental, or consequential damages, and that liability for direct damages shall be limited to the amount of the purchase price paid for MechanicalSystems. In addition to the foregoing, users should recognize that all complex software systems and their documentation contain errors and omissions. Dynamic Modeling and Wolfram Research shall not be responsible under any circumstances for providing information on or corrections to errors and omissions discovered at any time in this document or the software it describes, whether or not they are aware of the errors or omissions. Dynamic Modeling and Wolfram Research do not recommend the use of the software described in this document for applications in which errors or omissions could threaten life, injury, or significant loss. Mathematica is a registered trademark of Wolfram Research, Inc. MechanicalSystems is a trademark of Dynamic Modeling. All other trademarks are the property of their respective owners. Mathematica is not associated with Mathematica Policy Research, Inc. or MathTech, Inc. T5244 318648 0905rcm
Table of Contents Preface.............................................................................................................................................................
1
1 Getting Started..........................................................................................................................................
3
1.1 Starting Mechanical Systems...........................................................................................................
3
1.2 Basic 2D Model.................................................................................................................................
5
1.3 Basic 3D Model.................................................................................................................................
14
2 Kinematic Modeling..................................................................................................................................
25
2.1 Body Objects.....................................................................................................................................
25
2.2 Points, Vectors, and Axes.................................................................................................................
31
2.3 Constraint Objects............................................................................................................................
43
2.4 Building the Model..........................................................................................................................
53
2.5 Running the Model..........................................................................................................................
61
2.6 Variable Management.....................................................................................................................
68
3 Output Functions.......................................................................................................................................
75
3.1 2D Output Functions........................................................................................................................
75
3.2 3D Output Functions........................................................................................................................
88
3.3 Plots and Graphs.............................................................................................................................. 103 3.4 2D Mechanism Images..................................................................................................................... 108 3.5 3D Mechanism Images..................................................................................................................... 124
4 Velocity and Acceleration........................................................................................................................ 145 4.1 Velocity and Acceleration Solutions................................................................................................ 145 4.2 Velocity and Acceleration Output................................................................................................... 164
5 Multistage Mechanisms........................................................................................................................... 183 5.1 Stage Switching Constraints............................................................................................................ 183 5.2 Time Switching Constraints............................................................................................................. 193
6 Cams and Gears......................................................................................................................................... 209 6.1 Cam Constraints............................................................................................................................... 209 6.2 Gear Constraints............................................................................................................................... 241
7 Loads and Reactions................................................................................................................................. 261 7.1 Load Objects..................................................................................................................................... 261 7.2 Static Solutions................................................................................................................................. 267 7.3 Resultant Forces............................................................................................................................... 274 7.4 Multistage Loads.............................................................................................................................. 281
8 Inverse Dynamics....................................................................................................................................... 289 8.1 Inertia Properties.............................................................................................................................. 289 8.2 Kinematic and Dynamic Solutions................................................................................................... 300 8.3 Friction and Damping...................................................................................................................... 306
9 Parametric Design..................................................................................................................................... 325 9.1 Coupled Models............................................................................................................................... 325 9.2 Multiple Configuration Couples...................................................................................................... 334 9.3 Velocity and Acceleration Couples.................................................................................................. 339 9.4 Load-Dependent Couples................................................................................................................ 342 9.5 Sensitivity.......................................................................................................................................... 347
10 Underconstrained Systems................................................................................................................... 353 10.1 Equilibrium Configuration............................................................................................................. 353 10.2 Equilibrium Velocity....................................................................................................................... 361 10.3 Free Acceleration........................................................................................................................... 365 10.4 Dynamic Motion Synthesis............................................................................................................. 375 10.5 Nonholonomic Systems.................................................................................................................. 393
11 Generalized Coordinates....................................................................................................................... 397 11.1 Generalized Coordinate Constraints............................................................................................. 398 11.2 Loads and Reactions....................................................................................................................... 417 11.3 Dynamic Modeling......................................................................................................................... 425
12 Performance Improvement................................................................................................................... 435 12.1 Updating Solutions........................................................................................................................ 435 12.2 Simplifying Expressions.................................................................................................................. 438 12.3 Compiling Expressions................................................................................................................... 440 12.4 Coordinate Systems........................................................................................................................ 441 12.5 Locking Variables........................................................................................................................... 445
13 Debugging Models................................................................................................................................. 449 13.1 Model Building Errors.................................................................................................................... 449 13.2 Failure to Converge....................................................................................................................... 455 13.3 Mathematical Anomalies............................................................................................................... 460 13.4 Equations of Motion...................................................................................................................... 462
Appendix: Reference Guide A. Modified Mathematica Built-in Symbols.......................................................................................... 465 B. MechanicalSystems Function Listing................................................................................................. 467
Preface MechanicalSystems is a set of Mathematica packages designed to assist in the analysis and design of planar and spatial rigid body mechanisms. The package is written entirely in the Mathematica programming language and is completely portable and platform independent. The source code is written in the preferred package format as generally used by Wolfram Research, Inc. for the standard packages that are included with Mathematica. MechanicalSystems is intended to run under Mathematica 5.0 or later.
1. Getting Started Overview This chapter is intended to familiarize the user with MechanicalSystems and to provide an overview of its basic functionality. MechanicalSystems actually consists of two basic Mathematica packages; one for planar mechanisms, Modeler2D, and one for spatial mechanisms, Modeler3D. Throughout this manual, the planar and spatial components of MechanicalSystems are often referred to by their package names, Modeler2D and Modeler3D, and the entire MechanicalSystems package is simply referred to as Mech. Section 1.1 describes the steps necessary to load MechanicalSystems into a Mathematica session on various computer systems. In Sections 1.2 and 1.3 two very basic kinematic models (one planar and one spatial) are developed to demonstrate the general functionality of Mech. Both models are of a slider-crank mechanism, such as a small internal combustion engine, and they are presented with minimal explanation. The two models are essentially identical to show the parallelism between Modeler2D and Modeler3D. Further exploration of the functions introduced in this chapter and all of the other functions provided for kinematic modeling can be found in Chapter 2.
1.1 Starting MechanicalSystems This section covers the loading of MechanicalSystems packages into a Mathematica session on various computer systems.
1.1.1 Main Package The MechanicalSystems packages are loaded into Mathematica in the same manner as a standard Mathematica package; with a Get or Needs statement.
MechanicalSystems
4
Get["MechanicalSystems`Modeler2D`"]
load the Modeler2D package.
Normalized option may be given to cause EulerParameters to assume that vector is a unit vector, thus simplifying the result. The default setting is Assumptions->None. † In Modeler3D, EulerParameters[vector] returns the four Euler parameters associated with the given virtual rotation vector. † When EulerParameters is used to transform a virtual rotation or an angle-axis, vector may be a simple vector or a Mech vector object with head Vector, Line, or Plane. † See also: Rotation, RotationMatrix, VirtualRotation.
Extrude 3D † Extrude[{point1, point2, … , pointn}, vector, dist] extrudes the sequence of n – 1 lines between the given points dist units in the direction of vector. † Extrude[bnum, {lpnt1, … , lpntn}, vector, dist] extrudes the n – 1 lines connecting the local points lpnti located on body bnum. † Extrude returns a list of Mathematica graphics primitives that are functions of mechanism location variables.
MechanicalSystems
500
† The following options can be givens: Faces
True
whether to draw with filled polygons or wire frames
Magnitude
Absolute
whether dist is multiplied by the length of vector
† Magnitude->Relative causes the extrusion distance to be equal to the length of vector times dist. † See also: Facet, Revolve.
Faces 2D/3D † Faces is an option for Bar, Box, Extrude, Revolve, Sphere, Torus, and Wheel to specify whether faces of polygons should be filled or rendered as wire frames. † Faces->False causes graphics objects to be rendered as wire frames. † The default setting is Faces->True. † See also: Angle.
Facet 2D/3D † Facet[bnum, {lpnt1, lpnt2, … , lpntn}] generates a filled polygon with vertices at each of the lpnti on body bnum. Each lpnti can be either a local point number or local point coordinate {x, y} (2D) or {x, y, z} (3D). † Facet[bnum, {lpnts1, … }, {lpnts2, … }, … ] generates several polygons. † Facet[{point1, … , pointn}] generates an n-sided polygon with vertices on several different bodies. † Facet returns a list of Mathematica graphics primitives that are functions of mechanism location variables. † The Facet function is analogous to the built-in Mathematica Polygon primitive. † See also: Bar, Box, Edge, Extrude, Vertex, Wheel.
Appendix B: MechanicalSystems Function Listing
501
FindSwitchTime 2D/3D † FindSwitchTime[cnum, snum, options] seeks the point in time at which the two constraints in TimeSwitch number cnum separated by switch time number snum are both satisfied. † The switch time number snum specifies which stage of the TimeSwitch is under consideration. For example, a TimeSwitch constraint with three constraints has two switch times, numbers 1 and 2, between the three constraints. † The following options can be givens: DampingFactor
1
damping factor applied at each iteration step
MaxIterations
15
the maximum number of iterations allowed
RequiredEquations
{All, Sum}
which equations to consider in a multi-equation constraint
TangentConstraint
False
whether to seek a solution where two constraints approach each other tangentially
ZeroTest
{Abs[#]DyÖ namic must be given because FindTime would choose to use Static by default. † See also: FindSwitchTime, SetCouple, SolveCouple.
FitDegree 2D/3D † FitDegree is an option for SolveFree and SolvePath that specifies the degree of polynomial that is used to approximate each section of the integrand at each time step. † Valid settings for FitDegree are Linear, Quadratic, Cubic, and Quartic. † The default setting is FitDegree->Cubic. † See also: Method.
Force 2D/3D † Force[bnum, axis, mag] returns a SysLoad data object that applies a force to body bnum of magnitude mag along the specified axis.
Appendix B: MechanicalSystems Function Listing
503
† Force[bnum1, bnum2, … ] applies the force to body bnum1 and also applies a force in the opposite direction to body bnum2. † After creation, the SysLoad object is passed to SetLoads to alter the state of the current Mech model. † The following options can be given: CutOff
0
allow the length of axis to approach zero without a singularity
Magnitude
Absolute
whether dist is multiplied by the length of vector
† Magnitude->Relative causes the magnitude of the applied force to be equal to the specified mag times the length of axis. † See also: Body, Gravity, Load, Moment.
Free 2D/3D † Free is a setting for the Time option for SetCouple that is used to omit the time specification so that time becomes a dependent variable to be solved for. † The alternative to Free is to specify a numerical value for time, † The Free setting can be used only in SetCouple when the system is built, not in SolveCouple. † See also: FindTime.
FreeSystem 2D/3D † FreeSystem is the head of the data object returned by SetFree. † The output format of the FreeSystem data object is FreeSystem[solution, ], where solution is the setting for the Solution option in SetFree. † The second element of a FreeSystem object is True for nonlinear systems, and False for linear ones.
MechanicalSystems
504
† FreeSystem is not intended to be used external to Mech. † See also: SolveFree.
FunctionOfTime 2D/3D † FunctionOfTime is an option for SolveMech and other Mech functions that causes returned InterpolatingFunction objects to be explicitly functions of the current time variable. † If FunctionOfTime->True is given, a list of the form {var->InterpolatingFunction[][T], … } is returned. † If FunctionOfTime->False is given, the resulting rules will give functions that must each be given a numerical argument before it evaluates to a number. † The default setting is FunctionOfTime->True. † See also: SolveFree, SolvePath, TimeInterpolate.
GenConstraint 2D/3D † GenConstraint[cnum, point1, point2, rot, {sym, guess}] returns a constraint object that introduces a slave body represented by generalized coordinates into the model. A point on the slave body, point1, is constrained to be coincident with a point on the master, point2. The angular orientation of the slave with respect to the master is specified by rot. † In Modeler2D, rot is a counterclockwise angle or a list of two degenerate Euler parameters {ei, ej}. † In Modeler3D, rot is specified by an angle and an axis of rotation in the {ang, axis} format. † {sym, guess} or {sym1, guess1}, {sym2, guess2}, … are generalized coordinate symbols and their associated initial guesses that are added to the model. The number of degrees of freedom added to the model is equal to the number of sym-guess pairs. † GenConstraint is used to create user-defined generalized coordinate relationships. Mech generalized coordinate constraints do not actually constrain any degrees of freedom or add any algebraic constraints to the model, they simply set up the necessary coordinate transformations so that a new slave body can be recognized appropriately by Mech’s modeling engine.
Appendix B: MechanicalSystems Function Listing
505
† In Modeler2D, the rotation may also be specified by a list of degenerate Euler parameters {ei, ej}. † In Modeler3D, rot can be a single rotation or a sequence of rotations of the form used by RotationLock3. † In Modeler3D, each successive rotation may also be specified by a list of Euler parameters {eo, ei, ej, ek} or a virtual rotation vector {vx, vy, vz}. † See also: Constraint.
GenCylindrical4 3D † GenCylindrical4[cnum, axis1, axis2, {alpha, guess}, {beta, guess}] returns a constraint object that introduces a slave body into the model represented by two generalized coordinates alpha and beta. † The axis1 body is a slave to the axis2 body with one degree of rotational freedom and one degree of translational freedom. The two axes are constrained to be colinear and the distance from the origin of axis2 to that of axis1, in the direction of axis2, is represented by alpha. The angle from the projection of the reference direction of axis2 to that of axis1, in the right-hand sense, is represented by beta. † Note that GenCylindrical4 actually adds two degrees of freedom to the model, as opposed to constraining four. † See also: Cylindrical4, SetConstraints, SysCon.
Generalized 2D/3D † Generalized[cnum] returns the list of generalized forces, or Lagrange multipliers (Λ1, Λ2, … ) associated with constraint cnum in the current model. † The cnum argument can take any of the forms accepted by Constraints to obtain velocity terms from multiple constraints. † Generalized is also an element of the MakeRules option setting. † MakeRules->{… , Generalized, … } causes the generalized forces to be included in the interpolated rules returned.
MechanicalSystems
506
† Generalized[All] returns the entire vector of Lagrange multipliers. † The generalized force vector contains one Lagrange multiplier, Λn, for each constraint equation in the current system. † Transpose[Jacobian[cnum, All]].Generalized[cnum] == Loads[All] returns the entire static force balance equation associated with constraint cnum. † The value of the Lagrange multipliers cannot be directly interpreted as a force or moment without some understanding of the explicit form of the mechanism equations. Use the Reaction function to convert generalized loads into the reaction forces at each constraint. † See also: Centrifugal.
GenOrthoRevolute4 3D † GenOrthoRevolute4[cnum, axis1, axis2, {alpha, guess}, {beta, guess}] returns a constraint object that introduces a slave body into the model represented by two generalized coordinates alpha and beta. † The axis1 body is a slave to the axis2 body with two degrees of rotational freedom. The origins of the two axes are constrained to be coincident, and the axes are constrained to be orthogonal. The symbol alpha represents the angle between axis1 and the reference direction of axis2, and beta represents the angle between axis2 and the reference direction of axis1. † Note that GenOrthoRevolute4 actually adds two degrees of freedom to the model, as opposed to constraining four. † See also: OrthoRevolute4, SetConstraints, SysCon.
GenRevolute2 2D † GenRevolute2[cnum, axis1, axis2, {sym, guess}] returns a constraint object that introduces a slave body into the model represented by a single generalized coordinate sym. † The axis1 body is a slave to the axis2 body with one degree of rotational freedom. The origins of the two axes are constrained to be coincident, and the counterclockwise angle from axis2 to axis1 is represented by sym.
Appendix B: MechanicalSystems Function Listing
† Note that GenRevolute2 actually adds one degree of freedom to the model, as opposed to constraining two degrees of freedom like Revolute2. † See also: Revolute2, SetConstraints, SysCon.
GenRevolute5 3D † GenRevolute5[cnum, axis1, axis2, {sym, guess}] returns a constraint object that introduces a slave body into the model represented by a single generalized coordinate sym. † The axis1 body is a slave to the axis2 body with one degree of rotational freedom. The two axes are constrained to be parallel and their origins are constrained to be coincident. The angle from the projection of the reference direction of axis2 to that of axis1, in the right-hand sense, is represented by sym. † Note that GenRevolute5 actually adds one degree of freedom to the model, as opposed to constraining five degrees of freedom like Revolute5. † See also: Revolute5, SetConstraints, SysCon.
GenTranslate2 2D † GenTranslate2[cnum, axis1, axis2, {sym, guess}] returns a constraint object that introduces a slave body into the model represented by a single generalized coordinate sym. † The axis1 body is a slave to the axis2 body with one degree of translational freedom. The two axes are constrained to be colinear, and the distance from the origin of axis2 to that of axis1, in the direction of axis2, is represented by sym. † Note that GenTranslate2 actually adds one degree of freedom to the model, as opposed to constraining two degrees of freedom like Translate2. † See also: SetConstraints, SysCon, Translate2.
507
MechanicalSystems
508
GenTranslate5 3D † GenTranslate5[cnum, axis1, axis2, {sym, guess}] returns a constraint object that introduces a slave body into the model represented by a single generalized coordinate sym. † The axis1 body is a slave to the axis2 body with one degree of translational freedom. The two axes are constrained to be colinear, and the distance from the origin of axis2 to that of axis1, in the direction of axis2, is represented by sym. The projections of the reference directions of the two axes are constrained to be parallel. † Note that GenTranslate5 actually adds one degree of freedom to the model, as opposed to constraining five degrees of freedom like Translate5. † See also: SetConstraints, SysCon, Translate5.
Global 2D/3D † Global is a setting for the Coordinates option that causes results to be returned in the global coordinate system. † The alternative to the Global setting is Local. † See also: Reaction, SetSymbols.
Gravity 2D/3D † Gravity[vector, G] returns a list of SysLoad data objects that apply a force of magnitude mass × G in the direction of vector to the centroid of each body in the current model. † Gravity[vector, G, {bnum1, bnum2, … }] applies the gravitational force only to the bodies specified by their body numbers. † The value of mass is taken from the current inertia properties of each body, as specified with the Mass option to Body.
Appendix B: MechanicalSystems Function Listing
509
† Gravity accepts the Magnitude option to determine whether the magnitude of the gravitational force is equal to G, or equal to the magnitude of vector times G. The default setting is Magnitude->Absolute. † After creation, the SysLoad object is passed to SetLoads to alter the state of the current Mech model. † When Gravity is called without an explicit body number specification, a list load objects is returned corresponding to each body in the current model. If new bodies are added to the model, Gravity must be rerun to reflect the changes. † See also: Force, Load, Relative.
GyroFilter 3D † GyroFilter[{Ixx, Iyy, Izz, Ixy, Iyz, Izx}, {x, y, z}] returns a new set of inertia properties that have zero inertia in the direction of {x, y, z}. † The vector {x, y, z} must be a principal axis of the inertia properties, and the two principal moments not associated with {x, y, z} must be equal. † Inertia[GyroFilter[inertia, vector]] . vector always returns the zero vector, which shows that a body represented by the new inertia properties has no angular momentum if rotating about vector. † GyroFilter is normally used to filter out components of the inertia tensor that are modeled as zero-torque spinning motion with GyroMoment. † It is never necessary to use GyroFilter if the gyro body is attached to the rest of the model by a zero-torque constraint, like a revolute or cylindrical joint. † Use Inertia->GyroFilter[inertia, vector] as an option for Body to eliminate the axial torques related to angular acceleration of the body, and then use the unfiltered inertia properties with GyroMoment to model the gyroscopic torques. † The inertia properties may also be given as a full inertia matrix. † See also: ParallelAxis, PrincipalAxes.
MechanicalSystems
510
GyroMoment 3D † GyroMoment[bnum, vec, omega] returns a SysLoad data object that applies a moment to body bnum to simulate the gyroscopic effects of the axially symmetric body spinning with angular speed omega, about an axis originating from the centroid of the body, parallel to vec. The constant angular velocity omega is relative to the local reference frame of bnum. † After creation, the SysLoad object is passed to SetLoads to alter the state of the current Mech model. † GyroMoment accepts the Inertia option to specify the inertia properties of the spinning body. † If Inertia is unspecified, the inertia properties are taken from body bnum. † GyroMoment produces meaningful results only if the vector vec is parallel to a principal moment of inertia of the body, and if the other two principal moments are equal in magnitude. This implies that the body must be axially symmetric about the vector vec. † GyroMoment essentially models body bnum as if it were spinning at a constant velocity relative to its own local coordinates system. † To model zero-torque motion, instead of constant velocity, use GyroFilter to remove the components of the inertia tensor that are aligned with vec from the body’s inertia tensor. † See also: Body, Load, Moment.
HeadSize 2D/3D † HeadSize is an option for Arrow that specifies the width of the arrowhead. † The default setting HeadSize->Automatic makes the head of the arrow 1/5 of its length. † See also: Magnitude.
Appendix B: MechanicalSystems Function Listing
511
HelpModel2D 2D † HelpModel2D is a package containing the model that is used throughout the MechanicalSystems help to demonstrate various functionality. † Automatic takes the initial conditions from the current default initial guess from LastSolve. † Any variables omitted from the InitialCondition setting are given values taken from the current initial guess or parameters lists. † The setting for the InitialCondition option takes a special form for SolveCouple. † See also: InitialGuess, SetFree, SetPath, SetSensitivity, SolveCouple, SolveFree.
InitialGuess 2D/3D † InitialGuess is an option for Body that specifies the initial guesses for a body’s location coordinates in the form InitialGuess->{{x, y}, q} (2D) or InitialGuess->{{x, y, z}, {eo, ei, ej, ek}} (3D). † InitialGuess[bnum] returns the current initial guesses of body bnum in the formats noted above. † InitialGuess is also an option for SetCouple that specifies initial guess for all coordinates as a list of rules. Rules are given in the same format as rules for SetGuess. † InitialGuess is also an option for SetFree that specifies initial guesses for the dependent variables in the system as a list of rules. Lower-order terms (independent variables) are given with InitialCondition. Rules are given in the same format as rules for SetGuess. † If no initial guess is specified for a body, the initial guess is in alignment with the global coordinate system. † The default setting InitialGuess->Automatic leaves the current guesses unchanged. † In Modeler2D, initial guesses may also be specified in the format {{x, y}, {ei, ej}} where the degenerate Euler parameters ei and ej are immediately converted to Q.
Appendix B: MechanicalSystems Function Listing
515
† In Modeler3D, initial guesses may also be specified in the format {{x, y, z}, {vx, vy, vz}} where the second element is a virtual rotation vector, or the format {{x, y, z}, {q, {x, y, z}}} where the second element is an angle and axis of rotation. The given rotation is immediately converted to a set of Euler parameters. † See also: Centroid, Inertia, PointList, Mass, SetBodies.
InstantCenter 2D/3D † InstantCenter[bnum] returns the coordinates of the instant center of zero velocity of body bnum. † InstantCenter accepts the Coordinates option to determine whether to return the result in Global or body Local coordinates. † In Modeler3D, InstantCenter returns a point on the instant axis of rotation. † The default option setting is Coordinates->Global. † In general, a spatial body will not have an instant center of zero velocity, but it will have an instant axis of rotation. The direction vector of the instant axis of rotation is equal to the angular velocity vector of the body, Omega[bnum]. All points on this axis will have identical velocity vectors. † See also: Omega, RelativeVelocity, Velocity.
Interference 2D † Interference is an option for Involute. † Interference->True specifies that the involute locus will blend into a straight line from the point where the involute meets the base circle to the center of the base circle. † The default setting is Interference->False. † If Interference is set to False, the natural equation of an involute tooth profile goes through a first-order singularity at the point where the tooth profile meets the base circle (when the value of the controlling parameter is zero) and then forms a mirror image of the tooth for negative values of the controlling parameter. † See also: Constraint.
MechanicalSystems
516
IntersectionPoint 2D/3D † IntersectionPoint[axis1, axis2] returns the point of intersection of axis1 and axis2 in global 2D space, or the point of intersection of axis1 and a plane that is normal to axis2 in global 3D space. In 3D, axis2 is typically a Plane object. † In Modeler2D, IntersectionPoint[axis1, axis2, offset] returns a point that is located offset units to the left of both axes (such as the center point of a fillet between the two axes). † See also: Location.
Involute 2D † Involute[sym, {x, y}, baseradius, pitchradius, angle] returns the equation of an involute gear tooth as a function of the parameter sym. The involute has a base circle of baseradius centered at {x, y}. † The involute profile is rotationally located such that the point where the profile intersects the pitch circle lies on a ray that passes through {x, y} in the direction of the specified angle. † If pitchradius is negative then the profile spirals in the clockwise direction, otherwise it spirals in the counterclockwise direction. † The involute locus travels from the base circle to the pitch circle, as sym goes from 0 to "########################################################## pitchradius2 - baseradius2 í baseradius. † Involute accepts the Interference option. † With the Interference option the locus travels from the base circle to the center of the gear as sym goes from 0 to –1. † See also: CamToCam1.
Appendix B: MechanicalSystems Function Listing
Jacobian 2D/3D † Jacobian[cnum, bnum] returns the submatrix of the current Jacobian associated with constraint cnum and body bnum. † The cnum argument can take any of the forms accepted by Constraints to obtain Jacobian terms from multiple constraints. † The bnum argument can take any of the forms accepted by Loads to obtain Jacobian terms from multiple bodies. † Jacobian[All, All] returns the entire Jacobian matrix. † See also: Constraint.
JoinRows 2D/3D † JoinRows[mat1, mat2, … ] returns a new matrix composed of the mati with their rows joined. The mati must all have the same number of rows. † JoinRows effectively joins matrices left-to-right, instead of top-to-bottom. † See also: Join, MapThread.
KillMech 2D/3D † KillMech[] completely removes the Mech packages from the current Mathematica session. All the symbols in the MechanicalSystems`Modeler2D` or MechanicalSystems`Modeler3D` contexts are removed, as well as the contexts themselves. † Using KillMech allows Mech to be reloaded with Get or Needs without error. † See also: ClearMech.
517
MechanicalSystems
518
Kinematic 2D/3D † Kinematic is a setting for the Solution option for several Mech functions. † Solution->Kinematic causes such functions to seek a solution for the location, velocity, and velocity-dependent loading of the current model. † The alternatives to the Kinematic setting are Location, Velocity, Acceleration, Static, and Dynamic. † The Kinematic setting should be used when a model contains applied loads that are functions of mechanism velocity. If the Static setting is used in such cases, all velocities are set to zero. † See also: SolveMech, SetFree.
LambdaGuess 2D/3D † LambdaGuess is an option for SetLoads that specifies the initial guesses for the Lagrange multipliers. † LambdaGuess->number specifies the same guess for all Lagrange multipliers. † LambdaGuess->{rules} sets the values of specific Lagrange multipliers given in rules. † LambdaGuess->{numbers} sets the values of all Lagrange multipliers. The list of numbers must be of the same length as Generalized[All]. † Unspecified guesses for the Lagrange multipliers are initially set to one. † LambdaGuess->Automatic leaves the current values of the guesses unchanged. † The default setting is LambdaGuess->Automatic. † See also: InitialGuess, SetGuess.
Appendix B: MechanicalSystems Function Listing
519
LastSolve 2D/3D † LastSolve[] returns the last solution rule returned by SolveMech. The values returned by LastSolve[] are used as the initial guesses at the next invocation of SolveMech. † LastSolve[All] includes the values that will be used the next time that initial guesses for the Lagrange multipliers are needed, regardless of whether or not they were part of the last solution returned by SolveMech. † See also: SetGuess.
LeadScrew5 3D † LeadScrew5[cnum, axis1, {alpha, guess}, axis2, pitch, C] models a lead screw. axis1 is constrained to be parallel and coincident with axis2, and the axial translation of the two axes is controlled per the pitch and relative rotation of the two parts of the screw. † The relative angular orientation of the two parts is determined by the angle between the reference directions of axis1 and axis2. † LeadScrew5 constrains five degrees of freedom. † The symbol alpha tracks the spin of axis1, relative to axis2. † The constant C is the distance from the origin of axis2 to the origin of axis1 when the relative rotation between the two parts of the screw is zero. † LeadScrew5 generates six constraint equations and introduces one new variable, hence constraining five degrees of freedom. † The first two equations in LeadScrew5 constrain the origin of axis2 to lie on axis1, the next two equations constrain the two axes to be parallel, the fifth equation relates the axial displacement of the screw to the rotational displacement, and the sixth relates the value of the variable alpha to the rotational displacement. † See also: Cylindrical4, ParallelGears5, SetConstraints, SysCon.
MechanicalSystems
520
Line 2D/3D † Line[point1, point2] is a Mech data object that specifies an axis by endpoints. The axis originates at point1 and terminates at point2. The pointi must be Mech Point objects. † Line[bnum, lpnt1, lpnt2] is interpreted as Line[Point[bnum, lpnt1], Point[bnum, lpnt2]]. The lpnti can be points, {x, y} (2D) or {x, y, z} (3D), in the local coordinate system of body bnum or point numbers (positive integers) referencing coordinates that were defined with SetBodies. † If a Line object is used in place of a Mech Vector object, the vector from point1 to point2 provides the direction of the vector. † If a Line object is used in place of a Mech Axis object, the line’s origin (point1) provides the origin of the axis and the direction of the line provides the direction of the axis. † The rotational reference direction of a Line object cannot be explicitly specified. † Mech’s overloading of the built-in Line symbol has no effect on its usage in other Mathematica code. † See also: Line, Plane, ReferenceDirection.
Linear 2D/3D † Linear is a setting for the FitDegree option for SolveFree and SolvePath. Linear specifies a linear approximation of each section of the integrand. † Linear is generally less accurate than the higher-degree fits. † Linear works well with systems that have many force discontinuities because fewer back-steps are required to auto-adjust the time step size when a discontinuity is encountered. † See also: Cubic, Quadratic, Quartic.
Appendix B: MechanicalSystems Function Listing
521
LineOnCylinder3 3D † LineOnCylinder3[cnum, axis1, axis2, rad] constrains axis1 to lie parallel to axis2, and rad units away from axis2. † LineOnCylinder3 constrains three degrees of freedom. † LineOnCylinder3 becomes singular if rad is set to zero. Cylindrical4 should be used instead. † The first two equations constrain the two axes to be parallel, the third equation constrains the two axes to lie rad units apart. † See also: LineToLine1, ParaRevolute4, SetConstraints, SysCon.
LineToCircle1 3D † LineToCircle1[cnum, axis1, axis2, rad] constrains axis1 to pass through the perimeter of a circle of radius rad. The axis of the circle is specified by axis2 and the center of the circle lies at the origin of axis2. † LineToCircle1 constrains one degree of freedom. † LineToCircle1 can be used to model a shaft in a bearing with specified clearance. † See also: PlaneToCircle1, PointOnCircle2, SetConstraints, SysCon.
LineToLine1 3D † LineToLine1[cnum, axis1, axis1, dist] constrains the minimum orthogonal distance between the two axes to be equal to dist units. † LineToLine1[cnum, axis1, axis2] constrains the two axes to intersect. † LineToLine1 constrains one degree of freedom.
MechanicalSystems
522
† The LineToLine1 constraint could also be thought of as a “LineToCylinder1” constraint in which a line in space is constrained to be in contact with a cylindrical surface with a specified axis and radius dist. † See also: LineToPlane2, PointOnLine2, SetConstraints, SysCon.
LineToPlane2 3D † LineToPlane2[cnum, axis1, axis2, dist] constrains the direction of axis1 to be orthogonal to the direction of axis2, and constrains the origin of axis1 to lie dist units away from the origin of axis2, measured in the direction of axis2. † LineToPlane2 constrains two degrees of freedom. † LineToPlane2[cnum, axis1, axis2] constrains axis1 to lie within the plane normal to axis2. axis2 is typically given as a Modeler3D Plane object. † The first equation constrains axis1 and axis2 to be orthogonal, the second constrains the origin of axis1 to lie in a plane normal to axis2. † See also: PlaneToPlane3, PointOnPlane1, SetConstraints, SysCon.
Load 2D/3D † Load[sym, mag] returns a SysLoad data object that applies a load of magnitude mag directly to coordinate sym. † After creation, the SysLoad object is passed to SetLoads to alter the state of the current Mech model. † The Load function is used to add expressions directly to the model’s load vector without any coordinate transformation so that loads may be applied directly to generalized coordinates. † For example, if a coordinate len in a model represented the distance between two points, Load[len, 2] would apply a two-unit force tending to separate the two points. † If the Angular solution method is current in a Modeler3D model, Load can be used to apply a moment directly to an angular velocity coordinate. In this case the setting of Coordinates solution method also effects the result. † If the Euler solution method is current in a Modeler3D model, Load can be used to apply a load directly to the Euler coordinates only.
Appendix B: MechanicalSystems Function Listing
523
† For example, if the Angular, Local solution method is current, Load[Ωx2, 3] applies a 3 unit moment to body 2 directed along the local X axis. † See also: Constraint, Force, Gravity, Moment.
Loads 2D/3D † Loads[bnum] returns the total external load applied to body bnum. † Loads[{bnum1, bnum2, … }] returns the subset of the applied load vector associated with the bnumi. † Loads[All] returns the entire applied load vector. † Loads[Rest] returns the subset of the applied load vector that is associated with derivatives of generalized coordinates, such as the extra variables introduced by cam constraints. † Loads[sym] returns the element of the load vector associated with coordinate sym. † Loads[{sym1, … , symn}] returns the subset of the applied load vector associated with several coordinate symbols. † The symi must be location coordinates as returned by Location[bnum] or, if the current Modeler3D solution method is Angular, angular velocity coordinates as returned by Omega[bnum]. † The following options can be givens: Coordinates
Automatic
whether the result should be in Local or Global coordinates
Type
Applied
whether to return Applied, Reaction, or Dynamic loads
† The default setting Coordinates->Automatic returns the loads in the current default coordinate system. † If Coordinates->Automatic is given and the current coordinate system is Euler, a list of seven loads is returned in Euler coordinates. † If either the Global or Local setting is given for Coordinates, the argument must be a single body number bnum. In this case Loads returns a two-element list of the form {force, moment}. † Type->Reaction may be given to return the total reaction force applied by all constraints to the body. † Type->Dynamic may be given to return the total inertial load on the body.
MechanicalSystems
524
† For example: Loads[n, Type->Applied] + Loads[n, Type->Dynamic] + Loads[n, Type->Reac tion] /. SolveMech[ … , Solution->Dynamic] should always return a zero vector. † See also: Constraints.
Local 2D/3D † Local is a setting for the Coordinates option that causes results to be returned relative to the local coordinate system of a body. † The alternative to the Local setting is Global. † See also: Reaction, SetSymbols.
LocalAxes 2D/3D † LocalAxes[bnum, size] returns a graphics object placing local xy or xyz axes of specified size at the origin of body bnum. † LocalAxes[{bnum1, bnum2, … }, size] places axes on several bodies. † LocalAxes[All, size] places axes on all bodies in the current model. † LocalAxes returns a list of Mathematica graphics primitives that are functions of mechanism location variables. † See also: Arrow, PointLabel.
Location 2D/3D † Location[point] returns the global coordinates, {x, y} or {x, y, z}, of the specified point. † Location[axis] returns the global coordinates of the origin of the specified axis. † Location[bnum, lpnt] is interpreted as Location[Point[bnum, lpnt]]. † Location[bnum] returns the location and angular orientation coordinates of body bnum in a flat list.
Appendix B: MechanicalSystems Function Listing
525
† The bnum argument can take any of the forms accepted by Loads to obtain the location coordinates of multiple bodies. † Location is also a setting for the Solution option for several Mech functions. † Solution->Location causes such functions to seek a solution for only the location of the current model. † Location[All] returns the entire vector of dependent variables. † To use Location[bnum], bnum must be the number of a body in the current model. † In Modeler2D, the behavior of Location[bnum] varies depending on whether the current solution method is Angular or Euler. With the Euler solution method, Location[2] returns {X2, Y2, Ei2, Ej2}, while with the Angular solution method, Location[2] returns {X2, Y2, Θ2}. † Modeler3D always represents angular orientation with four Euler parameters. † The alternatives to the Location setting for the Solution option are Velocity, Acceleration, Static, Kinematic, and Dynamic. † See also: Rotation, SolveMech, SetCouple.
LockMech 2D/3D † LockMech[t] finds a solution to the mechanism equations at time t and then embeds the numerical values of the dependent variables into the mechanism equations so that they cannot be changed until a new system is built with SetConstraints. † The LockMech command is useful when a mechanism is to be analyzed repeatedly through changing velocities, accelerations, or forces, at a constant location, velocity, or acceleration. † The Solution option can be given to specify what order of dependent variables to lock. † Valid settings for Solution are Location, Velocity, and Acceleration. † For example, Solution->Velocity locks the position and velocity of the model, so that accelerations and loads can still be calculated. † The default option is Solution->Location. † Using LockMech significantly accelerates the operation of the higher-order and load solution blocks as it is no longer necessary to perform the replacement and evaluation of the unchanging variables. † See also: CheckRules, Compiled.
MechanicalSystems
526
LocusPlot 2D/3D † LocusPlot[point, {{rules1}, {rules2}, … , {rulesn}}] returns a graphics primitive representing the locus of point as it moves through successive locations specified by the rulesi. † LocusPlot simply returns a list of Mathematica Line primitives. † The required list of rulesi is of the form returned by SolveMech[{t1, t2, ti}, n]. † See also: CamPlot.
MakeRules 2D/3D † MakeRules is an option for SolveMech and other functions that is used to specify which dependent variables to generate InterpolatingFunction objects for. † The default setting MakeRules->{Parameters, Location, Generalized} generates rules for the location coordinates (X2, Y3, …) and the generalized forces (Λ1, Λ2, …), if they are present, and also any system parameters. † Settings for MakeRules may be any subset of {Parameters, Location, Velocity, Acceleration, Generalized, Diagnostics}. † MakeRules has no effect unless Interpolation->True is given. † The parameters and other constants are not interpolated. † See also: Interpolation.
Magnitude 2D/3D † Magnitude[vector] returns the length of vector. † vector may be a simple vector or a Mech vector object with head Vector, Line, or Plane (3D). † Magnitude is also an option for Force and Moment (3D). Magnitude->Relative causes the magnitude of the applied load to be multiplied by the length of the load vector.
Appendix B: MechanicalSystems Function Listing
† Magnitude is also an option for Extrude (3D). Magnitude->Relative causes the extrusion distance to be multiplied by the length of the extrusion vector. † Magnitude->Absolute causes the magnitude of the applied load or the extrusion distance to be equal to the specified magnitude. † Magnitude[bnum, lpnt] is interpreted as Magnitude[Vector[bnum, lpnt]]. † Other Magnitude[args, … ] instances are interpreted as Magnitude[Line[args]]. † The default setting is Magnitude->Absolute. † See also: Direction, Distance, Unit.
Mass 2D/3D † Mass is an option for Body that specifies the mass of a body. † Mass[bnum] returns the mass of body bnum. † The mass of each body is initially zero, unless otherwise specified. † The default setting Mass->Automatic leaves the current mass unchanged. † See also: Centroid, Inertia, SetBodies.
527
MechanicalSystems
528
MassMatrix 2D/3D † MassMatrix[bnum] returns the submatrix of the current system mass matrix associated with body bnum. † The bnum argument can take any of the forms accepted by Loads to obtain a submatrix associated with multiple bodies. † MassMatrix[All] returns the entire system mass matrix. † Centrifugal[All] + MassMatrix[All] . Acceleration[All] returns the entire dynamic load vector. † In Modeler3D, if and only if the current solution method is Angular and the current coordinate system is Local will the system mass matrix be a matrix of constants. Otherwise it will generally be a function of Euler coordinates. † See also: Loads.
MaxError 2D/3D † MaxError is an option for SolveFree and SolvePath that is used to specify the maximum allowable estimated error in any dependent variable in a single time step. † If MaxError is exceeded at any time step, the time step size is halved. † The default error estimation algorithm used by SolveFree assumes that the average magnitude of each of the dependent variables is near to one (which is clearly true for the Euler parameters or angular variables in units of radians). † Setting MaxError to a larger value effectively relaxes the error estimation criteria that are used to adjust the time step size. † The MaxError option can also be used to explicitly specify the error limits at which the time step size is halved or doubled, or when a corrective versus predictive step is taken. † MaxError->{a, b, c} specifies that the time step size will be halved if the maximum error in the current step is greater than a. The step size will be doubled if the maximum error in any of the last 2n steps drops below c, where n is the degree of the integrand fitting polynomial. An Adams-Moulton corrective step will be taken if the error in the current step is between a and b.
Appendix B: MechanicalSystems Function Listing
† The default setting is MaxError->0.0001. † MaxError->{0.0001, 0.00001, 0.000001} is equivalent to the default setting. † See also: Diagnostics.
Mech 2D/3D † Mech is the symbol name for all MechanicalSystems general messages. † See also: General.
Method 2D/3D † Method is an option for SetSymbols that is used to specify whether Euler or Angular coordinates will be used to represent angular orientation (2D) or angular velocity (3D). † Method is an option for SolveFree and SolvePath that is used to specify whether a Predictor, Corrector, or Automatic integration algorithm is used. † The default setting is Method->Angular for Modeler2D and Method->Euler for Modeler3D. † The default setting is Method->Automatic for SolveFree and SolvePath. † See also: Coordinates, FitDegree, Method.
529
MechanicalSystems
530
Moment 2D/3D † Moment[bnum, mag] (2D) returns a SysLoad data object that applies a moment to body bnum of magnitude mag. † Moment[bnum, vector, mag] (3D) returns a SysLoad data object that applies a moment to body bnum of magnitude mag in the direction of vector. † Moment[bnum1, bnum2, … ] applies the moment to body bnum1 and also applies a moment in the opposite sense to body bnum2. † After creation, the SysLoad object is passed to SetLoads to alter the state of the current Mech model. † The following options can be given: CutOff
0
allow the length of axis to approach zero without a singularity
Magnitude
Absolute
whether dist is multiplied by the length of vector
† In Modeler3D, Magnitude->Relative causes the magnitude of the applied moment to be equal to the specified mag times the length of vector. † See also: Body, Force, GyroMoment, Load.
Natural 2D/3D † Natural is a setting for the EndConditions option for SplineFit that specifies that the curvature of the spline will be zero at the ends. † The alternatives to Natural are Closed or a list of two direction vectors. † See also: SplineFunction.
Appendix B: MechanicalSystems Function Listing
531
Normalized 3D † Normalized is an option for Rotation that specifies whether vector in the returned {ang, vector} is to be normalized. † Normalized is also a setting for the Assumptions option for several Mech functions. † Normalized->False allows Rotation to return an axis of rotation that is not normalized. † Assumptions->Normalized allows functions to assume that the given axis of rotation is normalized, hence allowing them to avoid the burden of normalizing it again. † The default setting for Rotation is Normalized->True. † See also: Normalized, Unit.
Omega 2D/3D † Omega[bnum] returns the angular velocity (2D) or angular velocity vector (3D) of body bnum. † In Modeler2D, Omega returns a scalar w. † In Modeler3D, Omega returns the angular velocity is a vector of the form: {wx, wy, wz}. † If the Euler solution method is specified with SetSymbols, Omega returns the angular velocity in terms of Euler parameters and their derivatives. With the Angular solution method Omega simply returns Θbnumd (2D) or {Ωxbnum, Ωybnum, Ωzbnum} (3D). † In Modeler3D, Omega accepts the Coordinates option to specify whether the angular velocity should be returned in Global or body Local coordinates. The default setting is Coordinates->Global. † See also: Alpha, Rotation, Velocity.
Origin 2D/3D † Origin[bnum] returns the global coordinates of the origin of body bnum.
MechanicalSystems
532
† Origin[bnum] is equivalent to Location[bnum, 0]. † See also: Location, Rotation.
OriginLock2 2D † OriginLock2[cnum, bnum1, bnum2] locks the position of body bnum1 to that of body bnum2. The local origins of the two bodies are coincident. If bnum2 is omitted, bnum1 is located relative to the global origin. † OriginLock2 constrains two degrees of freedom. † OriginLock2[cnum, bnum1, bnum2, vector] forces the origin location of body bnum1 to be equal to the origin location of body bnum2 plus the given vector. † The first equation constrains the X coordinate and the second constrains the Y coordinate. † See also: Revolute2, RotationLock1, SetConstraints, SysCon.
OriginLock3 3D † OriginLock3[cnum, bnum1, bnum2] locks the position of body bnum1 to that of body bnum2. The local origins of the two bodies are coincident. If bnum2 is omitted, bnum1 is located relative to the global origin. † OriginLock3 constrains three degrees of freedom. † OriginLock3[cnum, bnum1, bnum2, vector] forces the origin location of body bnum1 to be equal to the origin location of body bnum2 plus the given vector. † The three equations in OriginLock3 constrain the X, Y, and Z coordinates, respectively. † See also: Spherical3, RotationLock3, SetConstraints, SysCon.
Appendix B: MechanicalSystems Function Listing
533
OrthogonalGears5 3D † OrthogonalGears5[cnum, axis1, teeth1, {alpha, guess}, axis2, teeth2, C] models a pair of gears on orthogonal axes, such as a bevel gear set. † The axes of the two gears, axis1 and axis2, are constrained to be orthogonal, and the origins of these two axes are constrained to be coincident. The rotational positions of the two gears are related as per their respective tooth counts, teeth1 and teeth2. † Negating teeth1 or teeth2 reverses the relative direction of rotation of the gears. † OrthogonalGears5 constrains five degrees of freedom. † OrthogonalGears5[cnum, axis1, teeth1, {alpha, guess}, axis2, teeth2, dist, C] offsets the axes of the gears by dist units, such as the offset in a worm gear or spiral bevel gear set. † The symbol alpha tracks the relative spin of axis1. † The constant C, which sets the initial positions of the two gears, is given by the formula C = teeth1 e1 + teeth2 e2. e1 and e2 are determined in the following way. Place the two gears in any valid position. e1 is the projected angle, in radians, measured from axis2 to the reference direction of axis1, and e2 is the angle from axis1 to the reference direction of axis2. † OrthogonalGears5 generates six constraint equations and introduces one new variable, hence constraining five degrees of freedom. † The first equation in OrthogonalGears5 constrains axis1 to be orthogonal to axis2, the next two equations constrain the origins of the two axes to be adjacent, the fourth equation constrains the axes to be dist units apart, and the fifth and sixth equations relate the value of the variable alpha to the relative rotation of the two gears. † See also: ConstantVelocity4, Orthogonal1, ParallelGears5, SetConstraints, SetSymbols, SysCon.
Orthogonal1 2D/3D † Orthogonal1[cnum, vector1, vector2] constrains vector1 to be orthogonal to vector2. † Orthogonal1 constrains one degree of freedom. † See also: Parallel1, Parallel2, RelativeAngle1, SetConstraints, SysCon.
MechanicalSystems
534
OrthoRevolute4 3D † OrthoRevolute4[cnum, axis1, axis2, dist] constrains axis1 to lie dist units away from axis2, and to be orthogonal to axis2. Further, the origin of axis1 is constrained to lie directly adjacent to the origin of axis2. † OrthoRevolute4 constrains four degrees of freedom. † OrthoRevolute4 models a pair of hinges with orthogonal axes and a specified offset distance separating the two axes. † OrthoRevolute4[cnum, axis1, axis2] assumes the separation distance to be zero. † The first equation in OrthoRevolute4 constrains the origin of axis2 to be adjacent to axis1, the second equation constrains the origin of axis1 to be adjacent to axis2, the third constrains the separation distance to be dist units, the fourth constrains the two axes to be orthogonal. † See also: GenOrthoRevolute4, ParaRevolute4, Revolute5, SetConstraints, SysCon.
Parallel1 2D † Parallel1[cnum, vector1, vector2] constrains vector1 to be parallel to vector2. † Parallel1 constrains one degree of freedom. † Parallel1 is not sensitive to the sign of the vectori. † The constraint is satisfied if the two vectors are pointing in exact opposite directions. † See also: Orthogonal1, Parallel2, SetConstraints, SysCon.
Parallel2 3D † Parallel2[cnum, vector1, vector2] constrains the vectori to be parallel in 3D space. † Parallel2 constrains two degrees of freedom.
Appendix B: MechanicalSystems Function Listing
535
† Parallel2 is not sensitive to the sign of the vectori. † The constraint is satisfied if the two vectors are pointing in exact opposite directions. † See also: Orthogonal1, Parallel1, SetConstraints, SysCon.
ParallelAxis 2D/3D † ParallelAxis[vec, mass, inertia] uses the parallel axes theorem to transform the inertia properties of a body into or out of a centroidal reference frame. Assuming that the given inertia properties are centroidal, ParallelAxis returns the inertia properties relative to a noncentroidal reference frame in which vec is the vector from the origin of the noncentroidal frame to the centroid of the body. † The sign of the specified vector pointing to the centroid of the body is irrelevant. † In Modeler2D, inertia is specified by a scalar and the return value is a scalar. † In Modeler2D, simply negate mass to transform noncentroidal properties into a centroidal reference frame. † In Modeler3D, the inertia of the body is specified by a list of the elements of the inertia matrix: {Ixx, Iyy, Izz, Ixy, Iyz, Izx} or a full inertia matrix. ParallelAxis then returns the list {Ixx', Iyy', … } of inertia properties relative to the noncentroidal reference frame. † In Modeler3D, ParallelAxis[centroid, mass, inertia, rotation] is used to specify that the centroidal reference frame in which the specified inertia properties are calculated is rotated relative to the noncentroidal frame. The rotation of the centroidal frame is specified by {angle, axis}, a virtual rotation vector, or a set of Euler parameters. † In Modeler3D, to transform noncentroidal inertia properties into a centroidal reference frame: vec is the vector (in the centroidal reference frame) from the centroid to the origin of the noncentroidal reference frame, rotation specifies the relative rotation (in the centroidal reference frame) of the noncentroidal frame, and a negative mass is specified. † See also: CompositeInertia, GyroFilter, PrincipalAxes.
ParallelGears4 3D † ParallelGears4[cnum, axis1, rad1, {alpha, guess}, axis2, rad2, C] models a gear set.
MechanicalSystems
536
† This constraint is identical to ParallelGears5 except that the heads of the two axes are not constrained to be adjacent. Thus, the two gears can slide on their axes, relative to each other. † ParallelGears4 constrains four degrees of freedom. † ParallelGears4 is essentially ParallelGears5 with the third equation dropped. † See also: OrthogonalGears5, Parallel2, SetConstraints, SetSymbols, SysCon.
ParallelGears5 3D † ParallelGears5[cnum, axis1, rad1, {alpha, guess}, axis2, rad2, C] models a gear set. † The axes of the two gears, axis1 and axis2 are constrained to be parallel and rad1+rad2 units apart, and the heads of the two axes are constrained to be adjacent. The rotational positions of the gears are related as per their respective radii. † ParallelGears5 constrains five degrees of freedom. † The symbol alpha tracks the spin of axis1, relative to a vector spanning from axis1 to axis2. † The constant C, which sets the initial positions of the gears, is given by the formula C = rad1 e1 + rad2 e2. e1 and e2 are determined in the following way. Place the two gears in any valid position and construct a vector from the origin of axis1 to that of axis2. e1 is the angle, in radians, measured from the constructed vector to the reference direction of axis1, and e2 is measured from the vector to the reference direction of axis2. † ParallelGears5 generates six constraint equations and introduces one new variable, hence constraining five degrees of freedom. † The first two equations in ParallelGears5 constrain axis1 to be parallel to axis2, the third equation constrains the origin of axis2 to lie adjacent to axis1, the fourth equation constrains the axes to be rad1+rad2 units apart, and the fifth and sixth equations relate the value of the variable alpha to the rotational displacements of the gears. † See also: OrthogonalGears5, Parallel2, SetConstraints, SetSymbols, SysCon.
Appendix B: MechanicalSystems Function Listing
537
Parameterize 2D/3D † Parameterize[symbols] takes the given list of symbols (each of which must have a numeric value defined) unsets them and puts them in the parameters list with a current value equal to their previously defined value. † For example, (c = 3.5; Parameterize[{c}]) has the same effect as SetParameters[{c->3.5}]. † Upon success, Parameterize returns the entire parameters list. † See also: SetParameters.
Parameters 2D/3D † Parameters[] returns the current Mech parameters list. † Parameters is also an element of the setting for the MakeRules option. MakeRules->{Parame ters, … } causes the current parameters to be included in the returned rules. † Parameters is also an option for SplineFit that is used to specify the value of the spline parameter at each knot point. † As an option for SplineFit, Parameters can be either a list of numbers in ascending order, equal in length to the number of data points given, or Automatic, which is equivalent to specifying a list of integers ascending from zero. † Specifying the Parameters option for SplineFit allows the spacing of the knot points for the spline independent variable to be altered. † See also: ClearParameters, Reaction, SetParameters.
MechanicalSystems
538
ParaRevolute4 3D † ParaRevolute[cnum, axis1, axis2, dist] constrains axis1 to lie dist units away from, and parallel to axis2. Further, the origin of axis1 is constrained to lie directly adjacent to the origin of axis2. † ParaRevolute constrains four degrees of freedom. † ParaRevolute4 models a pair of hinges with parallel axes and a specified offset distance separating the two axes. † ParaRevolute4 becomes singular if the separation distance is zero; use Revolute5. † The first two equations in ParaRevolute4 constrain axis1 and axis2 to be parallel, the third constrains the origins of the two axes to be adjacent, and the fourth constrains the separation distance to be equal to dist. † See also: OrthoRevolute4, Cylindrical4, SetConstraints, SysCon.
PathSystem 2D/3D † PathSystem is the head of the data object returned by SetPath. † The format of the PathSystem data object is PathSystem[equations, timesym, variables, initialconditions, parameters, primerules]. † PathSystem is not intended to be used external to Mech. † See also: SolvePath.
Plane 3D † Plane[point1, point2, point3] is a Modeler3D data object that uses three points to define a plane. The plane originates at point1 and is fully defined by point2 and point3 that also lie in the plane. The pointi must be Mech Point objects.
Appendix B: MechanicalSystems Function Listing
539
† Plane[bnum, lpnt1, lpnt2, lpnt3] is interpreted as Plane[Point[bnum, lpnt1], Point[bnum, lpnt2], Point[bnum, lpnt3]]. The lpnti can be points, {x, y, z}, in the local coordinate system of body bnum or point numbers (positive integers) referencing coordinates that were defined with SetBodies. † If a Plane object is used in place of a Modeler3D Vector object, the plane’s normal provides the direction of the vector. † If a Plane object is used in place of a Modeler3D Axis object, the plane’s origin (point1) provides the origin of the axis, the plane normal provides the direction vector, and the line from point1 to point2 provides the rotational reference vector of the axis. † See also: Line, ReferenceDirection.
PlaneToCircle1 3D † PlaneToCircle1[cnum, axis1, axis2, rad] constrains a plane that is normal to axis1 to lie tangent to a circle of radius rad, centered at the origin of axis2, with its normal vector in the direction of axis2. † PlaneToCircle1 constrains one degree of freedom. † PlaneToCircle1[cnum, axis1, axis2, majrad, minrad] constrains the plane that is normal to axis1 to lie tangent to the surface of a torus of major radius majrad and minor radius minrad, centered at the origin of axis2 with major axis specified by axis2. † See also: LineToCircle1, SetConstraints, SysCon.
PlaneToPlane3 3D † PlaneToPlane3[cnum, axis1, axis2, dist] constrains axis1 to be parallel to axis2, and constrains the origin of axis1 to lie dist units away from the origin of axis2, in the direction of axis2. † PlaneToPlane3 constrains three degrees of freedom.
MechanicalSystems
540
† PlaneToPlane3[cnum, axis1, axis2] constrains two planes that are normal to the two specified axes to be coincident. † See also: PointOnPlane1, SetConstraints, SysCon.
Point 2D/3D † Point[bnum, lpnt] is a Mech data object that specifies a point in the local coordinate system of body bnum. † The lpnt can be a vector, {x, y} (2D) or {x, y, z} (3D), or a point number (positive integer) referencing coordinates that were defined with SetBodies. † A simple vector {x, y} or {x, y, z} given in place of a Point object is interpreted as Point[1, {x, y}] or Point[1, {x, y, z}]. † Mech’s overloading of the built-in Point symbol has no effect on its usage in other Mathematica code. † See also: Axis, Line, Plane, Point, Vector.
PointAtIntersection3 3D † PointAtIntersection3[cnum, point, axis1, axis2] constrains point to lie at the intersection of axis1 and a plane that is specified by axis2. † PointAtIntersection3 constrains three degrees of freedom. † axis2 is typically a Modeler3D Plane object, but the plane may be specified by its origin and normal direction with any Modeler3D axis object. † See also: SetConstraints, Spherical3, SysCon.
PointLabel 2D/3D † PointLabel[bnum, {lpnt1, lpnt2, … , lpntn}] labels several points on body bnum with their body numbers and local coordinates.
Appendix B: MechanicalSystems Function Listing
541
† PointLabel[bnum, All] labels all of the points on body bnum that were defined with a body object. † PointLabel[{point1, … , pointn}] labels several points on different bodies. † PointLabel returns a list of Mathematica graphics primitives that are functions of mechanism location variables. † The point label generated is of the form " † See also: PointToLocal, PolarToXY.
XYZ 3D † XYZ is a setting for the Coordinates option that is used with coordinate conversion functions to specify the right-handed coordinate system X-Y-Z. † See also: CylindricalToXYZ, SphericalToXYZ, XYZToCylindrical, XYZToSpherical.
Appendix B: MechanicalSystems Function Listing
XYZToCylindrical 3D † XYZToCylindrical[{x, y, z}] converts the given point from Cartesian to cylindrical coordinates and returns {radius, angle, altitude}. † XYZToCylindrical accepts the Coordinates option to specify the relationship between the two coordinate systems. By default, altitude is measured in the Z direction, and an angle of zero results from a Y coordinate of zero. Coordinates->YZX causes altitude to be measured in the X direction, etc. † More complicated coordinate reorientations require a rotation matrix. † See also: CylindricalToXYZ, SphericalToXYZ, XYZ, XYZToSpherical, ZXY.
XYZToSpherical 3D † XYZToSpherical[{x, y, z}] converts the given point from Cartesian to spherical coordinates and returns {radius, baseangle, altitudeangle}. † XYZToSpherical accepts the Coordinates option to specify the relationship between the two coordinate systems. By default, altitudeangle is measured in the Z direction and a baseangle of zero results from a Y coordinate of zero. Coordinates->YZX causes altitudeangle to be measured in the X direction, etc. † More complicated coordinate reorientations require a rotation matrix. † See also: CylindricalToXYZ, SphericalToXYZ, XYZ, XYZToCylindrical, ZXY.
YZX 3D † YZX is a setting for the Coordinates option that is used with coordinate conversion functions to specify the right-handed coordinate system Y-Z-X. † See also: CylindricalToXYZ, SphericalToXYZ, XYZToCylindrical, XYZToSpherical.
597
MechanicalSystems
598
ZXY 3D † ZXY is a setting for the Coordinates option that is used with coordinate conversion functions to specify the right-handed coordinate system Z-X-Y. † See also: CylindricalToXYZ, SphericalToXYZ, XYZToCylindrical, XYZToSpherical.
$MechBodyList 2D/3D † $MechBodyList returns a list of the integer body numbers of all the bodies in the current model, not including the ground body, body 1. † The value of $MechBodyList is altered when SetConstraints is run. † See also: SolveMech, $MechConstraintList, $MechPreSolve.
$MechConstraintList 2D/3D † $MechConstraintList returns a list of the integer constraint numbers of all the constraints in the current model. † The value of $MechConstraintList is altered when SetConstraints is run. † See also: SolveMech, $MechBodyList, $MechPreSolve.
$MechPostIterate 2D/3D † $MechPostIterate is a function that is applied to the iteration counter at each iteration of Mech’s iterative solution block.
Appendix B: MechanicalSystems Function Listing
599
† $MechPostIterate has no definition by default. † Setting $MechPostIterate = Print causes the iteration count to be printed at each step. † See also: SolveMech, $MechPreSolve.
$MechPreSolve 2D/3D † $MechPreSolve is applied to the numeric value of the time variable before each run of the location solution block. † $MechPreSolve has no definition by default. † Setting $MechPreSolve = Print causes the value of time to be printed each time SolveMech converges one solution. † $MechPreSolve can be used to perform various tasks before a solution is sought, such as to update the initial guesses with SetGuess to predetermined values that are known to be close to the solution being sought. † See also: $MechPostIterate.
$MechPrimeRules 2D/3D † $MechPrimeRules returns a list of replacement rules for all of the current Mech dependent variables to convert them to explicit functions of time with the Derivative operator replacing Mech’s symbolic derivatives. † $MechPrimeRules returns a list of the form {X2->X2[T], … , Y3d->Y3'[T], … }. † See also: $MechTimeRules.
$MechProcessFunction 2D/3D † $MechProcessFunction is a function that is applied to Mech’s internal lists of modeling equations as they are generated. $MechProcessFunction is initially set equal to Chop.
MechanicalSystems
600
† $MechProcessFunction is set to Chop by default. † See also: SolveMech, ZeroTest.
$MechTimeRules 2D/3D † $MechTimeRules returns a list of replacement rules for all of the current Mech dependent variables to convert them to explicit functions of time. † $MechTimeRules returns a list of the form {X2->X2[T], … , Y3d->Y3d[T], … }. † See also: $MechPrimeRules.
$MechTimeSymbol 2D/3D † $MechTimeSymbol returns the symbol that represents time in the current model. † The time symbol defaults to T. † The time symbol may be changed with SetSymbols.
$MechUseEulerMassTerm 3D † $MechUseEulerMassTerm can be set to True to include a term in the mass matrix that affects only the values of the generalized forces associated with the Euler generalized constraints. These forces have no physical meaning and are orthogonal to real forces. † The default setting of $MechUseEulerMassTerm is False. † See also: Angular, Euler.
Appendix B: MechanicalSystems Function Listing
601
$MechUseMinimalRotation 3D † $MechUseMinimalRotation can be set to True to cause Modeler3D to use a minimal rotation formulation to transform axes that have no specified reference direction. † The default setting of $MechUseMinimalRotation is False. † The minimal rotation formulation rotates the given axis through the minimal rotation required to be aligned with + Z. † The minimal rotation formulation produces a symbolic result that is much simpler, but becomes singular when the axis is pointed in the – Z direction. † The default formulation uses the Step function to generate a more complex piecewise continuous result that is nonsingular for any configuration. † Whether or not the symbolic axis transformation becomes singular is irrelevant if axes are specified entirely numerically, as they typically are. † See also: ReferenceDirection.
$MechVariables 2D/3D † $MechVariables returns a list of the names of all of the user variables that are present in the current model. Changes in the values of these variables affect the model. † The names returned by $MechVariables represent all of the symbols that have been recognized by the Mech variable management scheme. † Variables that are not listed by $MechVariables are not made local when Mech generates constraint and load equations, thus any assignments for such variables become embedded in new internal expressions as they are generated. † See also: BuildMech.
MechanicalSystems
602
$MechVersion 2D/3D † $MechVersion returns the version number of the Mech packages. † For the version referenced in this manual, $MechVersion returns the string "2.0".