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

Sinéad Mannion Plasma Physics

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?


7 Replies Last Post 2020年1月28日 GMT-5 11:16

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年1月22日 GMT-5 01:56

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

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

Sinéad Mannion Plasma Physics

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年1月24日 GMT-5 08:32

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!

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!

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年1月27日 GMT-5 06:33

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
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".

Sinéad Mannion Plasma Physics

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年1月28日 GMT-5 06:07

Thanks Lars, I do not have Comsol Server. Is this an extra module or can I download it?

Thanks Sinéad

Thanks Lars, I do not have Comsol Server. Is this an extra module or can I download it? Thanks Sinéad

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年1月28日 GMT-5 09:37

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
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).

Sinéad Mannion Plasma Physics

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年1月28日 GMT-5 10:32

Thanks Lars

Thanks Lars

Sinéad Mannion Plasma Physics

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年1月28日 GMT-5 11:16

This works, when I change the length of the busbar in matlab it shows in comsol also.

Thanks so much,

Sinéad

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.