Editing the Model in the COMSOL Desktop
After you did run the simulation in Simulink, you can edit the model loaded in the COMSOL Multiphysics server for the simulation.
At the MATLAB prompt use the command
mphlaunch
. This command launches COMSOL Multiphysics, connects it to the COMSOL Multiphysics server that is used for the cosimulation, and loads the model into the user interface.
Loading a model from the COMSOL Multiphysics server is only supported with Simulink diagram that contains a single cosimulation block.
At this point, all postprocessing features available in COMSOL can be used to analyze the model. This is especially useful for verification of the simulation results in cases where accessing the inputs and outputs in Simulink is not sufficient for understanding the model’s dynamics.
When opening COMSOL Multiphysics this way, the model becomes locked by the COMSOL user interface. Hence, before running another cosimulation in Simulink, you need to shut down the COMSOL user interface.
With the default cosimulation preference settings, the modification of a model loaded from the COMSOL Multiphysics server are not updated in the simulation unless you have saved the updated model in file. See
Preferences
to change the cosimulation preferences.