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.

Link Matlab to Comsol in MAC - path problem

Please login with a confirmed email address before reporting spam

Dear all,

in the bin/comsol.ini file I defined

MLROOT=/Applications/MATLAB_R2011b.app

The problem is that when clicking the app COMSOL with Matlab a problem appears.
checking the setlog I says something like


the path is not found: applications/matlab_R2011.app/bin/bin/matlab.

Then I check in matlab and actually I onlye have the path: applications/matlab_R2011.app/bin/matlab.

As you can see only one "bin" folder appears not 2. So I guess the solution is to fix the comsol.ini file and put one bin folder but I don't know how to do it.

any help

4 Replies Last Post 27 feb 2013, 05:12 GMT-5
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 feb 2012, 14:32 GMT-5
Hi
My suggestion, locate the ini file and edit it with notepad (previously make a copy for backup). I'm astonished there is no C:\ ... or something more absolute in your path

--
Good luck
Ivar
Hi My suggestion, locate the ini file and edit it with notepad (previously make a copy for backup). I'm astonished there is no C:\ ... or something more absolute in your path -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15 feb 2012, 18:24 GMT-5
Hello,

I fixed it... Actually I chose the wrong file... it was in the Mac64 folder and modified the files:

comsol.ini

comsolserver.ini

In this case there is no MLROOT, instead I used the typical -Dsc which appears in the manual. I copy and paste the path from the comsol manual since it was not there before.

I still keep the MLROOT=/Applications/MATLAB_R2011b.app in the other file which was somewhere else


PS: to clarify my mistake in Mac there is a folder COMSOL42 and the icon app COMSOL42, First I chose the icon with right click to get the contents and found the bin folder and the comsol.ini file (incorrect file since it has the MLROOT script)....but then I chose the folder COMSOL42, went to the bin folder and then to MAC64 folder and found


comsol.ini

comsolserver.ini


and works....however I have a new problem

Matlab opened, I upload my file and got an error, smthg like line 1209 X# : etc... The real mistake was that "[ ]" are not necessary in the script, so I deleted all the brackets as they were suggested by Matlab and fixed that problem....

Now when I run it, it runs really fast compared to before but I have the following mistake

Java exception occurred:
java.lang.IllegalStateException: Not active: CDOTransaction(1)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.checkActive(LifecycleUtil.java:67)
at

etc

etc

Error in weak (line 10)
model = ModelUtil.create('Model');



BUT i don't know what is this error about..any help is appreciated
Hello, I fixed it... Actually I chose the wrong file... it was in the Mac64 folder and modified the files: comsol.ini comsolserver.ini In this case there is no MLROOT, instead I used the typical -Dsc which appears in the manual. I copy and paste the path from the comsol manual since it was not there before. I still keep the MLROOT=/Applications/MATLAB_R2011b.app in the other file which was somewhere else PS: to clarify my mistake in Mac there is a folder COMSOL42 and the icon app COMSOL42, First I chose the icon with right click to get the contents and found the bin folder and the comsol.ini file (incorrect file since it has the MLROOT script)....but then I chose the folder COMSOL42, went to the bin folder and then to MAC64 folder and found comsol.ini comsolserver.ini and works....however I have a new problem Matlab opened, I upload my file and got an error, smthg like line 1209 X# : etc... The real mistake was that "[ ]" are not necessary in the script, so I deleted all the brackets as they were suggested by Matlab and fixed that problem.... Now when I run it, it runs really fast compared to before but I have the following mistake Java exception occurred: java.lang.IllegalStateException: Not active: CDOTransaction(1) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.checkActive(LifecycleUtil.java:67) at etc etc Error in weak (line 10) model = ModelUtil.create('Model'); BUT i don't know what is this error about..any help is appreciated

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27 feb 2013, 05:04 GMT-5
Hi Christian,
I have the same Problem.
It occurs when a model is loaded to the server and I try to export an other one with a different ModelName to the comsol server.

Did you solve your Problem? I also need to find one, because I want to handle multiple models within the same comsol-server.
Hi Christian, I have the same Problem. It occurs when a model is loaded to the server and I try to export an other one with a different ModelName to the comsol server. Did you solve your Problem? I also need to find one, because I want to handle multiple models within the same comsol-server.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27 feb 2013, 05:12 GMT-5
model=mphload('PATH_&_MODEL.mph','Model');
model2=mphload('PATH_&_MODEL.mph.mph','Model2');

seems to work at least within matlab
model=mphload('PATH_&_MODEL.mph','Model'); model2=mphload('PATH_&_MODEL.mph.mph','Model2'); seems to work at least within matlab

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.