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.

Mphstart does not work even the comsolserver is running (Comsol 4.4)

Please login with a confirmed email address before reporting spam

I installed the latest ver. 4.4 and I found the command "mphstart" did not work when I wanted to connect my Matlab to the comsolserver. I am sure the comsolserver was already running prior to the command "mphstart" was excuted in my M-file. The error shows "Error using mphstart (line 152) A connection to Comsol could not be established .... Please check that a Comsol Server is started prior to calling mphstart ". I am also sure the folder 'mli' had already been added to the Matlab path.
Even though I ran "COMSOL 4.4 with MATLAB" and managed to establish the connection, when I type "mphstart" again in the Matlab command line, the same error occured.
This did not happen to 4.3a and 4.3b at all.
So anyone could tell me how to solve this problem?
(the version was already updated to 4.4 build 195)

10 Replies Last Post 19 nov. 2015, 10:47 UTC−5
COMSOL Moderator

Hello Dong Liu

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23 mai 2014, 07:41 UTC−4
I've got the same problem, have you found a solution yet?
I've got the same problem, have you found a solution yet?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23 mai 2014, 09:06 UTC−4
I'm using COMSOL4.4 and Matlab 2007b by the way, maybe there's aproblem with the version?
I'm using COMSOL4.4 and Matlab 2007b by the way, maybe there's aproblem with the version?

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 29 juil. 2014, 11:17 UTC−4
Same problem here. Have you found a solution?

I tried it with comsol 4.4, both version 195 and 248 and tried it with Matlab 2012b and 2014a, and, it doesn't work on multiple PCs. The shortcut Comsol 4.4 with matlab does function properly, but I cannot use that on our remote machine. Also Comsol 4.3b connects without any problem using mphstart.

The comsol server console doesn't show any evidence of a connection being attempted. But the port is open according to "netstat -a".

No luck yet.
Same problem here. Have you found a solution? I tried it with comsol 4.4, both version 195 and 248 and tried it with Matlab 2012b and 2014a, and, it doesn't work on multiple PCs. The shortcut Comsol 4.4 with matlab does function properly, but I cannot use that on our remote machine. Also Comsol 4.3b connects without any problem using mphstart. The comsol server console doesn't show any evidence of a connection being attempted. But the port is open according to "netstat -a". No luck yet.

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 31 juil. 2014, 02:15 UTC−4
No, I did not find a solution. In the end, I just decided not to use the Matlab connection. I suspected it was because of my MATLAB version, someone else started it with a newer version an another PC and it worked. So I'm sorry I can't be of help.
No, I did not find a solution. In the end, I just decided not to use the Matlab connection. I suspected it was because of my MATLAB version, someone else started it with a newer version an another PC and it worked. So I'm sorry I can't be of help.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 11 févr. 2015, 08:26 UTC−5
Any solutions ? Same problem here.
Any solutions ? Same problem here.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 20 avr. 2015, 09:37 UTC−4
Did u solve the problem? Exactly the same problem here. It is the third time it happens. I reinstalled it twice before, but it was really not an efficient way.
Did u solve the problem? Exactly the same problem here. It is the third time it happens. I reinstalled it twice before, but it was really not an efficient way.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 25 août 2015, 16:05 UTC−4
Any chance that an expert answers this trend? I'm getting the same message on my Matlab CmdWin:
************
Error using mphstart (line 152)
A connection to Comsol could not be established. Please check that a Comsol Server is started prior to calling mphstart
************
even if the server has been previously started...
Any chance that an expert answers this trend? I'm getting the same message on my Matlab CmdWin: ************ Error using mphstart (line 152) A connection to Comsol could not be established. Please check that a Comsol Server is started prior to calling mphstart ************ even if the server has been previously started...

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 8 sept. 2015, 03:24 UTC−4
Hi

There are a number of reasons why using mphstart may fail.

The most common problem is the use of a firewall that prevent the connections. You should also use a recent version of Matlab. The currently supported versions are listed here:
www.comsol.com/system-requirements/module
You can use older versions than the recommended, but some functionality may not work. Matlab versions older than R2010a are known NOT to work.

If you have problems with mphstart then send a mail to support. Please write what operating system you are using and what version of Matlab you have.

--
Lars Gregersen
Comsol Denmark
Hi There are a number of reasons why using mphstart may fail. The most common problem is the use of a firewall that prevent the connections. You should also use a recent version of Matlab. The currently supported versions are listed here: http://www.comsol.com/system-requirements/module You can use older versions than the recommended, but some functionality may not work. Matlab versions older than R2010a are known NOT to work. If you have problems with mphstart then send a mail to support. Please write what operating system you are using and what version of Matlab you have. -- Lars Gregersen Comsol Denmark

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 19 sept. 2015, 12:27 UTC−4
Hi I have met the same problem and finally found a solution..

If your condition is the same as me then it must be all fine when you call mphstart for the first time.

The problem happens when the first run is terminated and you want to call mphstart to connect again.

The reason of termination could be that you run ModelUtil.disconnect, or the comsolmphserver is for some reason terminated unexpectedly.

For both condition, before you call mphstart, you should call ModelUtil.clear and got a java exception. Then everything goes well.

I don't know why but it does work. It seems the first run has left something under the ModelUtil object which can inhibit your second connection.
Hi I have met the same problem and finally found a solution.. If your condition is the same as me then it must be all fine when you call mphstart for the first time. The problem happens when the first run is terminated and you want to call mphstart to connect again. The reason of termination could be that you run ModelUtil.disconnect, or the comsolmphserver is for some reason terminated unexpectedly. For both condition, before you call mphstart, you should call ModelUtil.clear and got a java exception. Then everything goes well. I don't know why but it does work. It seems the first run has left something under the ModelUtil object which can inhibit your second connection.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 19 nov. 2015, 10:47 UTC−5



For both condition, before you call mphstart, you should call ModelUtil.clear and got a java exception. Then everything goes well.



ModelUtil.clear not working for me:
>> import com.comsol.model.*
>> import com.comsol.model.util.*
>> ModelUtil.clear
Undefined variable "ModelUtil" or function "ModelUtil.clear".
>>mphstart

or even
>> ModelUtil.clear
Undefined variable "ModelUtil" or function "ModelUtil.clear".
>>mphstart
>> import com.comsol.model.*
>> import com.comsol.model.util.*
[QUOTE] For both condition, before you call mphstart, you should call ModelUtil.clear and got a java exception. Then everything goes well. [/QUOTE] ModelUtil.clear not working for me: >> import com.comsol.model.* >> import com.comsol.model.util.* >> ModelUtil.clear Undefined variable "ModelUtil" or function "ModelUtil.clear". >>mphstart or even >> ModelUtil.clear Undefined variable "ModelUtil" or function "ModelUtil.clear". >>mphstart >> import com.comsol.model.* >> import com.comsol.model.util.*

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.