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.

Problem with COMSOL5 and MATLAB

Please login with a confirmed email address before reporting spam

Hi,

I am trying running COMSOL with MATLAB, and when I run my code I get the following error. Does anyone have any idea what is wrong.

I am using COMSOL5.0 on ubuntu 14.04, and I have tried both MATLAB 13b and 15a.

The code up to the stop point is:

import com.comsol.model.*
import com.comsol.model.util.*
model = ModelUtil.create('Model');
model.modelPath('/home/rahmani/Ratchet/Comsol');
model.comments(['Untitled\n\n']);
model.modelNode.create('comp1');
model.geom.create('geom1', 2);

and the error is:

Java exception occurred:
Exception:
java.lang.UnsatisfiedLinkError: com.comsol.nativejni.geom.Geom2.createGeom2(Lcom/comsol/nativejni/CPointer;I)V
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
com.comsol.nativejni.geom.Geom2.createGeom2(Lcom/comsol/nativejni/CPointer;I)V

Stack trace:
at com.comsol.nativejni.geom.Geom2.createGeom2(Native Method)
at com.comsol.nativejni.geom.Geom2.<init>(Unknown Source)
at com.comsol.nativemph.geom.Geom2.<init>(Unknown Source)
at com.comsol.nativemph.geom.Geom2.<init>(Unknown Source)
at com.comsol.model.method.GeomSequenceMethod.setEmptyGeom(Unknown Source)
at com.comsol.model.internal.impl.GeomSequenceImpl.doSetEmptyGeom(Unknown Source)
at com.comsol.model.internal.impl.GeomSequenceImpl.setEmptyGeom(Unknown Source)
at com.comsol.model.method.GeomSequenceMethod.doInitialize(Unknown Source)
at com.comsol.model.internal.impl.GeomSequenceImpl.doInitialize(Unknown Source)
at com.comsol.model.internal.impl.ModelEntityImpl.initialize(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl.doCreate(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl.a(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl$1.a(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl$1.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManager$1.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

2 Replies Last Post Aug 24, 2015, 11:19 a.m. EDT
Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Aug 21, 2015, 5:40 p.m. EDT
I assume when you say that you have MATLAB 13b and 15a, you have tried both R2013b and R2015a ?

Did you follow the installation instructions ?

Do you have the MATLAB livelink product ?

Have you adjusted the COMSOL preferences to point to the MATLAB installation directory ?

What shell are you running under Ubuntu ? bash, csh, ksh, etc...

How did you start COMSOL / MATLAB together ? MATLAB from COMSOL, or COMSOL from MATLAB ?

I assume when you say that you have MATLAB 13b and 15a, you have tried both R2013b and R2015a ? Did you follow the installation instructions ? Do you have the MATLAB livelink product ? Have you adjusted the COMSOL preferences to point to the MATLAB installation directory ? What shell are you running under Ubuntu ? bash, csh, ksh, etc... How did you start COMSOL / MATLAB together ? MATLAB from COMSOL, or COMSOL from MATLAB ?

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Aug 24, 2015, 11:19 a.m. EDT

I assume when you say that you have MATLAB 13b and 15a, you have tried both R2013b and R2015a ?

Did you follow the installation instructions ?

Do you have the MATLAB livelink product ?

Have you adjusted the COMSOL preferences to point to the MATLAB installation directory ?

What shell are you running under Ubuntu ? bash, csh, ksh, etc...

How did you start COMSOL / MATLAB together ? MATLAB from COMSOL, or COMSOL from MATLAB ?


The problem was in starting the COMSOL and MATLAB.
I used "comsol matlab" to start it but the correct way is "comsol server matlab".
Thanks

[QUOTE] I assume when you say that you have MATLAB 13b and 15a, you have tried both R2013b and R2015a ? Did you follow the installation instructions ? Do you have the MATLAB livelink product ? Have you adjusted the COMSOL preferences to point to the MATLAB installation directory ? What shell are you running under Ubuntu ? bash, csh, ksh, etc... How did you start COMSOL / MATLAB together ? MATLAB from COMSOL, or COMSOL from MATLAB ? [/QUOTE] The problem was in starting the COMSOL and MATLAB. I used "comsol matlab" to start it but the correct way is "comsol server matlab". Thanks

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.