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.

Global parameters vs. Model/Definitions/Variables

Please login with a confirmed email address before reporting spam

It seems that the geometry can only be defined by global parameters while the rest of the modeling can also use variables.
Is there a way to access the model variables in the geometry such as mod1.Definitions.Params1.xab where xab is a variable that belong to Params1 in variables?
Thanks in advance.
Kamil

3 Replies Last Post Nov 14, 2012, 2:44 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 13, 2012, 12:29 p.m. EST
Hello, Kamil,

I see it this way: it seems that Geometry only accepts Parameters (they are only available as Global Definitions), not Variables (may they be Global or Model-scope). You can see that neither a Global Variable is accepted in the Geometry.

Jesus.
Hello, Kamil, I see it this way: it seems that Geometry only accepts Parameters (they are only available as Global Definitions), not Variables (may they be Global or Model-scope). You can see that neither a Global Variable is accepted in the Geometry. Jesus.

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 Nov 13, 2012, 2:43 p.m. EST
Hi

but parameters can be changed with the "external Parametric sweep node" and then you adapt your geoemtry and can solve for different Parameter values

--
Good luck
Ivar
Hi but parameters can be changed with the "external Parametric sweep node" and then you adapt your geoemtry and can solve for different Parameter values -- Good luck Ivar

Andrea Ferrario COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 14, 2012, 2:44 a.m. EST
Hello Kamil,

Jesus is right: only "model parameters" (the ones in the Parameters node) can be used in the construction of the geometry. The reason is that those parameters have always a fixed value each time you solve (or at each step of a sweep). "Variables", instead, can be defined using almost anything: you can have a variable that depends on the solution and that cannot be used to construct the geometry directly.

If you need to solve problems such as "find the right dimension so that a certain condition is met", you need to follow Ivar's advice and perform a parametric sweep, or use optimization (if you have the required module).

--
Andrea Ferrario
Electromagnetics Group
COMSOL AB
Hello Kamil, Jesus is right: only "model parameters" (the ones in the Parameters node) can be used in the construction of the geometry. The reason is that those parameters have always a fixed value each time you solve (or at each step of a sweep). "Variables", instead, can be defined using almost anything: you can have a variable that depends on the solution and that cannot be used to construct the geometry directly. If you need to solve problems such as "find the right dimension so that a certain condition is met", you need to follow Ivar's advice and perform a parametric sweep, or use optimization (if you have the required module). -- Andrea Ferrario Electromagnetics Group COMSOL AB

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.