Centripetal and Coriolis (fictitious) forces - implemented??

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Mon Aug 23, 2010 10:25 am

I was experimenting with some gravity models and I noticed a very life-like behaviour - which makes me think that Newton GD engine has Centripetal and Coriolis forces already implemented - is that correct? What I mean is, the Centripetal and coriolis forces are already calculated into the solution, and the object will behave as it should, given the forces USER applies to it. Am I correct?

Misho
Last edited by misho on Mon Aug 23, 2010 12:59 pm, edited 1 time in total.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby PJani » Mon Aug 23, 2010 11:53 am

Jp u are correct. :D
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Mon Aug 23, 2010 11:57 am

WOW - thanks! My Spaceflight model is turning out to be a walk in the park!!! :mrgreen:

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Mon Aug 23, 2010 6:24 pm

Okay - I've set up a simple orbital model without any problems. One thing to note: Contrary to WIKI, I WAS able to set Linear Damping to zero: (and thus, I think, eliminate drag completely).

NewtonBodySetLinearDamping( pPlanet, 0.0f);

Everything works well, except: where I was expecting to get a perfectly circular orbit, I get slight eccentricity (ellipse, instead of a circle). Anyone knows why?

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby PJani » Mon Aug 23, 2010 6:40 pm

because in nature nothing is perfect ;) you will not get circular movement!!!!! If you look motion of planet around sun you will see a elliptic path. Hardly you will get perfect circular motion.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Mon Aug 23, 2010 9:43 pm

I agree about the nature, but MATH is pure - and that's what I thought we have here. Do you have at least a math explanation for eliptical motion? Perhaps the damping of 0 is not exactly 0 but some miniscule amount that is necessary to keep the math away from singularities? hmmm? :D Thanks!!

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby PJani » Mon Aug 23, 2010 10:50 pm

misho wrote:I agree about the nature, but MATH is pure - and that's what I thought we have here. Do you have at least a math explanation for eliptical motion? Perhaps the damping of 0 is not exactly 0 but some miniscule amount that is necessary to keep the math away from singularities? hmmm? :D Thanks!!

Misho


I dont think the damping is the problem.

How exactly do you start moving the "satellite"(tangent direction, stationary position, ...)? What formula do you use for calculating force? What constants do you use(if you use Fg = G (m1*m2)/(d^2))? On what distance is your "satellite"?

Every variable can cause eliptic movement...
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Mon Aug 23, 2010 11:48 pm

PJani wrote:I dont think the damping is the problem.

How exactly do you start moving the "satellite"(tangent direction, stationary position, ...)? What formula do you use for calculating force? What constants do you use(if you use Fg = G (m1*m2)/(d^2))? On what distance is your "satellite"?

Every variable can cause eliptic movement...


thanks for your help PJani!

I have set up the force vector to always point to the origin, 0,0,0 by normalizing the position and multiplying it by -mass*9.81

I have then created a NewtonCollisionBox body and set it into motion tangentially, at 15 "up" units distance, by givng it a z velocity of approx 12.13 (calculated this to be a centripetal force needed to counteract the gravity). The set up looks like a clock, with its hand at noon at zero time, going clockwise. When I set it into motion, all is well except the slight eccentricity.

I admit, it is a VERY simplistic setup...
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby PJani » Tue Aug 24, 2010 12:51 am

eliptic motion can be caused by floating point error, too. :?

hmm do you set velocity at begining directly?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby Julio Jerez » Tue Aug 24, 2010 8:19 am

The engine does use Coriolis forces because they are and emergence behavior in the form of acceleration generated by the effect of a body
changing the direction of his instant direction of its angular momentum vector as it spins.
This comes natural from any force based formulation of a Lagragian constraint solver.

This is one for the feature that separates Newton from other commercial Physics which are Impulse bases physics formulation and completely disregard emerging forces that result from the second order nature of the problem.
Impulses are not forces, they act like forces in the sense that they change the velocity of a particle,
But they do that instantaneously while a force requires time to do so. It is during that time that the effect like Coriolis and centripetal acceleration are generated, Impulse can never do that.

This also Separate Newton from the so called "Open Source Physics engine" which are just copies of older version of commercial engines re-written by ex employee of those companies after they
no longer are employed by the company, These are even worse than impulse base because these add twist to hide the Plagiarism, but in fact these twist are brand new laws of physics that go by silly names like: Clamp Impulse, Damp Velocity, Shock Propagation wave, and so on, that generates really estrange and unfamilliar physic solutions.

The Laws of Physics were written step by step is a very large period of time, and there is three fundamental principles that any simulation must abide by:
Inertia, acceleration proportional to net force, and conservation of momentum also known as action reaction.

Physics engines based on Impulse violate one or two of those laws, must like conservation of momentum.
And no Brand New Law of physics has ever being proven to respect all those these principles simultanesully.

In respect of the accuracy of the solution you get with newton, that goes to the integration method use by the engine
which in the newton engine is a Newton-Stormer method, also known as Symplectic integration metod to integration the body motion.
Newton-Stormer integration is bether than Euler and Runge Kutta order one and two, but no better than RK 4 or 5

you can see some comparative anality of the error of different integation methods here
http://wiki.vdrift.net/Numerical_Integration

