Clumps are getting a very high angVel in one iteration

Asked by Anton Gladky

in a very speicific conditions one of my clump is getting a very high angVel and goes to a numerical instability.
It seems, the problem is in this part of code [1] (leapfrogAsphericalRotate in NewtonIntegrator).

I could minimize the problem and there are values of all variables during 2 iterations:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Iter:154675
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
A: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996
M: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996
state->angMom: 0 0 0
dt: 9.55301e-06
l_n: 0 0 0
l_b_n: 0 0 0
state->inertia: 6.16301e-08 1.15341e-07 1.25862e-07
angVel_b_n: 0 0 0
dotQ_n: 0 0 0 0
state->angMom: 0 0 0
l_b_half: 0 0 0
angVel_b_half: 0 0 0
dotQ_half: 0 0 0 0
state->ori: 0.9834 0.00922239 -0.153026 -0.0970739
state->angVel: 0 0 0

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Iter:154676
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

A: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996
M: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996
state->angMom: 7.9467e-07 4.00506e-06 0.00125804
dt: 9.55301e-06
l_n: 3.97335e-07 2.00253e-06 0.000629021
l_b_n: 0.000188175 3.21368e-05 0.000599357
state->inertia: 6.16301e-08 1.15341e-07 1.25862e-07
angVel_b_n: 3053.29 278.624 4762.03
dotQ_n: 238.374 1150.47 -33.1568 2576.39
state->angMom: 7.9467e-07 4.00506e-06 0.00125804
l_b_half: 0.000376349 6.42735e-05 0.00119871
angVel_b_half: 6106.58 557.247 9524.07
dotQ_half: 401.41 2300.23 -54.5905 5160.22
state->ori: 0.987234 0.0311965 -0.153548 -0.0477782
state->angVel: 2922.13 -527.866 10932.1

Can anybody understand, whether the problem in a very high state->angMom,
which is obtained in a Iter=154676 or something else? Reducing the timestep
does not solve the problem

I remember, some years ago we had the same problem in clump-hopper-viscoelastic.py
But it is not reproducible any more.

Thanks ahead

[1] https://github.com/yade/trunk/blob/master/pkg/dem/NewtonIntegrator.cpp#L253

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Anton Gladky
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Is there something special hapening to state-ori before step 154675 (manipulation in the script, some specialized clump functions, etc?), because orientation quaternion seems very badly normalized.

A rotation matrix should be skew-symmetric, here you have:
A: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996

I'm not sure it is related to your problem, but it is very strange. Orientation is normalized at the end of leapfrogAsphericalRotate, so it should be ok at the next step. But again at step 154676 it does not give a good rotation matrix.
Something happening at each step, before Newton?!

Revision history for this message
Anton Gladky (gladky-anton) said :
#2

2014-05-19 11:56 GMT+02:00 Bruno Chareyre
<email address hidden>:
> Bruno Chareyre proposed the following answer:
> Is there something special hapening to state-ori before step 154675
> (manipulation in the script, some specialized clump functions, etc?),

No, it is just a free fall of clump and it reaches the floor at the step 154675.
Some more info for previous steps:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b->id: 209; Iter:154673
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
A: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996
....
....
state->ori: 0.9834 0.00922239 -0.153026 -0.0970739
state->angVel: 0 0 0

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b->id: 209; Iter:154674
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
A: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996
M: 0.934319 -0.193747 0.299181
 0.188102 0.980983 0.0478483
-0.302762 0.0115711 0.952996
....
....
state->ori: 0.9834 0.00922239 -0.153026 -0.0970739
state->angVel: 0 0 0

> because orientation quaternion seems very badly normalized.
>
> A rotation matrix should be skew-symmetric, here you have:
> A: 0.934319 -0.193747 0.299181
> 0.188102 0.980983 0.0478483
> -0.302762 0.0115711 0.952996
>
> I'm not sure it is related to your problem, but it is very strange. Orientation is normalized at the end of leapfrogAsphericalRotate, so it should be ok at the next step. But again at step 154676 it does not give a good rotation matrix.
> Something happening at each step, before Newton?!

Hmm, no there is nothing especial. I did not change the code either, as I never
worked with clumps. Interesting is that this clump is not the first one in the
simulation.

Anyway thanks a lot for info! That is something already.

Anton

Revision history for this message
Anton Gladky (gladky-anton) said :
#3

Clumps are generating in this script continuously. And before explosion
happens, there is already in the scene about 15 clumps and there are no
problems with those.

The clump #16 reached the floor and "jumps away" from simulation. Very
strange...

Anton

2014-05-19 13:26 GMT+02:00 Anton Gladky <email address hidden>:
> Hmm, no there is nothing especial. I did not change the code either, as I never
> worked with clumps. Interesting is that this clump is not the first one in the
> simulation.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

Bad mistake, sorry: rotation matrix are not anways skew-symmetric.
The quaternion you show is normalized, as it should. Forget #1...

Revision history for this message
Jan Stránský (honzik) said :
#5

Hi Anton,

do other clumps also interact with the floor? is it possible to check how
much "excentric" is the contact force, i.e. what is the contribution of
shear force? or maybe to check ratio of resulting torque and inertia..

Could you also try to reduce time step (just before the problem) even more?
Although you wrote that reducing time step does not solve the problem.. it
seems to me like stability problems due to time step..

cheers
Jan

2014-05-19 13:46 GMT+02:00 Anton Gladky <
<email address hidden>>:

> Question #248869 on Yade changed:
> https://answers.launchpad.net/yade/+question/248869
>
> Anton Gladky gave more information on the question:
> Clumps are generating in this script continuously. And before explosion
> happens, there is already in the scene about 15 clumps and there are no
> problems with those.
>
> The clump #16 reached the floor and "jumps away" from simulation. Very
> strange...
>
> Anton
>
>
> 2014-05-19 13:26 GMT+02:00 Anton Gladky <
> <email address hidden>>:
> > Hmm, no there is nothing especial. I did not change the code either, as
> I never
> > worked with clumps. Interesting is that this clump is not the first one
> in the
> > simulation.
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Anton Gladky (gladky-anton) said :
#6

Hi Jan,

2014-05-19 14:02 GMT+02:00 Jan Stránský <email address hidden>:
> do other clumps also interact with the floor? is it possible to check how
> much "excentric" is the contact force, i.e. what is the contribution of
> shear force? or maybe to check ratio of resulting torque and inertia..

All clumps are "landing" in the same place on the floor. And only 16th clump
after reaching the floor flies away as well as all following ones
(e.g. 17th, 18th..). Interaction with other clumps as well as initial
overlapping is excluded. I tried \mu=0 (friction),
setting o.dt=0.005*PWaveTimeStep. The result is the same.

I was trying to push the same clump with a really high start velocity
and it works just normally. No NaNs.

It is getting funny :)

Thanks all for the help

Anton

Revision history for this message
Anton Gladky (gladky-anton) said :
#7

There was a bug. Fixed here [1].

[1] https://github.com/yade/trunk/commit/4ea76ad6e47ac5074a389ad61712a0840e8560a5

Thanks all for discussion

Anton