Functions
You can add a Function to a feature, property, or component. The function names follow the same rules as variables; see Entering Names. You usually have to use a feature scope for any function defined by a feature; otherwise, you get a duplicate definition if you have more than one feature of that type. Apart from the name syntax, defining a function works in exactly the same way as in the Model Builder.
The following functions are available: Analytic, Gaussian Pulse, Image, Interpolation, Piecewise, Ramp, Random, Rectangle, Step, Triangle, Waveform, and Tensor-Valued Function.
To add one of the available functions:
1
Under the Building Blocks branch click Components.
2
In the Home toolbar, from the Building Blocks group, click Component ().
3
Right-click the Component node and choose a function from the Functions submenu.
In the function node’s Settings windows (except for Tensor-Valued Function), the Show in plot menu checkbox is selected by default. Clear that checkbox to remove the operator from the plot menus in results and probe features.
Special Settings for Interpolation
In the settings for the Interpolation function, you can choose User input from the Data source list (in addition to File and Local table). By using the User input definition, the defined interpolation will read the data from the user inputs for both function and argument data. Enter an expression for the function, such as par.time, in the Function expression field and expressions for one or more arguments, such as par.T, in the Arguments expression list.
User-Defined Functions in the COMSOL Multiphysics Reference Manual