User defined functions
In the "Expression" block a user defined function can be defined. This block is for simple algebraic equations and is faster than the Cscript block.
Depending on the number of inputs to the block, the inputs are available as a, b, c, d, ....
Use can be made of + - / * ( )
Although supported in the block "Expression", the ^ operator can be used for raising power. However it is recommended not to use the ^ operator, since it is not supported in the ANSI-C language.
To model, for example:
![[Click to view larger image] <br>Click to close the image](503.gif)
use the following equation:
(d-c)/(b-a) |
with following inputs:
![[Click to view larger image] <br>Click to close the image](505.gif)
and define it at the edit field text:
![[Click to view larger image] <br>Click to close the image](504.gif)
Always use enough brackets to structure your equations.
The user defiend function is easily inserted in your block diagram and the following example shows the comparising between
Yellow trace = a^2 |
![[Click to view larger image] <br>Click to close the image](power.gif)