The MAX function returns the maximum of two expressions a1 and a2.
MAX(a1,a2) = a1 if a1 > a2
MAX(a1,a2) = a2 if a2 > a1
Format
MAX(a1,a2)
Arguments
a1 | Any valid function expression. |
a2 | Any valid function expression. |
Caution: | The MAX function is generally discontinuous. Use this function expression with care when you are specifying force or motion input. |
Examples
SFORCE/1, ROTATIONAL, ACTIONONLY, I=21, J=11
, FUNCTION=MAX(0,-3*(AZ(21,11)-25D))
This SFORCE statement defines an action-only torque that acts at Marker 21 and acts along the z-axis of Marker 11. The torque is defined to always be non-negative through the use of the MAX function. Thus, the torque can only act to decrease the AZ rotation of Marker 21 with respect to Marker 11 (see
AZ).