﻿ Modelling | Add Math FB

# Modelling | Add Math FB

### Why use a Maths FB?

A Math FB allows you to develop new functions that might be useful for your modelling.

### Add Math FB

[Above Graphic-Area]: Modelling FB toolbar > Maths FB

Menu:

Add menu > Add Maths FB

Dialog-Box:

Note: The Calculator tool is behind the Maths dialog-box - drag the Math FB dialog-box to one side!

What for:

To use custom functions that are not available with other FBs.

How to add:

STEP 1: Add the Maths FB to the graphic-area

 1 Click the Add Maths FB in the Kinematics FB Toolbar.
 2 Click in the graphic-area

The Maths FB is now in the graphic-area.

How to edit:

STEP 2: Open the Maths FB dialog-box:

 1 Double-click a Maths FB in the graphic-area

or

 1

Tutorial:

Tutorial 18: Maths FB

#### Input-Connectors and Output-Connectors

 Input-Connectors Click the Add Input button to add an input-connector Add as many input-connectors as there are parameters and variables in the equation. Output-Connectors Click the Add Output button to add an output-connector Add as many output-connectors as there are functions / equations you need to output. For each output-connector, you can write an equation for three Data Channels(top image). How many input and output-connectors? By example, to calculate Power from Torque × Velocity P =  Ʈ . ω Power is the 'output'; Torque and Velocity are the 'inputs'. Thus, you need two input-connectors and one output-connector.
 Data from Input-Connectors, Data at Output-Connectors, Units, and Valid Equations

INPUT-CONNECTORS: 'Wire Numbers' + 'Data-Channels'

Together we identify each wire and and each data channel in an equation as:

'Data-Channel(Wire-Number)'

'Wire-Number'

Each wire [input-connector] is given a number, which we can think of as a 'wire-number'.

 • The top-most wire-number is '0'.
 • The next wire-number down is '1'
 • The next wire-number down again is '2', ....

'Data-Channel'

Each wire has 3[three] 'data-channels'

 • p = Data-Channel 1 ; v = Data-Channel 2 ; a = Data-Channel 3

We use these three letters even if the data at the input is not a motion-value.

Thus, together, we use the notation as in these examples:

p(0) : The 'p' indicates Data-channel 1, the '0' indicates the top wire/input-connector

a(2) : The 'a' indicates Data-channel 3, the '2' indicates the third[3rd] input-connectors from the top

v(1) : The 'v' indicates Data-channel 2, the '1' indicates  the second[2nd] input-connector from the top

Equations for each Output-Connectors

There is one output-connector when you add the Maths FB to the graphic-area. Each output-connector has [3] three data-channels.

In the image, we can see that we can write up to six equations [for two output-connectors].

Three equations for each of the two output-connectors [0,1]

The top Output-Connector u is '0'. We can write three equations, one to each 'Output [0]: Data-Channel # 0, 1 & 2

The next Output-Connector u is '1'. We can write three equations, one to each 'Output [1]: Data-Channel # 3, 4 & 5.

Output Data-Types drop-down box.

All output-connectors must have the same data-type.

 1 Select the 'Output Data-Type' fin the drop-down box.
 2 Click the 'Update' button at the bottom of the dialog.

For example, if you select 'Linear Coordinates', the

 • Data Output on Data-Channels 0, 3, 6, 9,... is 'Dis', with units of 'm'
 • Data Output on Data-Channels 1, 4, 7, 10,.. is 'Vel', with units of 'm/s'
 • Data Output on Data-Channels 2, 5, 8, 11,...' is 'Acc', with units of 'm/s/s'

Notes:

The Units inside the Maths FB are SI units: kilogram, metres, seconds, ...

Valid Equations

Click the 'Update' after you edit the equation to find if the syntax is correct or not correct.

The syntax is corrected in some way if it is not correct.F or example, an equation may not have the correct number of parentheses. The reason is given as a message in the Feedback-Area.

The at the left-side of each equation shows whether the syntax of the equation is correct or not correct.

Each output-connector has one equation for for each Data-Channel.

For example: the equation : v(0)*p(1).

It multiplies:

 • channel #2 on input-connector wire #1 ... v(0)

by

 • channel #1 on input-connector wire #2 ... p(1)

Tutorial and Reference Help Files for MechDesigner and MotionDesigner 13.2 + © Machine, Mechanism, Motion and Cam Design Software by PSMotion Ltd