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 using Comsol 4.0a and MATLAB
Posted Dec 2, 2010, 9:55 a.m. EST 1 Reply
Please login with a confirmed email address before reporting spam
Hi,
I am quite new to Comsol, we are using it for an university project.
I try to simualte an electrostatic actor and in oder to be able to move different electrodes i want to use parameters. Using parameters for rectangles and for example circles works perfectly fine, but as soon as I am using points its not working anymore.
Here is a very basic example code for the creation of a point using parameters:
model = ModelUtil.create('Model');
model.param.set('a','0.2');
model.geom().create('geom1',2);
model.geom('geom1').feature.create('p1','Point');
model.geom('geom1').feature('p1').set('p',{'a','2'});
model.geom('geom1').run;
mphgeom(model,'geom1');
And here is the error message generated by MATLAB:
??? Java exception occurred:
Exception:
com.comsol.util.exceptions.FlException: Unknown variable name
Messages:
Unknown variable name
- Name: a
- Property name: p
Stack trace:
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.b(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.e(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.properties.ai.set(Unknown Source)
at com.comsol.model.impl.PropValueImpl.set(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl.c(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.a(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl$d.call(Unknown
Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Error in ==> Actor_MATLAB_Handwritten at 10
model.geom('geom1').feature('p1').set('p',{'a','2'});
Any ideas what I am doing wrong?
Thanks,
Michael
I am quite new to Comsol, we are using it for an university project.
I try to simualte an electrostatic actor and in oder to be able to move different electrodes i want to use parameters. Using parameters for rectangles and for example circles works perfectly fine, but as soon as I am using points its not working anymore.
Here is a very basic example code for the creation of a point using parameters:
model = ModelUtil.create('Model');
model.param.set('a','0.2');
model.geom().create('geom1',2);
model.geom('geom1').feature.create('p1','Point');
model.geom('geom1').feature('p1').set('p',{'a','2'});
model.geom('geom1').run;
mphgeom(model,'geom1');
And here is the error message generated by MATLAB:
??? Java exception occurred:
Exception:
com.comsol.util.exceptions.FlException: Unknown variable name
Messages:
Unknown variable name
- Name: a
- Property name: p
Stack trace:
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.b(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.e(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.properties.ai.set(Unknown Source)
at com.comsol.model.impl.PropValueImpl.set(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl.c(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.a(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl$d.call(Unknown
Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Error in ==> Actor_MATLAB_Handwritten at 10
model.geom('geom1').feature('p1').set('p',{'a','2'});
Any ideas what I am doing wrong?
Thanks,
Michael
1 Reply Last Post Dec 2, 2010, 12:07 p.m. EST