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

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 28 janv. 2020, 17:16 UTC+1

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 22 janv. 2020, 07:56 UTC+1

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

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 24 janv. 2020, 14:32 UTC+1

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: 4 years ago 27 janv. 2020, 12:33 UTC+1

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

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 28 janv. 2020, 12:07 UTC+1

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: 4 years ago 28 janv. 2020, 15:37 UTC+1

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

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 28 janv. 2020, 16:32 UTC+1

Thanks Lars

Thanks Lars

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 28 janv. 2020, 17:16 UTC+1

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.