Importing Parameters from Excel®
1
As you can see, the model already contains some parameters in the table.
In order to illustrate the different import capabilities we will replace this list by a new one.
2
3
4
This opens the Excel Load dialog.
The workbook contains a list of parameters in the Parameters worksheet, which is shown in the figure to the right.
If you compare this list to the parameters defined in the model, you can see that the heat transfer coefficient is not included. The busbar width value is also different; 10 cm in the Excel file instead of 5 cm in the model.
5
In the Excel Load dialog, specify the sheet and cell range to use for the import. Enter Parameters in the Sheet text field, and enter A3 in the Range text field to import all parameters from the third row. Note that the range should not include the column headers.
6
To keep the existing parameters in a model unmodified by the import, you can clear the Overwrite checkbox in the Excel Load dialog before the import. In this case, imported parameters will be appended to the table and you will need to resolve any conflicts between similar parameter names yourself.
Note: COMSOL does not support multiple parameters with the same name. Only the first parameter definition, from the top, is kept in the table if multiple entries with the same name are present when you leave the Parameters node.
7
8
9
10
In the Excel Load dialog, specify the sheet and cell range to use for the import. Enter Parameters in the Sheet text field, and enter A2:C2 in the Range text field to import only the parameter at the second row (L, the length of the busbar).
Here we use a second parameters node only to show how you can link a specify group of parameters with a spreadsheet when running a model from within Excel. See the section Retrieving and Updating Model Parameters.
11