Not sure what's wrong with my variable declarations

Hi,

I’m trying to input a discrete grid of Electric field values using Ex = sum over i rmask(i)*Ex(i), due to line space constraints I implemented this as

variable Ex1 atom 0.0222rmask(1)+0.0303rmask(2)+0.0366rmask(3)+0.0412rmask(4)+0.0445rmask(5)+0.0470rmask(6)+0.0489rmask(7)+ 0.0505rmask(8)+0.0519*rmask(9)
variable Ex2 atom …
variable Ex atom v_Ex1+v_Ex2…

This is giving me the error Illegal variable command. I’m not sure if I’m trying to declare too many variables, or whether I made a syntax error.

thanks,

~Nickhil

If the long variable def has no spaces, it is fine. The variable command
is expecting a single final argument (the formula). You can either use
no space, or enclose it in quotes.

Steve

Found what was wrong, thanks for the tip

~Nickhil Rokkam