Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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 with MATLAB Error

Please login with a confirmed email address before reporting spam

Hi,

Bit of a boring generic question I'm afraid but if anyone has come across this error any help would be appreciated.

I've been trying to get the COMSOL with MATLAB livelink working and after some trials managed to get the shortcut to finally appear :). however I can't seem to get it to work as i keep getting an error:

com.comsol.util.exceptions.FlException: Unable to get the user manager
Messages:
Unable to get the user manager

I think it could be a path problem as it was a problem before hand with having MATLAB installed on the D:\.

However when i run D;\COMSOL40\Bin\win32\comsol matlab

I can get it to load up both however fail to actually get it to run any of my models as I get an error:

Exception:
com.comsol.util.exceptions.FlException: Launching COMSOL Server automatically is currently not supported
Messages:
Launching COMSOL Server automatically is currently not supported


Stack trace:

at com.comsol.model.clientserver.ClientManagerImpl.launchServer(Unknown Source)

at com.comsol.model.util.ModelManager.create(Unknown Source)

at com.comsol.model.util.ModelUtil.create(Unknown Source)

another possible path problem?

any help is appreciated.

Kind Regards MF

22 Replies Last Post 1 nov 2011, 04:57 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28 mag 2010, 01:11 GMT-4
Hi not evident to tell

but have you checked/studied the installation guide of comsol, ensured that your comsol.ini files have the correct matlab path, and there are a few ways to launch matlab an comsol, try them out.

Finally there is also the version compatibility between matlab and COMSOL. Pls check also the forum (do a search) and the knowledge base

Hope this helps
Ivar
Hi not evident to tell but have you checked/studied the installation guide of comsol, ensured that your comsol.ini files have the correct matlab path, and there are a few ways to launch matlab an comsol, try them out. Finally there is also the version compatibility between matlab and COMSOL. Pls check also the forum (do a search) and the knowledge base Hope this helps Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2 giu 2010, 12:00 GMT-4
Hi Micheal,
Just in case you haven't solved this yet, maybe this will help:

I just installed v4 with Matlab R2010a and was getting the same error. After fiddling with a bunch of stuff, I ended up running comsolserver (no space) which prompted me for a username/password which I made up and entered. After I exited this program (typed 'close'), I then tried the 'COMSOL with MATLAB' star menu shortcut again and everything worked fine. Not sure what I accomplished, but hey, solved my problem.

FYI, I installed on a Linux Machine (Ubuntu 10.4) and Windows (Vista SP2) and had the same problem on each. The above fixed both instances.
Hi Micheal, Just in case you haven't solved this yet, maybe this will help: I just installed v4 with Matlab R2010a and was getting the same error. After fiddling with a bunch of stuff, I ended up running comsolserver (no space) which prompted me for a username/password which I made up and entered. After I exited this program (typed 'close'), I then tried the 'COMSOL with MATLAB' star menu shortcut again and everything worked fine. Not sure what I accomplished, but hey, solved my problem. FYI, I installed on a Linux Machine (Ubuntu 10.4) and Windows (Vista SP2) and had the same problem on each. The above fixed both instances.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2 giu 2010, 14:24 GMT-4
I contacted a COMSOL rep about this issue today. It looks like Kyle is on the right track:

www.comsol.com/support/knowledgebase/1071/

I contacted a COMSOL rep about this issue today. It looks like Kyle is on the right track: http://www.comsol.com/support/knowledgebase/1071/

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13 giu 2010, 11:16 GMT-4
hi,
I'm also trying to livelink comsol and matlab, and got the same errors.
however, after I changed the path in the shortcut and entered a username and password, it started matlab alone, without comsol.
I closed matlab and used the shortcut, and again it opened only matlab, without asking for a username.

does anybody know what I'm supposed to do?

thank you,
yael.
hi, I'm also trying to livelink comsol and matlab, and got the same errors. however, after I changed the path in the shortcut and entered a username and password, it started matlab alone, without comsol. I closed matlab and used the shortcut, and again it opened only matlab, without asking for a username. does anybody know what I'm supposed to do? thank you, yael.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 01:26 GMT-4
Hi

as it is stated in the doc, you should ONCE first launch the server alone and provide your username password, then you can launch comsol server and matlab. hey link via a localhost tcpip link and the server needs to log in, via its console. It must be done "by hand", at least once, then normally matlab starts OK, provided that the matlab path is correclty entered in the ini files. This operation might be required after a new patch update too I believe

have fun Comsoling
Ivar
Hi as it is stated in the doc, you should ONCE first launch the server alone and provide your username password, then you can launch comsol server and matlab. hey link via a localhost tcpip link and the server needs to log in, via its console. It must be done "by hand", at least once, then normally matlab starts OK, provided that the matlab path is correclty entered in the ini files. This operation might be required after a new patch update too I believe have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 05:10 GMT-4
thank you for your response,
but as I said, when I launch "comsol 4.0 with matlab" only matlab starts, and comsol does not.
have you encountered this problem before?

yael.
thank you for your response, but as I said, when I launch "comsol 4.0 with matlab" only matlab starts, and comsol does not. have you encountered this problem before? yael.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 07:15 GMT-4
Yael,
The "Comsol 4.0 with Matlab" function is meant to only start Matlab with Comsol functionality. All the functions needed to create/run/analyze models and simulations are loaded into this instance of Matlab. A Comsol window will not open with this command. This is different than with Comsol <4 where a Comsol window would be opened.
-Kyle
Yael, The "Comsol 4.0 with Matlab" function is meant to only start Matlab with Comsol functionality. All the functions needed to create/run/analyze models and simulations are loaded into this instance of Matlab. A Comsol window will not open with this command. This is different than with Comsol

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 07:35 GMT-4

I contacted a COMSOL rep about this issue today. It looks like Kyle is on the right track:

www.comsol.com/support/knowledgebase/1071/


I have tried using the KB suggestion, changing comsol.exe to comsolserver.exe. I did get a DOS prompt asking me to create a user/pw. Having done so nothing happened. Subsequent attempts to launch Comsol with Matlab yields a DOS window saying "COMSOL 4.0 started listening on port 2036", however nothing else happens.

Comsol.ini inside the Comsol install dir reads the correct location of the Matlab folder. I am using Matlab R2008b, Comsol 4.0 version 935 (patched), Windows XP 64 bit.

/Samuel
[QUOTE] I contacted a COMSOL rep about this issue today. It looks like Kyle is on the right track: http://www.comsol.com/support/knowledgebase/1071/ [/QUOTE] I have tried using the KB suggestion, changing comsol.exe to comsolserver.exe. I did get a DOS prompt asking me to create a user/pw. Having done so nothing happened. Subsequent attempts to launch Comsol with Matlab yields a DOS window saying "COMSOL 4.0 started listening on port 2036", however nothing else happens. Comsol.ini inside the Comsol install dir reads the correct location of the Matlab folder. I am using Matlab R2008b, Comsol 4.0 version 935 (patched), Windows XP 64 bit. /Samuel

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 07:45 GMT-4

I am using Matlab R2008b, Comsol 4.0 version 935 (patched), Windows XP 64 bit.

/Samuel


Samuel,
Your problem may be that R2008b is not supported by Comsol 4.0, looks like only R2009b and R2010a are supported.

www.comsol.com/products/requirements/windows/
[QUOTE] I am using Matlab R2008b, Comsol 4.0 version 935 (patched), Windows XP 64 bit. /Samuel [/QUOTE] Samuel, Your problem may be that R2008b is not supported by Comsol 4.0, looks like only R2009b and R2010a are supported. http://www.comsol.com/products/requirements/windows/

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 08:15 GMT-4
Hi Kyle,
Thank you for the suggestion, however, having installed Matlab R2010a, the Comsol/Matlab interface still hangs at the same step as previously reported...

/Samuel
Hi Kyle, Thank you for the suggestion, however, having installed Matlab R2010a, the Comsol/Matlab interface still hangs at the same step as previously reported... /Samuel

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 08:20 GMT-4
Hi Michael,

I also have the problem that I miss the COMSOL and MATLAB shortcut.
How did you get it to appear?

Regards, Sabine
Hi Michael, I also have the problem that I miss the COMSOL and MATLAB shortcut. How did you get it to appear? Regards, Sabine

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 08:37 GMT-4
Hy,

I've got following information from support.:
"COMSOL with MATLAB in version 4.0 does no longer start a COMSOL GUI by typing "comsol" in the MATLAB prompt. "
See documentation: LiveLink™ for
MATLAB User's Guide. --> Getting started. (llmatlab_ug.pdf).

