thermo output

Dear developers and users,

I'm trying to output thermo info every 8 steps, but from the 5th step. That is, I want to output at steps: 5, 13, 21, 29, 37 ...
However, I can only specify thermo 8, which gives me the output at : 0, 8 , 16, 24 ...
I tried to use:

variable s equal logfreq(8,1000,1000)-1
thermo_modify every v_s

but lammps complained error:
ERROR: Invalid math function in variable formula (variable.cpp:2355)

Is there a way through thermo_modify to do that? Thanks a lot!

Bo

try
run 5
thermo 8
run ......

Dear developers and users,

I made some typo in my previous post.

I tried:
variable s equal logfreq(8,100,1000)
thermo_modify every v_s

it gives output
Step Temp
        0 12.745151
        8 12.925244
       16 12.721115
       24 12.236052
       32 11.720423
       40 11.448423

without any problem.

However, if I try

variable s equal logfreq(8,100,1000)-3
thermo_modify every v_s

Lammps stopped with an error

Step Temp
        0 12.745151
        5 12.901342
ERROR: Thermo every variable returned a bad timestep (output.cpp:312)

Please help! Thanks!

Bo

Dear Nigel,

Thanks for the suggestions! However, the actual computation I'm trying to do is the numerical time derivative between current and previous timestep, which is based on the use of "fix store/state". This command will be flushed if I issued a new "run" command

   reset_timestep 0
   fix NVE all nve
   compute 1 all ke/atom
   variable rt atom c_1[1]
   fix s1 all store/state 1 v_rt
   fix s2 all store/state 2 v_rt
   variable df atom (f_s1[1]-f_s2[1])/(v_tstep)
   variable t equal v_df[13]
   thermo_style custom step v_t
   thermo 2
   run 40

the output with thermo 1

Dear Nigel,

Thanks for the suggestions! However, the actual computation I'm trying
to do is the numerical time derivative between current and previous
timestep, which is based on the use of "fix store/state". This command
will be flushed if I issued a new "run" command

hmmm... even if you use "run 5 post no" in the first chunk
and "run 35 pre no" in the second?

axel.

Dear Axel,

Unfortunately, it still didn't work even with your suggestions incorporated:

......
   thermo_style custom step v_t
   thermo 2
   run 1 post no
   run 40 pre no

output

Dear Axel,

Unfortunately, it still didn't work even with your suggestions incorporated:

ok. instead of guessing, here is something that i tested:

variable freq equal step+(step>=5)*8+(step<5)*5

thermo_modify every v_freq

you version cannot work, since you have to compute the
number of the *next* timestep in your variable formula.

axel.

Dear Axel,

It works like a charm! Thanks a lot!

Bo