Expression for voltage under parameters??

Topics: AC/DC Module, 4.2a

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   2 Replies   Last post: October 7, 2012 2:54pm UTC
Muthuraman Chinnadurai

Muthuraman Chinnadurai

October 6, 2012 1:25pm UTC

Expression for voltage under parameters??

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.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar Kjelberg

Ivar Kjelberg

October 6, 2012 9:00pm UTC in response to Muthuraman Chinnadurai

Re: Expression for voltage under parameters??

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Muthuraman Chinnadurai

Muthuraman Chinnadurai

October 7, 2012 2:54pm UTC in response to Ivar Kjelberg

Re: Expression for voltage under parameters??

Thank you very much sir.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines