Fix press/berendsen command

Dear Sir,

I am using press/berendsen barostat.
As mentioned in the document this fix does NOT perform time integration. Thus you must use a separate time integration fix, like fix nve or fix nvt to actually update the positions and velocities of atoms.

So, I am using this command

fix 1 all press/berendsen iso 1 1 1000
fix 2 all nvt temp 300 300 100

but in output, I am getting nan values

Step Temp Density Press
0 300 1.3333408 1756.5831
1000 -nan -nan -nan
2000 -nan -nan -nan
3000 -nan -nan -nan
4000 -nan -nan -nan
5000 -nan -nan -nan
6000 -nan -nan -nan
7000 -nan -nan -nan
8000 -nan -nan -nan
9000 -nan -nan -nan
10000 -nan -nan -nan

Please suggest where I am doing mistake.

There is not enough information here for any meaningful suggestion.
Have you confirmed, that fix press/berendsen is the cause of the "nan"s?

As mentioned in the document this fix does NOT perform time integration.
Thus you must use a separate time integration fix, like fix nve or fix nvt to actually update the positions and velocities of atoms.

Is this the correct way to use a separate time integration fix NVT for press/berendsen barostat?

fix 1 all press/berendsen iso 1 1 1000
fix 2 all nvt temp 300 300 100

thermo_style custom step temp press
thermo 100
timestep 1
reset_timestep 0
run 10000
unfix 1
unfix 2

What is the correct syntax is described in the documentation. It is your job to verify this. This forum is not an input file verification service.

However, it seems at this point expedient to determine whether your simulation setup is correct and for that it is important to see, if the simulation will run as expected without fix press/berendsen. If it does not, which I suspect, then it is rather pointless to discuss this fix and you have to go back and figure out why your simulation is misbehaving.