Dear guys
I am performing this command in script
variable xc equal x[581]
i.e. i define a variable “xc” which is equal to the x- coordinate of particle #581
Question is:
does xc points to x[581] or is it related just to the value at the beginning?
In other words:
if x[581] gets modified because of dynamics, does xc modify itself accordingly too?
I apologise if question is too silly
Thanks.
Regards
Mario
Dear guys
I am performing this command in script
variable xc equal x[581]
i.e. i define a variable "xc" which is equal to the x- coordinate of
particle #581
Question is:
does xc points to x[581] or is it related just to the value at the
beginning?
In other words:
if x[581] gets modified because of dynamics, does xc modify itself
accordingly too?
I apologise if question is too silly
it *is* explained in the documentation of the variable command.
equal style variables are like functions, i.e. they are evaluated at
the time they are used.
however, it depends on how you refer to it, e.g. via \{xc\} or v\_xc
when this happens\. {xc} is expanded inside the input file reader,
before any command sees it, thus it is evaluated immediately, v_xc
gets passed along and thus requires a command that understands how to
evaluate variables, but then it will be evaluated as needed.
axel.
Thanks Axel
sorry for not reading thoroughly the variable page
Best,
M