Updating the Simulink System
Simulink systems that contain COMSOL Cosimulation blocks generated in a previous version needs to be updated. At the MATLAB prompt use the command mphupdatesystem as in the command below:
mphupdatesystem(<system>)
where <system> is the name of the Simulink system to be updated. This will update all the COMSOL Cosimulation FMU-file used in the system so that they can run with COMSOL Multiphysics 6.4, as well as all the COMSOL Cosimulation blocks. Moreover backup files for both Cosimulation file and Simulink system are saved with the suffix “versionUpdateBackup”.
In case the Simulink system contains subsystems with COMSOL Cosimulation blocks, these subsystems have to be updated separately.
If a previous backup already exists you can set the property overwritebackup to on as shown below:
mphupdatesystem(<system>, 'overwritebackup', 'on')
this will overwrite the current backup to the newly updated system.
To not save a backup set the property createbackup to off:
mphupdatesystem(<system>, 'createbackup', 'off')
If you want to run the updated system, you can open it Simulink directly after the update, to proceed set the property postupdateaction to open:
mphupdatesystem(<system>, 'postupdateaction', 'open')
Note that the system SLX-file is not saved.
mphupdatesystem automatically search through the COMSOL installation directory for the COMSOL Cosimulation block library path. If needed you can specify it manually:
mphupdatesystem(<system>, 'librarypath', <path>)
A correct library path should point to the file comsol<ver>lib.slx, with <ver> the COMSOL version number.
To revert the Simulink system using an older COMSOL version, set the property version with desired version number:
mphupdatesystem(<system>, 'updateversion', <ver>)
where <ver> is the version number.
You can also specify to update the COMSOL Cosimulation block and/or the COMSOL Cosimulation FMU-file using the properties updateblock and/or updatefmu, respectively. Both are updated by default.