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 duplicate variable name

Please login with a confirmed email address before reporting spam

Hi,

I am trying to make simulation about inspecting flaw in a plate by coil. My model is attached.
I got the error as the title. Could anyone help me? Thank you advance.



4 Replies Last Post 10.11.2011, 20:42 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 09.11.2011, 09:02 GMT-5
The problem is the parameter "h" that you've defined. You have to rename it to something else as "h" is already pre-defined by Comsol to refer to the mesh element size.
The problem is the parameter "h" that you've defined. You have to rename it to something else as "h" is already pre-defined by Comsol to refer to the mesh element size.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 09.11.2011, 09:27 GMT-5
Hi,

it is in general a good advice to avoid short, particularly single-letter variables, because some of them, like x, y, z, r, t, etc. are used by Comsol.
What is new to me so far is that Comsol now creates an error, or a warning, if such a conflict occurs.

Is that new to 4.2a?

Cheers
Edgar
Hi, it is in general a good advice to avoid short, particularly single-letter variables, because some of them, like x, y, z, r, t, etc. are used by Comsol. What is new to me so far is that Comsol now creates an error, or a warning, if such a conflict occurs. Is that new to 4.2a? Cheers Edgar

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 09.11.2011, 14:57 GMT-5
Hello

it seems to depend on the use of the variable, I tried, in v4.2a, to redefine h and it worked without errors, but I was not inluding h into the solver sequence s othat might be the reason.

I find it nice that COMSOl checks when we redefine the internal variables, but sometimes it's of interest to be able to, too ;)

--
Good luck
Ivar
Hello it seems to depend on the use of the variable, I tried, in v4.2a, to redefine h and it worked without errors, but I was not inluding h into the solver sequence s othat might be the reason. I find it nice that COMSOl checks when we redefine the internal variables, but sometimes it's of interest to be able to, too ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10.11.2011, 20:42 GMT-5
Hi,

Thank you very much. My version is 4.2. Now I am clear about the problem:-)

Best regards
Hi, Thank you very much. My version is 4.2. Now I am clear about the problem:-) Best regards

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.