Preferences
To change the settings related to the cosimulation open the Settings — LiveLink for Simulink window by running the command mphsimsettings in the MATLAB command window.
The sections below describe the available settings. To accept any changes to the settings and close the window, click the OK button. Click Cancel to close the window and discard any changes that you have made since opening it.
Model Search Paths
A number of path definitions can be added to the list of search paths such that COMSOL can find the COMSOL model that is referenced in the cosimulation file.
When the simulation is performed, Simulink does not notify COMSOL where the cosimulation file is placed. Hence some bookkeeping has to be performed in order to keep track of locations.
If the COMSOL model file (MPH) is placed in the same directory as the cosimulation file, COMSOL will be able to find the COMSOL model file automatically. This is the recommended procedure. Every time a simulation is set up, the path of the model file is added to the Model search path list such that COMSOL can find the file.
This list can become very long and it may be important to remove the paths that are not required anymore. Use the Remove button to remove any unwanted paths from the list.
If it is not possible to place the model file in the same location as the cosimulation file, the path of the model file must be added to the Model search path list manually. You can do this by clicking the Add button and selecting the desired folder.
The search order is important in case there are models with the same filename. The path that is higher up in the list will be used for the cosimulation. Use the buttons Move Up and Move Down to reorder the paths in the list. It is recommended to avoid saving models with identical filenames to different locations. If this is not possible, then, in the Model search path list, keep only the path of the model to run in the cosimulation.
Show The progress bar while solving
In order to verify that the simulation is progressing as planned, you can display the COMSOL progress bar when performing the cosimulation. To do this, select the Show progress bar while solving checkbox. The COMSOL progress bar will display the progress of the various steps of the solver, and you can see in case there are any problems during the solution process.
In the event that COMSOL gets stuck during a time step, you can also cancel the COMSOL simulation from the progress bar.
Load model every time before solving
After a simulation is run the model is reset to its original state that corresponds to the state when it was first loaded. In the event that a model is using features that cannot reliably be set back to their original state, select the Load model every time before solving checkbox. With this setting the model is loaded every time the simulation starts.
To avoid loading time for every simulation run, especially with large models, you can clear this checkbox. If you edit the loaded model between simulation runs but do not want to save the modified model in file then you need to clear this checkbox to avoid that the changes in memory are overwritten by reloading the model file. It is recommended that changed models are saved to avoid losing any model settings.