•
|
If Local table is selected, enter a Function name and enter coordinates t and function values f(t) into the table cells. A function of one variable can be defined in this way. For functions of two or more variables, such as space-dependent data in 2D and 3D, use a file with the function data. The default Function name is int1. You can move rows up and down in the table, remove a row from the table, and clear the table using the buttons underneath the table.
|
-
|
Optional: Save the parameters to a text file to reuse in other models. Click the Save to File button () and enter a File name, including the extension .txt. Click to Save the text file. The information is saved in space-separated columns in the same order as displayed on screen.
|
-
|
Optional: Import or Load data from a spreadsheet program or other format by saving the file with a .txt extension. Data must be separated by tabs or colons. Click the Load from File button () and navigate to the text (.txt) file to load and click Open. If the license includes LiveLink™ for Excel® you can also load interpolation data from a Microsoft Excel Workbook spreadsheet. The data loads to the table. If there is other data already in the table, it adds it after the last row. Move or edit as needed.
|
•
|
If File is selected to import interpolation data from a file, select a Data format: Spreadsheet, Grid, or Sectionwise. If the license includes LiveLink™ for Excel®, you can also import interpolation data from a Microsoft® Excel Workbook spreadsheet. COMSOL Multiphysics then uses the spreadsheet format and the Data format list is not available.
|
-
|
When the data format is specified, enter the complete network path and name of the interpolation data file in the Filename field, or click Browse to select a text or data file with interpolation data in the Interpolation Data dialog box. Then click Import to import the interpolation data into the model; otherwise COMSOL Multiphysics references the interpolation data on your file system. When you have imported the interpolation data, the Parameters section, under Data imported into model, contains information about the filename, data type, and dimension for the data. Click Export to save the interpolation data to a file and reference from there instead of including it in the model. Click the Discard button to delete the imported interpolation data from the model. Click the Refresh button to reread the file.
|
-
|
From the Data format list select Spreadsheet, Grid, or Sectionwise. The spreadsheet format is the default format, and that format is the easiest to use for functions defined on an unstructured grid or for general tabulated function values with one or more arguments.
|
•
|
If Result table is selected, interpolation data evaluated or imported into a table under Results>Tables or belonging to an Evaluation Group under Results is treated in the same way as a file using the spreadsheet format.
|
1
|
2
|
3
|
4
|
5
|
6
|
Enter its Position in file as 1. The first function in the file has position 1, the following has position 2, and so on. The position in file for a function is the column after the spatial coordinates (or other function arguments) where it is defined. In this example with two arguments (spatial coordinates), the third column is Position 1 in the file.
|
7
|
If desired, adjust the interpolation and extrapolation settings in the Interpolation and Extrapolation section (see below).
|
It is important to use a comment line starting with % to separate the grid points or other interpolation points and the data values that are associated with these coordinates or interpolation points.
|
•
|
For functions of one variable select Nearest neighbor, Linear (the default interpolation method), Piecewise cubic, or Cubic spline.
|
-
|
Nearest neighbor interpolation selects the value of the nearest point where the function is defined.
|
-
|
Linear interpolation uses a linear polynomial to interpolate the function between the points where it is defined.
|
-
|
Piecewise cubic interpolation uses a piecewise-cubic Hermite polynomial with continuous first derivatives. It preserves the shape of the data and respects monotonicity.
|
-
|
The Cubic spline method also performs interpolation with a piecewise cubic polynomial. Here, even second derivatives are continuous; however, the method does not necessarily respect monotonicity.
|
•
|
For functions of more than one variable, select Nearest neighbor or Linear. The other options are not supported.
|
•
|
Constant. Uses the value from the closest point inside the grid (for structured interpolation) or the value from the closest mesh element (for unstructured interpolation). The function evaluates the polynomial from the closest grid point at the actual point where a value is requested. This is the default extrapolation method.
|
•
|
Linear. The function is linear outside the grid with a continuous function value and continuous first derivative at the boundary of the grid. Piecewise cubic or Cubic spline must be selected from the Interpolation list.
|
•
|
Nearest function. Evaluates the polynomial from the closest grid point at the actual point where a value is requested.
|
•
|
Specific value. Uses a single value, such as zero or NaN (Not-a-Number), everywhere outside the grid or mesh. Enter the value in the Values outside range field.
|
|