Constrain a Design with Formulas and Equations
Expand All
Expand all collapsed sections.
Collapse All
Collapse all expanded sections.
ConceptProcedureQuick Reference
 
 
 

You can control geometry using mathematical expressions that include the names of dimensional constraints, user variables, and functions.

Formulas and equations can be represented either as expressions within dimensional constraints or by defining a user variables. For example, the following illustration represents a design that constrains a circle to the center of the rectangle with an area equal to that of the rectangle.

The Length and Width dimensional constraints are set to constants. The d1 and d2 constraints are simple expressions that reference the Length and Width. The Radius dimensional constraint is set to an expression that includes the square root function, parentheses to determine the precedence of operations, the Area user variable, the division operator, and the constant, PI. These parameters are all displayed in the Parameters Manager.

As you can see, part of the equation for determining the area of the circle is included in the Radius dimensional constraint and part was defined as a user variable. Alternatively, the entire expression, sqrt (Length * Width / PI), could have been assigned to the Radius dimensional constraint, defined in a user variable, or some other combination.

Work with the Parameters Manager

The Parameters Manager displays dimensional constraints (both dynamic constraints and annotational constraints), reference constraints, and user variables. You can easily create, modify, and delete parameters from the Parameters Manager.

The Parameters Manager supports the following operations:

NoteWith imperial units, the Parameters Manager interprets a minus or a dash (-) as a unit separator rather than a subtraction operation. To specify subtraction, include at least one space before or after the minus sign. For example, to subtract 9" from 5', enter 5' -9" rather than 5'-9".

Use Operators in Expressions

Dimensional constraints and user variables support the following operators within expressions:

OperatorDescription
+Addition

-

Subtraction or unary negation

%

Floating point modulo
*

Multiplication

/Division
^Exponentiation
( )Parenthesis, expression delimiter

.

Decimal separator

Understand Precedence in Expressions

Expressions are evaluated according to the following standard mathematical rules of precedence:

  1. Expressions in parentheses first, starting with the innermost set
  2. Operators in standard order: unary negation first, then exponents, multiplication and division, and addition and subtraction last
  3. Operators of equal precedence from left to right

Expressions are evaluated using the standard precedence as shown in the following table in descending order.

Functions Supported in Expressions

The following functions are available for use in expressions:

FunctionSyntax
Cosinecos(expression)
Sinesin(expression)
Tangenttan(expression)
Arc cosineacos(expression)
Arc sineasin(expression)
Arc tangentatan(expression)
Hyperbolic cosinecosh(expression)
Hyperbolic sinesinh(expression)
Hyperbolic tangenttanh(expression)
Arc hyperbolic cosineacosh(expression)
Arc hyperbolic sineasinh(expression)
Arc hyperbolic tangentatanh(expression)
Square rootsqrt(expression)
Signum function (-1,0,1)sign(expression)
Round to nearest integerround(expression)
Truncate decimaltrunc(expression)
Round downfloor(expression)
Round upceil(expression)
Absolute valueabs(expression)
Largest element in arraymax(expression1;expression2)
Smallest element in arraymin(expression1;expression2)
Degrees to radiansd2r(expression)
Radians to degreesr2d(expression)
Logarithm, base eln(expression)
Logarithm, base 10log(expression)
Exponent, base eexp(expression)
Exponent, base 10exp10(expression)
Power functionpow(expression1;expression2)
Random decimal, 0-1Random

In addition to these functions, the constants Pi and e are also available for use in expressions.