The arithmetic IF function assigns the conditions for calculating functions and returns the value for those functions when the given conditions are satisfied.
Format
Arguments definition
f1 |
Defines the equation that provides the conditions under which to derive the value of the function. |
f2 |
Returns the calculated values when f1 < -IFT. This must be a real number or a function that returns a real number. |
f3 |
Returns the calculated values when IFT ≥ f1 ≥ -IFT. This must be a real number or a function that returns a real number. |
f4 |
Returns the calculated values when f1 > IFT. This must be a real number or a function that returns a real number. |
• IFT (If Tolerance): When an If clause is calculated, the IFT value functions as a parameter that modifies the conditions so that they respond to 0 by allowing a slight range because the result of Expression1 may not be exactly 0. The input values for these parameters can be found on the Home tab of the Simulation menu in the RecurDyn GUI.
Figure 1 Simulation dialog box
Formulation
Example
The following example conditionally defines the different values according to the value of the time.
IF(TIME-2.0:-1.0, 0.0, 1.0)
• Expression1 = TIME - 2.0
• Expression2 = -1.0
• Expression3 = 0
• Expression4 = 1.0
• TIME < (2.0 - IF Tolerance) Result: IF = -1.0
• TIME >= (2.0 - IF Tolerance) and TIME <= (2.0 + IF Tolerance) Result: IF = 0.0
• TIME > (2.0 + IF Tolerance) Result: IF = 1.0
Figure 1 Example result using the IF function