Hi, I am learning YADE now and I have some questions that I still can't figure out after consulting the documentation.
1. What's the 'inertia' mean, and what's it for. Why is it a vector?
2. What's the difference between 'sys.exit(0)' and 'O.pause'?
3. What's the difference between 'O.dt=Utils.PWaveTimeStep' and 'O.dt=PWaveTimeStep', 'unbalancedForce' and 'Utils.unbalancedForce'? What's 'Utils'?

Thank you.

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
 Revision history for this message Jan Stránský (honzik) said on 2022-03-18: #1

Hello,

> I am learning YADE now

welcome :-)

> 1. What's the 'inertia' mean, and what's it for. Why is it a vector?

Do you mean inertia in general or body.state.inertia?
Inertia is used as a mass counterpart for rotational motion, see [1].
Normally for rotational motion, inertia is inertia tensor. In calculations represented e.g. as inertia matrix.
In the frame of principal directions of inertia, the inertia matrix is diagonal ("(constant) inertia matrix; diagonal, since in local, principal coordinates" in [1]), so only 3 components are needed to be stored.
The implementation choice was to use a vector.
Vie rotation matrix, the diagonal "local" inertia matrix can be represented w.r.t. other frames/coordinate systems, e.g. global coordinate system.

> 2. What's the difference between 'sys.exit(0)' and 'O.pause'?

sys.exit is Python standard function [2], typically exiting entire Python session.
Normally you cannot do anything else in Yade after it.

O.pause is Yade function [3,4], pausing a running simulation. Afterwards, in Yade you can do whatever you want - typically export results, check some conditions, continue simulation, ...

> 3. What's the difference between 'O.dt=Utils.PWaveTimeStep' and 'O.dt=PWaveTimeStep', 'unbalancedForce' and 'Utils.unbalancedForce'? What's 'Utils'?

be careful for the case of letters U/u. Typically, "Utils" is nothing in Yade, but "utils" is.

For convenience, Yade import some modules by default, something like
so you can use all utils stuff conveniently "out of the box".
(I cannot find this in docs, but I remember it was mentioned somewhere).

You can always use explicit "namespace" utils.whatever in the case of name clashes, e.g.:
###
f1 = unbalancedForce() # yade's utils.unbalancedForce
#
def unbalancedForce(): # some user defined function
return 3.14
f2 = unbalancedForce() # user defined function
f3 = utils.unbalancedForce() # yade's utils.unbalancedForce
###

Cheers
Jan

 Revision history for this message Huchao (864441330hc) said on 2022-03-18: #2

Thanks Jan Stránský, that solved my question.