# Error on process 0, substitution for illegal variable P

Hi All,
I am trying to conduct this kind of simulation for getting stress-strain relationship for copper nanowire. But, I run this code, then I used to getting an error as’ Error on process 0, substitution for illegal variable P. Would you like to help me in solving this problem? I have involved with solving this problem for 3 days, still the case is same, and couldn’t identify what is the problem happening here. The LAMMPS version April 8, 2021.

``````#Initialization
units metal
dimension 3
boundary p p p
#Atom and Lattice Definition
atom_style atomic
#definition of type of lattice
lattice fcc 3.52
# Definition of Region
region nanowire block 0 40 0 40 0 40
create_box 3 nanowire
create_atoms 1 region nanowire
mass 1 63.546

variable	EngVol		equal   10^4*(29.496)*(102.177144)*(102.7026)
variable T equal 0.01
#Variable P equal 0
#Forcefields
pair_style eam
pair_coeff * * Cu_u3.eam
#Definition of the region to set velocity in upper and lower side
variable L equal 144.6

variable StRate equal 	0.0001
####Minimization
min_style			cg
minimize			1e-25 1e-25  100000 100000
timestep 	0.001
#Give some initial velocity to all the atoms randomly at a temperature of 0.01K.
velocity all create 0.01 511124 rot yes mom yes
fix 	       0 all npt temp \$T \$T 0.1 iso \$P \$P 1 #tdamp is 100 times of timestep (0.001*100)
run            1000
unfix          0
###############deformation
reset_timestep   0
fix	       1 all npt temp \$T \$T 0.1 x 0 0 1 z 0 0 1 ###to deform in y direction

###### compute
compute        stN11 all stress/atom NULL
compute        stN12 all reduce sum c_stN11[1]
compute        stN13 all reduce sum c_stN11[2]
compute        stN14 all reduce sum c_stN11[3]

variable strain equal (ly-v_L)/v_L
variable s1 equal "v_strain"
variable	Sgiga1	equal (c_stN12)/(\${EngVol})
variable	Sgiga13	equal (c_stN13)/(\${EngVol})
variable	Sgiga14	equal (c_stN14)/(\${EngVol})

fix	        2 all deform 1 y erate \${StRate} units box
#Simulation settings
dump 1Dump all atom 100 dump.atom
thermo 100
thermo_style custom step lx ly lz xlo xhi ylo yhi zlo zhi vol temp etotal press v_strain pxx pyy pzz

fix def1 all print 100 "\${s1} \${Sgiga1} \${Sgiga13} \${Sgiga14}" file stress_strain.txt screen no
#Run

run 5000
write_data  nanotube.data
``````

Sincerely,
Akash Talapatra

The error message already tells you what the error is: “illegal variable P”
You are using a variable P but where is it defined?

``````#Variable P equal 0
``````

which is a comment and thus ignored.

After, removing the sign, still there is found an error which says ‘ERROR: Unknown command: Variable P equal 0 (src/input.cpp:272)
Last command: Variable P equal 0’
What should I do now?

Is there are command “Variable” in LAMMPS? I don’t see it.

Oh, sorry I fix it. Now, it’s saying ‘ERROR on proc 0: Too many neighbor bins (src/nbin_standard.cpp:184)’. Actually, I am new to learn simulation on LAMMPS, that’s why I am getting so many errors one by one.

This is a different and completely unrelated error and thus you should post this as a new topic.

Then you should post your questions to the LAMMPS beginners category.