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.

Expression for voltage under parameters??

Muthuraman Chinnadurai

Please login with a confirmed email address before reporting spam

Am a beginner in comsol and i wish to declare parameters to my model.The input to my model is voltage and when i key in 'V' under the expression coloumn in parameters,the alphabet turns red.It says unknown variable,please help me sort out this issue.
Thanks in advance.

2 Replies Last Post 7 oct. 2012, 10:54 UTC−4
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 6 oct. 2012, 17:00 UTC−4
Hi

You can define "parameters" in the first Global Definition node (add a Parameter node by a "right click" on the node). A Parameter is read once at the beginning of the COMSOL solving sequence, and can be referred to later in a function or other occasions. A parameter value might be overwriten by COMSOl if you are using the same name further down in the node tree.

Many single character names are already defined by COMSOL as internal variables, and a Parameter should not have the same name as a Dependent Variable, and V is mostly already defined as "Volts" in COMSOL ACDC.

I mostly use long names or add some prefix or suffix to distinguish my own parameters from COMSOL numerous variable names.

Note check the doc on Parameters and Variables, as variables can be adressed and recalcualted during processing and are defined either as Global or as "local" Variables which are normally NOT constant values, these should be set to Parameters

Then you have units, a parameter as
V0 = 2[V]
(where the "=" is implicit and not appearing in the GUI) is valid and gives the value of 2 to V0 and tags the variable with units "Volts" and note that units should be defined between square braquets

V0 = 2V

will flag red (=error) as [V] is the correct way to define units

if you combine equations with variables, and the units do finally NOT match, COMSOL will flag the formula with an orange color to indicate a WARNING (not an error) of inconsitence units




--
Good luck
Ivar
Hi You can define "parameters" in the first Global Definition node (add a Parameter node by a "right click" on the node). A Parameter is read once at the beginning of the COMSOL solving sequence, and can be referred to later in a function or other occasions. A parameter value might be overwriten by COMSOl if you are using the same name further down in the node tree. Many single character names are already defined by COMSOL as internal variables, and a Parameter should not have the same name as a Dependent Variable, and V is mostly already defined as "Volts" in COMSOL ACDC. I mostly use long names or add some prefix or suffix to distinguish my own parameters from COMSOL numerous variable names. Note check the doc on Parameters and Variables, as variables can be adressed and recalcualted during processing and are defined either as Global or as "local" Variables which are normally NOT constant values, these should be set to Parameters Then you have units, a parameter as V0 = 2[V] (where the "=" is implicit and not appearing in the GUI) is valid and gives the value of 2 to V0 and tags the variable with units "Volts" and note that units should be defined between square braquets V0 = 2V will flag red (=error) as [V] is the correct way to define units if you combine equations with variables, and the units do finally NOT match, COMSOL will flag the formula with an orange color to indicate a WARNING (not an error) of inconsitence units -- Good luck Ivar

Muthuraman Chinnadurai

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 7 oct. 2012, 10:54 UTC−4
Thank you very much sir.
Thank you very much sir.

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.