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.
Livelink for Matlab error - Comsol crashes and closes
Posted 15.01.2020, 15:27 GMT-5 Plasma Physics, LiveLink for MATLAB, COMSOL Server Version 5.4 7 Replies
Please login with a confirmed email address before reporting spam
Hello,
I am using Comsol 5.4 and Matlab R2019b in Linux Centos.
I can open Livelink with Matlab using
comsol mphserver matlab
When in Matlab, when I use
mpilaunch
Comsol opens for a few seconds, then closes.
When I use
mphopen busbar
The program opens but the changes do not change on the Comsol version, ie. if I change L=18cm the Matlab model shows this lenght but the Comsol model does not.
Any help would be much appreciated?
Please login with a confirmed email address before reporting spam
You should first use 'mphopen' to load the 'busbar' model, then use 'mphlaunch' to open the Comsol. Or follow your step, you need to import the application to server in the Comsol again (see Comsol Multiphysics server), and then you can use the APP syntax ''model.param().set('L', value)' to change the setting.
All the best, Songcai
Please login with a confirmed email address before reporting spam
thanks Songcai, it still crashes. I think it might be that I'm on a linux box? It's nearly there but comsol and matlab not talking to each properly!
Please login with a confirmed email address before reporting spam
Hi Sinéad
We don't test all Linux distributions so I can't tell if yours has a special problem. Upgrading to Comsol 5.5 may help.
Ways to circumvent your problem:
Instead of using mphlaunch you can do:
1) Start Comsol client using the command "comsol client" 2) Connect to the Comsol Multiphysics Server 3) When the GUI opens load the model from the server (File->COMSOL Multiphysics Server->Import Application from server
Your problem regarding mphopen is caused by this: Comsol Multiphysics Server is able to load more than one model at a time. The Comsol GUI is only able to have one model open at a time. When you have the same model open in Matlab and in the Comsol GUI at the same time you can open another model in Matlab (but the previously loaded model stays open in the Comsol GUI). Hence, when you change a parameter in the model you've just loaded it is not shown in the Comsol GUI because the two models are different.
You can read more about this in the LiveLink for Matlab User's Guide in the section titled "Managing The Comsol Model Object".
-------------------Lars Gregersen
Comsol Denmark
Please login with a confirmed email address before reporting spam
Thanks Lars, I do not have Comsol Server. Is this an extra module or can I download it?
Thanks Sinéad
Please login with a confirmed email address before reporting spam
Comsol Server is not the same as Comsol Multiphysics Server: https://www.comsol.com/comsol-server
In your first post you write
comsol mphserver matlab
so you do have Comsol Multiphysics Server, which is the one you should use (as a step zero in the procedure above before starting the Comsol GUI).
-------------------Lars Gregersen
Comsol Denmark
Please login with a confirmed email address before reporting spam
Thanks Lars
Please login with a confirmed email address before reporting spam
This works, when I change the length of the busbar in matlab it shows in comsol also.
Thanks so much,
Sinéad
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.
Suggested Content
- KNOWLEDGE BASE COMSOL Does Not Start with the Latest MATLAB Version
- KNOWLEDGE BASE Error: Failure Loading MATLAB Libraries. This model requires that MATLAB is available.
- FORUM Comsol crashes
- BLOG Best Practice for Working with Model M-Files
- KNOWLEDGE BASE COMSOL Troubleshooting Guide
