Hello,
I am currently trying to read out solution data from a COMSOL model in MATLAB, but everytime I try to run the model in MATLBA I get an error message like this:
Starting the COMSOL Multiphysics LiveLink(TM) for MATLAB(R).
Checking for additional startup script (comsolstartup.m)
in: C:\Users\DanFries
Checking for startup script on the MATLAB path
Type mphdoc or help mli for more information
Type mphmodellibrary to open the Model Library
>> duct_verify
Error using com.comsol.model.impl.ResultFeatureImpl/run
Java exception occurred:
Exception:
com.comsol.nativejni.FlNativeException: Failed to evaluate expression
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
Failed to evaluate expression
Failed to evaluate variable
- Variable: mod1.p
- Global scope
Failed to evaluate expression
- Expression: mod1.p
- Plot: glob1 (Global)
Stack trace:
at evaltree.cpp, row 706, ()
at xevaluators.cpp, row 377, ()
at com.comsol.nativejni.xmesh.PostInterp.eval(Native Method)
at com.comsol.nativejni.xmesh.PostInterp.eval(Unknown Source)
at com.comsol.nativemph.xmesh.c.a(Unknown Source)
at com.comsol.post.dataset.d.a(Unknown Source)
at com.comsol.post.dataset.s.a(Unknown Source)
at com.comsol.post.dataset.p.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.plot.r.a(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ao.b(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ap.d_(Unknown Source)
at com.comsol.post.plot.ap.getPostData(Unknown Source)
at com.comsol.post.plot.ap.getRenderData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ax(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aw(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.af(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ae(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getGroupRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.W(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.run(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aa(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.plotOnServer(Unknown Source)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.comsol.clientserver.impl.JobImpl.run(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a$a.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl.a(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl.runServerJob(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl$e.a(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl$e.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl$d.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: Exception:
com.comsol.nativejni.FlNativeException: Failed to evaluate expression
Messages:
Failed to evaluate variable
- Variable: mod1.p
- Global scope
Failed to evaluate expression
- Expression: mod1.p
- Plot: glob1 (Global)
at com.comsol.nativejni.xmesh.PostInterp.eval(Native Method)
at com.comsol.nativejni.xmesh.PostInterp.eval(Unknown Source)
at com.comsol.nativemph.xmesh.c.a(Unknown Source)
at com.comsol.post.dataset.d.a(Unknown Source)
at com.comsol.post.dataset.s.a(Unknown Source)
at com.comsol.post.dataset.p.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.plot.r.a(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ao.b(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ap.d_(Unknown Source)
at com.comsol.post.plot.ap.getPostData(Unknown Source)
at com.comsol.post.plot.ap.getRenderData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ax(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aw(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.af(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ae(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getGroupRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.W(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.run(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aa(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.plotOnServer(Unknown Source)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.comsol.clientserver.impl.JobImpl.run(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a$a.run(Unknown Source)
... 3 more
Error in duct_verify (line 642)
model.result('pg3').run;
I have tried to take out stuff that causes error step by step but then in the end not much is left that produces useful information.
The code is attached to this post. Maybe someone has an idea what I am doing wrong? Or, if you have some kind of tutorial that I could work through for this kind of stuff that would be great as well. Haven't found one so far.
Best regards
Dan
I am currently trying to read out solution data from a COMSOL model in MATLAB, but everytime I try to run the model in MATLBA I get an error message like this:
Starting the COMSOL Multiphysics LiveLink(TM) for MATLAB(R).
Checking for additional startup script (comsolstartup.m)
in: C:\Users\DanFries
Checking for startup script on the MATLAB path
Type mphdoc or help mli for more information
Type mphmodellibrary to open the Model Library
>> duct_verify
Error using com.comsol.model.impl.ResultFeatureImpl/run
Java exception occurred:
Exception:
com.comsol.nativejni.FlNativeException: Failed to evaluate expression
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
Failed to evaluate expression
Failed to evaluate variable
- Variable: mod1.p
- Global scope
Failed to evaluate expression
- Expression: mod1.p
- Plot: glob1 (Global)
Stack trace:
at evaltree.cpp, row 706, ()
at xevaluators.cpp, row 377, ()
at com.comsol.nativejni.xmesh.PostInterp.eval(Native Method)
at com.comsol.nativejni.xmesh.PostInterp.eval(Unknown Source)
at com.comsol.nativemph.xmesh.c.a(Unknown Source)
at com.comsol.post.dataset.d.a(Unknown Source)
at com.comsol.post.dataset.s.a(Unknown Source)
at com.comsol.post.dataset.p.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.plot.r.a(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ao.b(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ap.d_(Unknown Source)
at com.comsol.post.plot.ap.getPostData(Unknown Source)
at com.comsol.post.plot.ap.getRenderData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ax(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aw(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.af(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ae(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getGroupRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.W(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.run(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aa(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.plotOnServer(Unknown Source)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.comsol.clientserver.impl.JobImpl.run(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a$a.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl.a(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl.runServerJob(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl$e.a(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl$e.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl$d.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: Exception:
com.comsol.nativejni.FlNativeException: Failed to evaluate expression
Messages:
Failed to evaluate variable
- Variable: mod1.p
- Global scope
Failed to evaluate expression
- Expression: mod1.p
- Plot: glob1 (Global)
at com.comsol.nativejni.xmesh.PostInterp.eval(Native Method)
at com.comsol.nativejni.xmesh.PostInterp.eval(Unknown Source)
at com.comsol.nativemph.xmesh.c.a(Unknown Source)
at com.comsol.post.dataset.d.a(Unknown Source)
at com.comsol.post.dataset.s.a(Unknown Source)
at com.comsol.post.dataset.p.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.dataset.ad.a(Unknown Source)
at com.comsol.post.plot.r.a(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ao.b(Unknown Source)
at com.comsol.post.plot.ao.a(Unknown Source)
at com.comsol.post.plot.ap.d_(Unknown Source)
at com.comsol.post.plot.ap.getPostData(Unknown Source)
at com.comsol.post.plot.ap.getRenderData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ax(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aw(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.af(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.ae(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.getGroupRenderPostData(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.W(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.run(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.aa(Unknown Source)
at com.comsol.model.internal.impl.ResultFeatureImpl.plotOnServer(Unknown Source)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.comsol.clientserver.impl.JobImpl.run(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a.a(Unknown Source)
at com.comsol.server.internal.b$a$a.run(Unknown Source)
... 3 more
Error in duct_verify (line 642)
model.result('pg3').run;
I have tried to take out stuff that causes error step by step but then in the end not much is left that produces useful information.
The code is attached to this post. Maybe someone has an idea what I am doing wrong? Or, if you have some kind of tutorial that I could work through for this kind of stuff that would be great as well. Haven't found one so far.
Best regards
Dan