Retrieving and Updating Model Parameters
Extract selected parameters from the model that you have just opened to a worksheet.
1
2
This imports all the model parameters to the worksheet and creates a direct link to the Parameters nodes in the COMSOL model.
The link between the cell range in the worksheet and the COMSOL model is represented by the comment in the cell A4.
In this example we only need to access the parameter L (the length of the busbar) that is defined in the node Parameters 2.
3
4
Note: You can retrieve parameters to several locations in a worksheet or workbook. Each time you extract model parameters, a link is created for that cell range, so that you can update the model with the selected parameter list.
You can modify the parameters in the worksheet, for example by changing their expression or description. You can also add new parameters to the list. Any change to the list is transferred to the COMSOL model during the update operation, which is by default done automatically.
You will now change the value of the L parameter to 5 cm:
5
In cell B6 enter 5, the parameter L is then automatically updated to 5 in COMSOL Multiphysics.
Note: If you prefer a manual parameter update, go to the COMSOL preferences in the Backstage view and clear Automatic update checkbox. Then you can use the update button to update the Parameters node linked to the selected cell by the comment. You can update several model definitions, such as parameters, variables, and functions, contained in the same worksheet with the Update All button located under Update. When several Parameter table are available in the worksheet, click Update Multiple , located under Update, to select which parameter to update with the other model definitions.
To visualize the change in the model geometry due to the edited length parameter, you can display the updated geometry:
6
The graphics window should now display the geometry as shown in the figure below:
7
You will now set the value of parameter L back to 9 cm, in cell B6 enter 9 and press Enter. The graphics is not automatically updated so to display the newly generated geometry, select again the Geometry > Geometry 1.