# yade-users team mailing list archive

## Re: [Question #169689]: Velocity gradient

```Question #169689 on Yade changed:

1) I agree to use prevVelGrad.

2) Indeed it's using v(t+dt/2) (more or less since it's not fully
updated). I think it should be using the value v(t-dt/2). How would it
I imagine this cycle where the body moves only due to cell deformation
(no contact forces), with velGrad switching between -0.5 and +0.5 at
each cycle, and assuming dt=1:

* position=1, velgrad=-0.5 : position goes to 0.5 after the first
integration, as velocity is  -0.5
v=v+0.25=-0.25 (correct, it corresponds to the velocity when the
particle arrives at position 0.5 in the old velocity field); then it's
accelerated the other way by dVelGrad=+2, v=0.25, pos=0.75.

The result after 2 steps looks correct (the position is not back to 1,
this is expected as the final size of the period itself is really 0.75,
not 1 (1*0.5*1.5)).
I commited a fix for 2), tell me if you agree (just moving a few lines
and updating acceleration instead of velocity).

--