How to read the force value

Asked by Felipe

Hello everybody,

I would like to know how to read the force value to apply on the conditional formula, like the example below that i'm using the position of body.

example -> if O.bodies[543].state.pos[1] > 25 and O.bodies[390].state.pos[0] < -35:

Is it possible to do it anything similar?

I am very interesting to using the force value to give one conditional to move another body. The proposal is while the force don't reach the minimum value, the next body wont move.

##Conditional
if O.force.f[540] > 1000
O.engines=O.engines+[TranslationEngine(ids=rod2,translationAxis=[1,0,0],velocity=1,dead = False)]

Thanks for any comments.

Felipe

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Best Jérôme Duriez (jduriez) said :
#1

Hi,

It seems to me the answer is directly in the question. The force acting on any body "b" is obtained by typing

O.forces.f(b.id)

See https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.f
Not surprisingly, it returns a vector (which can not be directly tested for ">/<" )

Revision history for this message
Felipe (felipetthadeu) said :
#2

Thanks Jérôme Duriez, that solved my question.