Question About using variable ramp

I’m using version 3 Nov 2022.

I’m trying to use ramp to increase the energy of an interaction (epsilon0), and every 100 steps, I print off the energy to see what it is:

reset_timestep	0
variable	epsilon0 equal ramp(1.0,3.0)
print		"initial energy value: ${epsilon0}"
fix		62 all adapt 1 pair lj/cut epsilon 2 3 v_epsilon0
run		1000 every 100 "print 'HERE HERE ${epsilon0}'"
unfix		62

The first print statement shows the epsilon0 is as expected: 1. But then in the run 1000 every 100... it shows from the first step, epsilon0 is 3. This seems very odd to me. I`m wondering here if I’m doing something wrong… or if the “every 100” is shortening the end_step of ramp from 1000 (which I want) to the first 100 (which I don’t want).

Yes, the problem is the “every” keyword which will break the single run into 10 small runs and the ramp will be applied to each of them. So the behavior you see is the expected behavior.

To avoid this you should either switch to using fix print (which is much more efficient) and drop the “every” or use run with the the additional keywords “start” and “stop”.

I see, thank you. I don’t remember why I got suspicious, but it seems it was warranted. This was just a test to see what was happening. What I actually want to do is:

reset_timestep	0
variable	epsilon0 equal ramp(1.0,3.0)
fix		62 all adapt 1 pair lj/cut epsilon 2 3 v_epsilon0
run 		20000 every 1000 "include rando-in.chrom"
unfix		62

Where rando-in.chrom is another in file that executes a variety of commands. But I want the epsilon0 value to ramp over all 20000 steps.

But the way I`ve written it, it will just ramp over the first 1000 steps. Is there an alternative way to do this?

Please re-read my previous post.

Oh sorry, I misread. Thank you!