# How to configure PCE to understand MATLAB mathematical expression specified in constraints

## Technote (FAQ)

## Question

How do you evaluate a constraint containing MATLAB mathematical expression (such as laplace) using PCE (Parametric Constraints Evaluator) without having the error ""XYZ" contains unsupported functions {laplace}" shown on Constraint View window?

## Cause

PCE+MAXIMA can not recognize MATLAB mathematical expression such as laplace (numerical computation) and fft (symbolic computation). To be able to make these commands recognizable by PCE, you need to apply `«ExpressionForMATLAB»` stereotype on the constraint block.

## Answer

The PCE calls Computer Algebraic Systems (CAS) to solve equations for sets of attribute values, and monitoring the constraints you have defined. MAXIMA and MATLAB (and Symbolic Math Toolbox) are only CAS tools that are currently supported. You can configure PCE to operate in the following 3 manners:

- MAXIMA
- MAXIMA + MATLAB (base)
- MATLAB (base) + MATLAB Symbolic Math Toolbox (MSMT)

To be able to evaluate constraints containing fft or laplace, you should consider adopting either #2 or #3. With MAXIMA alone, such constraint will not be recognized. If you do not have MATLAB installed, a possible workaround would be to evaluate the unrecognized part of your expression using MAXIMA in advance, and replace the original expression with the evaluated result.

**<EXAMPLE>**

PCE cannot evaluate the following constraint:

`output = laplace(x, 100, 100)`

Hence, evaluate the laplace using MAXIMA in advance, and replace the part of your constraint by the evaluated result like below:

`output = x / 100 // laplace(x, 100, 100), note: we can use a comment`

**Notes:**

- Option #2 and #3 are only available to you if you have a MATLAB and/or MSMT installed.
- PCE will invoke MAXIMA/MATLAB as a back-end process and communicate with them to resolve equations.
- Using MATLAB, you can write causal expressions in the M language using constraint blocks stereotyped with
`«ExpressionForMatlab»`, although calculation generally takes longer than when MAXIMA is used alone. `<<ExpressionForMatlab>>`block can have only one constraint, but you can use multiple constraint properties. If your constraint block contains multiple constraints, you should separate it into multiple constraint blocks.

## Related information

Performing calculations with the Parametric Constraint

### Document information

**More support for:**
Rational Rhapsody

Documentation

**Software version:**
7.5, 7.5.0.1, 7.5.1, 7.5.1.1, 7.5.2, 7.5.2.1, 7.5.3, 7.5.3.1, 7.5.3.2, 7.5.3.3, 7.6, 7.6.0.1, 7.6.1, 7.6.1.1, 7.6.1.2, 7.6.1.3, 8.0, 8.0.1

**Operating system(s):**
Windows

**Reference #:**
1626430

**Modified date:**
31 March 2014