The reason you will get drift in the orbit is no because of float errors, float error are present in all numerical calculation, but because the accuracy of a first order integration scheme is no enough to produce accurate result at large scale integration like orbital calculation.

Calculating orbital integration is a very hard problem on celestial mechanic, and the methods integration method use are RK4 and RK 5 order predictor corrector integration. But those integration method require the evaluation of derivative several time during a single tome step, Newton does no use that because the scope in real time small scales rigid body mechanics.


one thing that you can do to improve acuracy of the integtaor is to just use a higher timestepping
it is quite simple to see how that improve stability and acuracy
because the acuracy of the integration is O(k * dt^2)
so using dt = 0.5 * dt makes k four time smaller.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Tue Aug 24, 2010 10:42 am

PJani - thanks again, yes, I set velocity just after I create the body:

dFloat dVelocity[3] = {0.0,0.0,12.130539971493437191888237327736f};
NewtonBodySetVelocity( pPlanet, dVelocity);


Julio - thanks so much!! Indeed, setting

#define DEMO_PHYSICS_FPS 1000.0f

(from the original 120) completely eradicated the error without diminshing speed!! I'm loving this, and I'm glad to hear that I chose the "right" engine for my application. I am building an orbital simulator (launch from Earth surface to up to 500km orbit) so I think (I hope) Newton GD will be able to handle these relatively small-scale orbial mechanics.

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby PJani » Tue Aug 24, 2010 11:04 am

Julio Jerez wrote:The engine does use Coriolis forces because they are and emergence behavior in the form of acceleration generated by the effect of a body changing the direction of his instant direction of its angular momentum vector as It spins.
This comes natural from any force based formulation of a Lagragian constraint solver.

This is one for the feature that separates Newton from other commercial Physics which are Impulse bases physics formulation and completely disregard emerging forces that result from the second order nature of the problem.
Impulses are not forces, they act like force in the sense that they change the velocity of a particle,
But they do that instantaneously while a force requires time to do so. It is during that time that the effect like Coriolis and centripetal acceleration are generated, Impulse can never do that.

This also Separates Newton from the so called "Open Source Physics engine" which are just copies of older version of commercial engines re-written by ex employee of those companies after they
no longer are employed by the company, These are even worse than impulse base because these add twist to hide the Plagiarism, but in fact these twist are brand new laws of physics that go by silly names
like Clamp Impulse, Damp Velocity, Shock Propagation wave, and so on, that make really estrange physic solutions.

The Laws of Physics were written step by step is a very large period of time, and there is three fundamental principles that any simulation by abide by:
Inertia, acceleration proportional to net force, and conservation of momentum also known as action reaction.

Physics engines based on Impulse violate one or two of those laws, must like conservation of momentum.
And no Brand New Law of physics has ever being proven to respect all those there principles simultanesully.

In respect of the accuracy of the solution you get with newton, that goes to the integration method use by the engine
which in the newton engine Newton-Stormer method, also known as Symplectic integration metod to integration the body motion.
Newton-Stormer integration is bether than Euler and Runge Kutta order one and two, but no better than RK 4 or 5

you can see some comparative anality of the error of different integation methods here
http://wiki.vdrift.net/Numerical_Integration

The reason you will get drift in the orbit is no because of float errors, float error are present in all numerical calculation, but because the accuracy of a first order integration scheme is no enough to produce accurate result at large scale integration like orbital calculation.

Calculating orbital integration is a very hard problem on celestial mechanic, and the methods integration method use are RK4 and RK 5 order predictor corrector integration. But those integration method require the evaluation of derivative several time during a single tome step, Newton does no use that because the scope in real time small scales rigid body mechanics.


one thing that you cna do to improve you acuracy of teh integtaor is to just use a hieghet time step
it is quiet simple to see how that imprve stabolity and acuracy
becauise the acurace of the integration is O(k * dt^2)
so using dt = 0.5 * dt makes k four time smaller,



Holy cow i didn't know that. :shock: Nice work Julio.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Tue Aug 24, 2010 3:20 pm

Ok, a few more questions related to the tutorials. I am using the tutorial structure as a basis for my project - that means, I am using Entity class. My question is,

How do I create a CompoundCollision from 2 entities I created? I have:

compoundObject = NewtonCreateCompoundCollision (world, 2, shape, 0); // "shape" is an array of two collisions.
CompoundBody = CreateRigidBody (world, ??, compoundObject, 10.0f);


However, CreateRigidBody call wants an Entity in the 2nd parameter. What do I use here?

I also looked into CreateNewtonCompoundFromEntitySubmesh, but I don't understand how to add sub-meshes into a single entity?
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby misho » Wed Aug 25, 2010 12:58 pm

*bump*... Anyone?
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Centripetal and Coriolis (fictitious) forces - implemented??

Postby Julio Jerez » Wed Aug 25, 2010 2:41 pm

The entity is a hack in structure to demostrated the physics. doing any more complex by makking t supposty subMaterial and it ebnd up
in complexities that might confuse othe begginers.
The reason for its simplicity is eassy comprehension by begginers, It is not for meant to be Game structure for production,
Do you have your own game entity?
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 218 guests