# Rotational Resistance

Asked by Ataollah Nateghi on 2017-07-14

Hello
I am trying to apply very simplified rotational resistance approach proposed by Teufelsbaure in my model. In this approach I am trying to multiply the angular velocity of each particle in all directions by a constant coefficient (something close to 0.99) in each iteration.

w(i+1)x,y,z=A*w(i)x,y,z A=0.99

I am trying to use RotationEnigne however, I am wondering how can assign rotational velocity of a particle from last iteration to it.(Do you think RotationEngine works or I should use another way?)
If it works should I use separate RotationEnigne for each direction or I can apply all in one?
By the way I am very new Python user.
Ataollah

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
2017-07-17
Last query:
2017-07-17
2017-07-14
 Jérôme Duriez (jduriez) said on 2017-07-14: #1

Hi,

For such a task, you first need to define for each corresponding particle "b" :
b.state.blockedDOFs = 'XYZ' (see [1])

so that you can control directly these angular velocities instead of them being affected by resulting torques (if I understood correctly what you want to achieve)

Then, I think you just have to include some PyRunner [2] engine in your engine list (at the end of O.engines, typically) defined as
O.engines = [..........., PyRunner(iterPeriod = 1,command = 'trickRotation()')]

with this trickRotation() Python function defined elsewhere as

def trickRotation():
for b in theListOfParticlesYouWantToPlayWith:
b.state.angVel = 0.99 * b.state.angVel # that's all you need to do to update this velocity !

Jerome

 Ataollah Nateghi (anateghi) said on 2017-07-17: #2

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