Math FB
Note:
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 a meaningless equation, the output will not be correct.
For example, to find, after a time-period, the displacement of a point that has constant acceleration, if you enter:
•(u*t) + (0.5*a*t), the syntax is correct, but the equation is meaningless
•(u*t) + (0.5*a*t*t) the syntax is also correct, and the displacement of the Point is correct.
Note - a bad example. I would design a motion in MotionDesigner with Constant-Acceleration.
|
Motion-Derivatives
MechDesigner continually calculates the Position, Velocity, and Acceleration of all Points and Parts in your model when all Parts are .
However, if you need the motion-derivatives, YOU must add the equation for each motion-derivative.
If you do not add the equations for each motion-derivatives (velocity and acceleration), their values remain equal to those motion-derivatives of the data at the input-connector.
|
Units
The units inside the Math FB are S.I. units for the Data-Type you select in the Math FB.
For example:
•If you select Linear Coordinates in the Math FB, then 50mm at the input-connector becomes 0.05 meters in an equation inside the Math FB dialog
•If you select Rotary Coordinates in the Math FB, then 50mm at the input-connector becomes (0.05*2*pi/360) radians in an equation inside the Math FB dialog. |
|
What can you do with a Math FB?
You can use the Math FB to do:
Simple Algebra
For example: 2+3. The output will be 5, of course.
Input variables, Parametric Equations, ... .
Use the output from other Function-Blocks to calculate a function of a machine-cycle. For example, connect the output from a Motion-Dimension FB and the output from a Force-Data FB at 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.
Change the Units of a Variable
Change the units at the input-connector of a Math FB to different units at its output-connector. To use a motion as a Force-Function to apply to a Spring FB you must convert the motion units, (e.g. 50mm) to Force units (e.g. Newtons).
|
|
How to add the Math FB and Open the Math FB dialog/interface.

|
Add a :
Click
Click the graphics-area |
The is now in the graphics-area
Open a dialog
The dialog is now open
|
Math FB dialog

|

You need one input-connector for each variable or parameter in your equation.
1.Click Add Input to add an input-connector to the Math FB. |

You need one output-connector for each variable and its motion-derivative
1.Click Add Output to add an output-connector from the Math FB. |

1.Click the drop-down box to select the Data-Type that applies to all of the equations and output-connectors. |
|
Wire Numbers and Data-Channels
The format of each parameter is an equation is:
 Three wires connected to the input of a Math FB
The image above has three(3) Wires connected to three input-connectors of a Math FB.
Wire-Numbers - IMPORTANT : Wire-Numbers start at 0
Input-Connector 1 = Wire Number 0 - connected to the TOP input-connector
Input-Connector 2 = Wire Number 1 - connected to the next input-connector, one down from the top
Input-Connector 3 = Wire Number 2 - connected to the next input-connector, one down again ... and so on ...
|
Data-Channel
Each wire has 3(three) data-channels.
In the Math FB, we use these letters for the three data-channels - p, v, and a ALWAYS - even if the data at the input-connector is not motion-data.
E.g. even if the wire is from a Force-Data FB
•p = Data-Channel 1
•v = Data-Channel 2
•a = Data-Channel 3 |
Example Entries in an Equation:
p(0) : the p refers to Data-channel 1, and (0) refers to input-connector 1
a(2) : the a refers to Data-channel 3, and (2) refers to input-connector 3
v(1) : the v refers to Data-channel 2, and (1) refers to input-connector 2
|
|
How many input and output-connectors? - and Example:
It is easier to understand with an example. We will calculate Power :
P = Ʈ . ω
Power (N.m./sec) = Torque(N.m.) × Angular Velocity (rad/sec)
Torque data and Angular-Velocity data are the TWO inputs and Power is the ONE output.
Input 1: you can get Torque data from a Force-Data FB .
Input 2: you can get Angular-Velocity data from a Motion-Dimension FB .
The Output Data-Type from the Math FB must set to Power in the Math FB
|
|

|
Prepare the model:
1.Add a Rocker - see Tutorial 1
2.Edit the CAD-Line of the Rocker, to open the CAD-Line dialog.
In Mass Properties tab > User Mass Properties >
Enter a Mass.
Enter a Center-of-Mass (X-axis) and a Center-of-Mass (Y-axis) to move the Center-of-Mass from the start-Point of the CAD-Line.
Do not enter a value for Inertia or Radius of Gyration.
The mass is at a single point. In cosmology we would use the term Black-Hole! In kinematics and kinetostatics we use the term Point-Mass.
3.Add a Force-Data FB, and open the Force-Data dialog.
4.Select the Pin-Joint, and select the Point in the Base-Part to find the Torque that acts-on the Base-Part. |
|

|
See image above - note the three Data-Channels at output-connectors of the Force-Data FB and the Motion-Dimension FB.
Prepare the Math FB:
1.Open the Math FB dialog
2.Add two Input-Connectors with the Add-Input button
3.Select Power as 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 input-connectors
The equation in the Math FB is:
× (see image above)
p(0)*v(1)
p(0): Wire-Number 0 (top input wire), Channel 1 (p = Torque)
v(1): Wire-Number 1 (bottom input wire), Channel 2 (v = Angular Velocity)
|
|
 MathFB-
Power= Torque x Ang.Vel
|
SYNTAX and VALID Equations:
Click the Update after you add the equation to see if its syntax is correct or not correct.
The at the left of each equation confirms that the syntax is 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 Feedback-Area.
|
|
Function-Blocks : Data-Types & Data-Channels
Output-Connector from :
|
Output
Data Type
|
Data-Channel 1
|
Data-Channel 2
|
Data-Channel 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3 output-connectors)
|
|
|
|
|
|
(5 output-connectors)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|