# yade-users team mailing list archive

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

```Question #169689 on Yade changed:

Chiara Modenese is still having a problem:
On 1 September 2011 11:30, Chareyre
<question169689@xxxxxxxxxxxxxxxxxxxxx>wrote:

>
>
> Chareyre proposed the following answer:
> 1) I agree to use prevVelGrad.
>
Ok, let's do it then. We should simple add the velGrad argument to that
function and then input the prevVelGrad value when it is called in the
integrator.

>
> 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
>
Well the correction to the velocity due to the homogeneous deformation is
(was, before last changes) made up of two terms.
First term (this is at time t, so it is fine): Vector3r dVel=dVelGrad*state
->pos;
Second term (it should have been at time t but it is/was not):  state->vel+=

The second term could be expressed like

I shall look at what you propose and I let you know. You also let me know

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
> * next step, velgrad=+0.5 : velocity is adjusted at line 193:
> 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).
>
> --
> know that it is solved:
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback: