COMSOL with matlab

Please login with a confirmed email address before reporting spam

Is saving a .mph as .m and running that .m enough to run a comsol model in .m? But my .m keeps being busy with no result.

If one wants to open a higher version comsol with a lower version comsol, is it possible to save that .mph with a higher version comsol as .m and open that .m to run the model?


3 Replies Last Post Apr 30, 2024, 2:45 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 2 weeks ago Apr 15, 2024, 11:02 a.m. EDT
Updated: 2 weeks ago Apr 15, 2024, 11:02 a.m. EDT

Hello,

I'm not sure if this is a great answer but I have COMSOL with MATLAB package. This allows me to run COMSOL on matlab with ease. Have you tried using that package?

Hello, I'm not sure if this is a great answer but I have COMSOL with MATLAB package. This allows me to run COMSOL on matlab with ease. Have you tried using that package?

Please login with a confirmed email address before reporting spam

Posted: 1 week ago Apr 23, 2024, 4:13 a.m. EDT
Updated: 1 week ago Apr 23, 2024, 4:13 a.m. EDT

Hi yes I have installed that package but I failed to run any program. Is turning on COMSOL with MATLAB only sufficient?

Hi yes I have installed that package but I failed to run any program. Is turning on COMSOL with MATLAB only sufficient?

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 hours ago Apr 30, 2024, 2:45 a.m. EDT
Updated: 3 hours ago Apr 30, 2024, 8:41 a.m. EDT

Hi Carl Xu

When you save a Comsol model as an M-file all the steps that were carried out are reflected in that M-file. This means that if you solved the model while setting up the model then these calls to the solver are kept in the M-file. The reason is that sometimes a solution may depend on previous solved problems. This is often not what you want. On the File menu there is an item called "Compact History". It extracts the necessary statements that are required to give you an M-file that will give you a model at the state it is currently in, but without any solutions. After having called Compact History you can save an M-file that should be easy to run.

If you are new to LiveLink for Matlab I recommend reading the manual called "Introduction to LiveLink for Matlab"

-------------------
Lars Gregersen
Comsol Denmark
Hi Carl Xu When you save a Comsol model as an M-file all the steps that were carried out are reflected in that M-file. This means that if you solved the model while setting up the model then these calls to the solver are kept in the M-file. The reason is that sometimes a solution may depend on previous solved problems. This is often not what you want. On the File menu there is an item called "Compact History". It extracts the necessary statements that are required to give you an M-file that will give you a model at the state it is currently in, but without any solutions. After having called Compact History you can save an M-file that should be easy to run. If you are new to LiveLink for Matlab I recommend reading the manual called "Introduction to LiveLink for Matlab"

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.