On NewtonUserJointSetRowAcceleration

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

On NewtonUserJointSetRowAcceleration

Postby zak » Thu Nov 20, 2008 1:47 pm

I have motorized a custom hinge joint with
Code: Select all
NewtonUserJointAddAngularRow(pJoint, o.of, pin);
NewtonUserJointSetRowAcceleration(pJoint, acceleration);
and it is OK.

But if i write for example in that joint with world (parent = NULL) a fixed acceleration
Code: Select all
NewtonUserJointSetRowAcceleration(pJoint, 0.5f);
i expect an increasing angular velocity of child body to infinity. Instead i have an initial acceleration and then the velocity remains constant. No other forces applicated.

I don't understand this behavior.
zak
 
Posts: 58
Joined: Mon Dec 06, 2004 9:30 am

Re: On NewtonUserJointSetRowAcceleration

Postby Julio Jerez » Thu Nov 20, 2008 3:48 pm

Your observation is totally correct. However there are many factors why this do not happens.
-we are using a numerical approximation, and in this case you are integration and angular acceleration, which lead to very high numerical error.
-The bodies have default drag values.
-In Newton the integrator is set such that a spin more than 1/4 a revolution in one frame the displacement is clamped.
This is don’t because if a body spin more that hap a revolution in one frame the simulation is meaningless.

I cannot imagine a situation when you want an infinity angular velocity, because this is a phenomena that is impossible. No even is nature.
Newtonian Laws states that a body velocity will increase with the acceleration, therefore the velocity with a body should increase to infinity under contact acceleration, but that is only the in the range of Newtonian [physics, when the velocity is too high the relativistic effect take place and prevent the velocity for increasing.

In a compute simulation do not know about those laws, but a computer is suggest to much more several laws, that is discrete mathematics and linear range. I am not going to lecture you on discrete math here, but in essence the profiles of discrete math state the for a numeral simulation to be faithful to reality, you need the sampling rate cannot be too space,
So what happen Is the when the velocity because too high the step are so big that numeral error creep in and you can no recover the information in the simulation.

These happen in all aspect of nature, if you take a spring and you stretch h it, you can only do it so much until the material the spring is made of no longer ovary the law of Hook.

There is no free Launch the law of nature we find a way to prevent infinity form happening.

In Newton what I do it to limit the max rotation to ¼ of a revolution.

If you want the velocity to go higher you can do this:
Reduce the time step, set angular drag to zero.
Julio Jerez
Moderator
Moderator
 
Posts: 11154
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: On NewtonUserJointSetRowAcceleration

Postby zak » Sat Nov 22, 2008 7:18 am

Thank you for deepening
zak
 
Posts: 58
Joined: Mon Dec 06, 2004 9:30 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests