# 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
You can include any number of blank spaces in an expression function. You can include blank spaces to improve the readability of the function expression. The following are restrictions on using blanks:
• 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.

You must create a result before you can use it in an 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, FUNCTION = f1(f2(f3(f4))), where f1, f2, f3, f4 are function sub-expressions, is a syntactically legal function definition. However, FUNCTION = f1 (f2(... (f11 ) ...) is not a legal definition, since sub-expressions have been nested eleven levels deep. 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.

Provide feedback on this topic

* Required

 *Email: Subject: Feedback on Help Topics Page: Expressions and Functions for Forces and Motors *Comment: * I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

Never show this message again
x

Web Help Content Version: SOLIDWORKS 2013 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.