Roland Martin
Hy, I've got following information from support.: "COMSOL with MATLAB in version 4.0 does no longer start a COMSOL GUI by typing "comsol" in the MATLAB prompt. " See documentation: LiveLink™ for MATLAB User's Guide. --> Getting started. (llmatlab_ug.pdf). Roland Martin

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 giu 2010, 11:23 GMT-4
first of all, thank you all very much for your help!

kyle, you're saying that comsol is not supposed to start at all?
I'm solving (or trying to solve) a heat transfer problem, with one of the material's properties calculated from a matlab function.
when I worked with COMSOL 3.5a, it started the two softwares simultaneously, and all I had to do is to insert the matlab function name to the property field and it worked, with no need to work with matlab myself during the run.
can't I do the same with COMSOL 4.0?
I saw that I can insert a matlab function to comsol, but it just doesn't recognize it when I start COMSOL normally, obviously.

thanks,
yael.
first of all, thank you all very much for your help! kyle, you're saying that comsol is not supposed to start at all? I'm solving (or trying to solve) a heat transfer problem, with one of the material's properties calculated from a matlab function. when I worked with COMSOL 3.5a, it started the two softwares simultaneously, and all I had to do is to insert the matlab function name to the property field and it worked, with no need to work with matlab myself during the run. can't I do the same with COMSOL 4.0? I saw that I can insert a matlab function to comsol, but it just doesn't recognize it when I start COMSOL normally, obviously. thanks, yael.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15 giu 2010, 02:50 GMT-4
Hi Roland,

I'm fine with COMSOL not starting, however, I would like Matlab to do so - staring at a DOS window seems an unprofitable waste of time:)

/Samuel
Hi Roland, I'm fine with COMSOL not starting, however, I would like Matlab to do so - staring at a DOS window seems an unprofitable waste of time:) /Samuel

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11 set 2010, 07:29 GMT-4
Hi Kyle Wilt,
Thanks so much for your advice.
Hi Kyle Wilt, Thanks so much for your advice.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11 set 2010, 07:38 GMT-4
Hi

have you checked the new "external function import" in V4.
You can define an external functions in the Global Definitions sub nodes.
I havent had time to test it yet but I would appreciate to hear how well it works ;)

--
Good luck
Ivar
Hi have you checked the new "external function import" in V4. You can define an external functions in the Global Definitions sub nodes. I havent had time to test it yet but I would appreciate to hear how well it works ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 dic 2010, 03:30 GMT-5
Hello Sabine,

I do have the same problem with finding the comsol with matlab shortcut. And I am also very interested in how Micheal did solve the problem.
I got matlab 2009b installed and I have the matlab livelink included in comsol 4.0a, but there is no shortcut in the windows startmenu.
Then I tried to create a shortcut myself which executes following command: comsolserver.exe matlab.
A window opened and I typed in a username and password. Afterwards nothing happens... normally matlab should start, right? In the comsol.ini I couldn´t find an entry, which defines the patch to matlab. Maybe Ivar knows how to set the path correctly???

best regards
Oliver
Hello Sabine, I do have the same problem with finding the comsol with matlab shortcut. And I am also very interested in how Micheal did solve the problem. I got matlab 2009b installed and I have the matlab livelink included in comsol 4.0a, but there is no shortcut in the windows startmenu. Then I tried to create a shortcut myself which executes following command: comsolserver.exe matlab. A window opened and I typed in a username and password. Afterwards nothing happens... normally matlab should start, right? In the comsol.ini I couldn´t find an entry, which defines the patch to matlab. Maybe Ivar knows how to set the path correctly??? best regards Oliver

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 dic 2010, 07:24 GMT-5
Hi

check also the KB (knowledge base) of COMSOL on their main site, there are several instructios regarding matlab link issues

--
Good luck
Ivar
Hi check also the KB (knowledge base) of COMSOL on their main site, there are several instructios regarding matlab link issues -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15 set 2011, 12:51 GMT-4
Not sure if this is still related to this problem but,

I have on occassion got erros which contain the 'Unkown Source' text, though I am not 100% sure I beleive on some occassions it is simply a license issue. When this occurs I often remote desktop through to my university computer and I think Comsol supports local 'Mouse Click' operations but not remote desktop ones for certain licenses.

I could be wrong, but when do similar things directly, using a mouse Comsol has no problem, only when I remote desktop.

