Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

COMSOL to SIMULINK

Anne-Maude Bazin
Hello,

I know that it is possible to export a model form Comsol to Simulink, but I would like to know if it is possible after to work on this simulink model without any connection Matlab/Comsol ? (For example with a computer where Comsol is not installed)
And if it is possible, what do I have to do? Because it seems that when Matlab is not connected to Comsol, some functions are not recognized.

Thank you,
sincerely,
AM B

2 Replies Last Post Apr 26, 2010, 4:53 AM EDT
Posted: 7 years ago Apr 22, 2010, 7:57 AM EDT
Hi

from my understanding, but have tried only a long time ago, you must export the matrices or the transfer function from comsol to matlab (or in simulink format), and then you can save these as matlab "mat" data files and continue further analysis on a separate matlab run on another PC.

But there is, in my understanding, no way to "run" Comsol matlab commands without Comsol, and that requires all programmes installed on the same PC

Good lcuk
Ivar
Hi from my understanding, but have tried only a long time ago, you must export the matrices or the transfer function from comsol to matlab (or in simulink format), and then you can save these as matlab "mat" data files and continue further analysis on a separate matlab run on another PC. But there is, in my understanding, no way to "run" Comsol matlab commands without Comsol, and that requires all programmes installed on the same PC Good lcuk Ivar

Antti Pohjoranta
Posted: 7 years ago Apr 26, 2010, 4:53 AM EDT

Hi,

I've been working with this lately and to my knowledge, you can export your COMSOL model in two ways: 1) as a Simulink-compatible model object and then use it in your Simulink model as a regular Simulink block
2) as a state-space formatted model structure

I don't know too much about option 2) - I guess it's the process of exporting the state-space matrices of a linearized COMSOL model and using these in Simulink takes place through a state-space Simulink block.

Option 1), however, can be executed in several ways, of which at least the ones that require for the COMSOL solver to be called during the Simulink model run always require for COMSOL to be there too. (These are the dynamic export solutions.) Generally I believer, however, that you always need a COMSOL system to be included in the environment where you run the models that include a part created with COMSOL, for licensing to work if for no other reason. Years ago I tried exporting "stand-alone" COMSOL-MATLAB models, but didn't have any markable success as COMSOL (then FEMLAB) was always required (naturally, to solve the models).

So, to answer the original question, whether or not you need COMSOL there to work on your Simulink model, I think it might depend on how you carry out the model exportation, but my guess would be 'yes you need COMSOL always'.

Hth,
Antti
Hi, I've been working with this lately and to my knowledge, you can export your COMSOL model in two ways: 1) as a Simulink-compatible model object and then use it in your Simulink model as a regular Simulink block 2) as a state-space formatted model structure I don't know too much about option 2) - I guess it's the process of exporting the state-space matrices of a linearized COMSOL model and using these in Simulink takes place through a state-space Simulink block. Option 1), however, can be executed in several ways, of which at least the ones that require for the COMSOL solver to be called during the Simulink model run always require for COMSOL to be there too. (These are the dynamic export solutions.) Generally I believer, however, that you always need a COMSOL system to be included in the environment where you run the models that include a part created with COMSOL, for licensing to work if for no other reason. Years ago I tried exporting "stand-alone" COMSOL-MATLAB models, but didn't have any markable success as COMSOL (then FEMLAB) was always required (naturally, to solve the models). So, to answer the original question, whether or not you need COMSOL there to work on your Simulink model, I think it might depend on how you carry out the model exportation, but my guess would be 'yes you need COMSOL always'. Hth, Antti

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.