# yade-users team mailing list archive

## Re: [Question #698572]: Is it possible to constrain the motion of a body along a circle

```Question #698572 on Yade changed:

Jan Stránský proposed the following answer:
Hello,

> From what I understand, the rotationEngine forces the body to rotate
about a given axis at a given angular velocity. I want the body to
rotate freely and react to collisions. Is that possible with the
rotationEngine?

Exactly. RotationEngine is for prescribed motion (given, although
possibly changing, but given velocity), not usable for "free" motion.

> If large forces act on the body, I suppose this method will not work
unless the stiffness of the penalty force is increased. But I suppose
this increase would require smaller dt to be stable.

maybe you would need to decrease dt. But maybe not :-) An analysis or at
least a trial-and-error evaluation would be needed to tell the relation
of this "motion constraint" dt and the "normal collision dt"

> So is there any other way to constrain the motion of a body along a
circle, one which does not lower the dt?

I would say yes. You can modify eccentricAxisEngine like this:
- after InteractionLoop, you know the force and torque on your body
- you know position and velocities, you are able to compute the new position (that would be computed by NewtonIntegrator)
- determine actual new position = closest point from the "potential new position" on the desired circle (or surface in a general case)
- modify velocities such that the true NewtonIntegrator results in this desired position on the circle

Just an idea, not sure if it works at all :-D (should) and not sure how difficult would be the "modified velocity" computation.
Let us know if you go this way and if you were successful. I am curious, but currently do not have time to play with it myself.

Cheers
Jan

--