maximum or mean velocity

Asked by JOHN

Good evening,
I am trying to stop my simulation when all the particles have come to a rest.
Is there a good way to find the maximum velocity of the particles?
As i read in your documentation [1] the update scheme uses the mean velocity of the previous step, which could perhaps
do the job as well. Is there a way to access this?

Thank you for your time, I didnt include any code as it is the run of the mill yade example.
Cheers
John

https://yade-dem.org/doc/formulation.html#position

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
JOHN
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi John,

something like this?

maxVel = max(b.state.vel.norm() for b in O.bodies)

cheers
Jan

Revision history for this message
JOHN (washingmachine) said :
#2

Hello,
yesm this should do, however I saw that the mean velocity of the previous step is already calculated as a part of the YADE scheme. Is there a way to access this variable? This would propably be more efficient and in my case will be a similar metric to the max velocity
Cheers
John

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

Mean (average) velocity of all particles can be computed similarly:

avgVel = sum(b.state.vel.norm() for b in O.bodies) / len(O.bodies)

"mean velocity during the previous step" from [1] means mean velocity of one specific particle between current and previous time step, not mean velocity of all bodies.
This mean velocity value is simply b.state.vel

chees
Jan

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

> the mean velocity of the previous step is already calculated as a part of the YADE scheme. Is there a way to access this variable?

Hi,
In Jan's #1 answer b.state.vel.norm() is the norm of the mean velocity of b in the previous step (else what would that be?).
Exactly the one defined in the documentation.
Regards
Bruno

Revision history for this message
JOHN (washingmachine) said :
#5

thanks that was really helpful
Cheers
John