# Expressions and Functions for Forces and Motors

You can use mathematical expressions to define forces or motor action in a Motion Analysis study.

To create an expression:

Select Expression in the Force or Motor PropertyManager.

You can use only supported functions when you compose mathematical expressions for motors or forces.

## Expression Function Basics

An expression function is a C-like or FORTRAN-like expression that returns a single value. You can use any valid combination of simple constants, operators, results (for example velocity, acceleration, power, or force plots), and available supported functions to compose expressions.

## Constants

You can include only integers and real numbers in expressions. Complex numbers are not supported.## Operators

SOLIDWORKS Motion includes arithmetic operators with precedence as follows.Symbol | Operation | Precedence |
---|---|---|

** | Exponentiation | 1 |

/ | Division | 2 |

* | Multiplication | 3 |

+/- | Addition/Subtraction | 4 |

- You cannot put a blank space in the middle of a number.
- You cannot put a blank space between a function and its left bracket.

## SOLIDWORKS Motion Results

Many of the functions supported can also use SOLIDWORKS Motion results as variables.

If you are using a function that allows the use of a SOLIDWORKS Motion result as an argument, double-click a result from the list to enter it in the expression.

## Limitations

There are some limitations in the definition of functions:

Nesting of functions |
You can nest functions, sub-expressions, or operations for up to ten levels. For example, |

Limitations on number of symbols in a function expression |
Do not use more than 1,000 symbols in an expression. This includes operators, brackets, functions, and numbers. |

Limitations on number of elements to which a function can refer |
Do not define a function that depends on more than 25 standard elements of each type. All expressions you create must depend on at most 25 parts, 25 forces, and so on. |

**Parent topic**Defining Profiles from Mathematical Expressions