Regards Mike F
Not sure if this is still related to this problem but, I have on occassion got erros which contain the 'Unkown Source' text, though I am not 100% sure I beleive on some occassions it is simply a license issue. When this occurs I often remote desktop through to my university computer and I think Comsol supports local 'Mouse Click' operations but not remote desktop ones for certain licenses. I could be wrong, but when do similar things directly, using a mouse Comsol has no problem, only when I remote desktop. Regards Mike F

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 1 nov 2011, 04:54 GMT-4

Hi Micheal,
Just in case you haven't solved this yet, maybe this will help:

I just installed v4 with Matlab R2010a and was getting the same error. After fiddling with a bunch of stuff, I ended up running comsolserver (no space) which prompted me for a username/password which I made up and entered. After I exited this program (typed 'close'), I then tried the 'COMSOL with MATLAB' star menu shortcut again and everything worked fine. Not sure what I accomplished, but hey, solved my problem.

FYI, I installed on a Linux Machine (Ubuntu 10.4) and Windows (Vista SP2) and had the same problem on each. The above fixed both instances.


[QUOTE] Hi Micheal, Just in case you haven't solved this yet, maybe this will help: I just installed v4 with Matlab R2010a and was getting the same error. After fiddling with a bunch of stuff, I ended up running comsolserver (no space) which prompted me for a username/password which I made up and entered. After I exited this program (typed 'close'), I then tried the 'COMSOL with MATLAB' star menu shortcut again and everything worked fine. Not sure what I accomplished, but hey, solved my problem. FYI, I installed on a Linux Machine (Ubuntu 10.4) and Windows (Vista SP2) and had the same problem on each. The above fixed both instances. [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 1 nov 2011, 04:56 GMT-4

Hi,

Bit of a boring generic question I'm afraid but if anyone has come across this error any help would be appreciated.

I've been trying to get the COMSOL with MATLAB livelink working and after some trials managed to get the shortcut to finally appear :). however I can't seem to get it to work as i keep getting an error:

com.comsol.util.exceptions.FlException: Unable to get the user manager
Messages:
Unable to get the user manager

I think it could be a path problem as it was a problem before hand with having MATLAB installed on the D:\.

However when i run D;\COMSOL40\Bin\win32\comsol matlab

I can get it to load up both however fail to actually get it to run any of my models as I get an error:

Exception:
com.comsol.util.exceptions.FlException: Launching COMSOL Server automatically is currently not supported
Messages:
Launching COMSOL Server automatically is currently not supported


Stack trace:

at com.comsol.model.clientserver.ClientManagerImpl.launchServer(Unknown Source)

at com.comsol.model.util.ModelManager.create(Unknown Source)

at com.comsol.model.util.ModelUtil.create(Unknown Source)

another possible path problem?

any help is appreciated.

Kind Regards MF


[QUOTE] Hi, Bit of a boring generic question I'm afraid but if anyone has come across this error any help would be appreciated. I've been trying to get the COMSOL with MATLAB livelink working and after some trials managed to get the shortcut to finally appear :). however I can't seem to get it to work as i keep getting an error: com.comsol.util.exceptions.FlException: Unable to get the user manager Messages: Unable to get the user manager I think it could be a path problem as it was a problem before hand with having MATLAB installed on the D:\. However when i run D;\COMSOL40\Bin\win32\comsol matlab I can get it to load up both however fail to actually get it to run any of my models as I get an error: Exception: com.comsol.util.exceptions.FlException: Launching COMSOL Server automatically is currently not supported Messages: Launching COMSOL Server automatically is currently not supported Stack trace: at com.comsol.model.clientserver.ClientManagerImpl.launchServer(Unknown Source) at com.comsol.model.util.ModelManager.create(Unknown Source) at com.comsol.model.util.ModelUtil.create(Unknown Source) another possible path problem? any help is appreciated. Kind Regards MF [/QUOTE]

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 1 nov 2011, 04:57 GMT-4
Hi

the first time you run the matlab link in server mode you need to give a user name and password, as the software calls loops around via the OS. You might also get a firewall warning "allow this", It's all written in the user guide I believe

--
Good luck
Ivar
Hi the first time you run the matlab link in server mode you need to give a user name and password, as the software calls loops around via the OS. You might also get a firewall warning "allow this", It's all written in the user guide I believe -- Good luck Ivar

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.