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
06.10.2012, 17:00 GMT-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
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
07.10.2012, 10:54 GMT-4
Thank you very much sir.
Thank you very much sir.