<< Click to Display Table of Contents >> Navigation: Getting Started Tutorials  MechDesigner > Tutorial 18: Math FB > Step 18:0: Introduction to the MathFB 
IMPORTANT NOTES:
Equations You must enter the equations correctly with the correct syntax. The Math FB will check the syntax, but not the equation itself. If you enter an incorrect equation, the output will be incorrect. Motion Derivatives YOU must add the symbolic equation of each motionderivative. If your application needs position, velocity, and acceleration, then you must enter the three equations separately. If you do not add the motionderivatives (velocity and acceleration), their values remain at equal to the values at the inputconnector. Units Use the Output Data Type dropdown box in the Math FB dialogbox to select the units at the outputconnector. The units inside the Math FB are S.I. units. For example, •50mm at the inputconnector becomes 0.05m when applied to an equation inside the Math FB dialogbox •50° at the inputconnector becomes (50*2*pi/360)rads. and applied to an equation inside the Math FB dialogbox 
The Math FB can use data that is available at the outputconnectors of other FBs. You can use the Math FB to do: Simple Algebra For example: 2+3. The output will be 5, of course. Parametric Constants For example, connect the output of a MotionDimension FB of a Crank and the output of a ForceData FB of the same Joint. You can use the Math FB to multiply the Torque(Nm) and the Velocity(rad/sec) values to give the Power(kW) as the output. TopTip: Connect a Gearing FB to the input of a Math FB. You can edit the Gearing FB, so that it becomes a parametricconstant of an equation in the Math FB, for example, a Friction Coefficient. Change the Units of a Variable For example, change the units at the inputconnector of a Math FB to different units at its outputconnector  for example: mm to Newtons. 
Add a Math FB:
The Math FB is now in the graphicarea Open a Math FB dialogbox
The Math FB dialogbox is now open 
Math FB dialogbox
Add Connectors ; OutputDataType
Add Input button You need one inputconnector for each variable or parameter in your equation.
Add Output button You need one outputconnector for each variable and its motionderivative
Output DataType
There is ONE DataType for All of the OutputConnectors. 
Wire Numbers and DataChannels
The format of a variable in an equation is: DataChannel (WireNumber) Three wires connected to the input of a Math FB 

The image above shows three(3) Wires connected to inputconnectors of a Math FB. WireNumbers  IMPORTANT : WireNumbers start at 0
DataChannel
Example Entries in an Equation:

How many input and outputconnectors?  and Example:
By way of an example we will calculate Power : P = Ʈ . ω Power (N.m./sec) = Torque(N.m.) × Angular Velocity (rad/sec) Torque data and AngularVelocity data are the inputs and Power is the output. Thus, you need two inputconnectors and one outputconnector. 
We get Torque data from a ForceData FB. We get AngularVelocity data from a MotionDimension FB. Prepare the model: 1.Add a Rocker  see Tutorial 1 2.Edit the CADLine of the Rocker, to open the CADLine dialogbox. In Mass Properties tab > User Mass Properties . In Mass Properties tab > User Mass Properties . We will not enter a value for the Inertia or Radius of Gyration. This makes the mass a Point Mass  the mass of the Rocker is reduced to a particle. 3.Add a ForceData FB, open the ForceData FB dialogbox, select the PinJoint, and select the Point in the BasePart to find the Torque that actson the BasePart. 
See image above  the Wires and DataChannels of the ForceData FB and the MotionDimension FB Prepare the Math FB: 1.Open the Math FB dialogbox: 2.Add two InputConnectors with the AddInput button 3.Select Power for the Output Data Type. 4.Click UPDATE button after we select the Output Data Type and before we add equations. 5.Enter the Equations to calculate Power. The Math FB uses SI units for all data at its inputconnectors The equation in the Math FB is: × p(0)*v(1) WireNumber 0 (top), Channel 1 (p = Torque) × WireNumber 1 (bottom wire), Channel 2 (v = Angular Velocity) 
MathFB 
SYNTAX and VALID Equations: Click the Update after you edit the equation to find if its syntax is correct or not correct. For example, the syntax is not correct if it does not have the correct number of parentheses. The reason is given as a message in the FeedbackArea. The at the left of each equation shows whether its syntax is correct. 
Each wire has three channels. 

