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.

error in geometry: undefined function or variable 'rect2'

Please login with a confirmed email address before reporting spam

Dear Friends,

can someone help me out to evaluate my problem?

I am a beginner in comsol software and i have to accomplish a small task.

i have generated an m-file from the tutorial model - piezoaccoustic.m ( 'piezoaccoustic_transducer.mph' ).

I want to replace the geometry dimensions by user defined variables in MATLAB-GUIDE. Hence, user can easily change the dimension of the geometries whenever he wants.

In doing so, i assigned each dimension to a variable and replace the properties of geometry objects with this variables.

example:

but, when i try to run this m-file , i get the following error several times.


Java exception occurred:
Exception:
com.femlab.jni.FlNativeException: Unknown variable name
Messages:
Unknown variable name
- Name: k


Stack trace:

at evalconst.cpp, row 134, ()

at com.femlab.util.EvalConst.eval(Native Method)

at com.femlab.util.EvalConst.eval(Unknown Source)

at com.femlab.geom.Rect.a(Unknown Source)

at com.femlab.geom.Prim2.<init>(Unknown Source)
at com.femlab.geom.Rect.<init>(Unknown Source)
.

Error in ==> rect2.rect2 at 92
jptr=com.femlab.geom.Rect(2,prop);


can someone help me to resolve it.?

1 Reply Last Post 17 feb 2011, 16:07 GMT-5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 17 feb 2011, 16:07 GMT-5
Hi

I can probably not resolve it like that, but one thing that made me make many "strange mistakes" in the beginning was a naming violation with the internal COMSOL names already in use. Could it be that you are using k for you and its in collision with an internal use of k by COMSOL ?

--
Good luck
Ivar
Hi I can probably not resolve it like that, but one thing that made me make many "strange mistakes" in the beginning was a naming violation with the internal COMSOL names already in use. Could it be that you are using k for you and its in collision with an internal use of k by COMSOL ? -- Good luck Ivar

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.