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)
Posted 2014/04/04 5:08 GMT-4 LiveLink for MATLAB Version 4.4 10 Replies
Please login with a confirmed email address before reporting spam
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)

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
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
************
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...
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
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.*
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.
Suggested Content
- FORUM Comsol does not finish the calculation even though convergence criteria is satisfied
- BLOG COMSOL 4.4: Magnetic Saturation Curves at your Fingertips
- KNOWLEDGE BASE How to reference COMSOL Multiphysics® software in papers and publications
- BLOG Philosophy of the Ribbon
- FORUM Example does not work
