newton model ?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

newton model ?

Postby tiresius » Fri Oct 16, 2009 5:28 pm

From the main page:
Our engine implements a deterministic solver, which is not based on traditional LCP or iterative methods, but possesses the stability and speed of both respectively. This feature makes our product a tool not only for games, but also for any real-time physics simulation.

Is this still true for Newton 2.0 ? I thought I caught somewhere it has changed to an iterative method (?). Just curious I'm not questioning anything.
An apple fell on my head and I haven't been the same since...
tiresius
 
Posts: 32
Joined: Tue Nov 09, 2004 9:15 pm

Re: newton model ?

Postby Julio Jerez » Fri Oct 16, 2009 6:54 pm

The original solver is still there, but 2.0 use an iterative solver
I should explain what the turn determinism mean. When I wrote that I was thinking of Determinism in the statistical and Mathematical sense,
In my book Determinism is a presses that in independent of the order of the Inputs.
For example say you have the operation

X1 = f (a, b, c, d)
X2 = f (b, d, a, c)

X1 is deterministic if and only if X1 = X2
Say for example f is the operator add

X = a + b + c + d = b + d + a + c

If you are using integer arithmetic, but if you are using floating point then is not because of lost of precision. However you can say that it is deterministic with the realm of machine arithmetic precision.

When I say Newton is determination I mean that, the solution for the solver is the same regardless of the order of the constraints.

Say for example you have a scene like this.


It is determinism that allowed the robotd to be simulated and be Choreograph so the they all look sincrozided.
And system that resolve the joint sequentially can only produce the same result if the Joint are solve in the same order.
I did not mean that produce the same result form run to run.
I was under the impression that from run to run any computer should produce the same result.

To solve that problem I added a function Invalidate Cache that clean all internal intermediate values so in 2.0 you get a dll, that Generate the exact same result from run to run when usin the iterative solve and using invalidate the cache, but it is not deterministic in the Mathematical sense since two equal contraction may not generate the same result.

And a doll that is Deterministic and generate the same run form run to runs when using the exact solver, since the solution is exact within the machine precision regardless of the order of the constrains
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: newton model ?

Postby tiresius » Mon Oct 19, 2009 1:15 pm

So is the iterative solver in 2.0 one that is industry-standard or is it still a home-grown type of solver of your own design?

Oh and do you know of a good Physics Book for beginner that covers Rigid Body physics well? The ones I have from high school only gloss over rigid bodies and collision.
An apple fell on my head and I haven't been the same since...
tiresius
 
Posts: 32
Joined: Tue Nov 09, 2004 9:15 pm

Re: newton model ?

Postby Julio Jerez » Mon Oct 19, 2009 1:58 pm

tiresius wrote:So is the iterative solver in 2.0 one that is industry-standard?

what does that means?

tiresius wrote:Oh and do you know of a good Physics Book for beginner that covers Rigid Body physics well? The ones I have from high school only gloss over rigid bodies and collision.

well there are mathematical concepts, specially in Linear programming, that you need tha you can only get in a graduate school,
High Scholl teaches what need to teach the fundamental principles of Newtonian physics, and math.
It is those basics principles that rule any physical process, but you need the language of Math to put them together.
You can check the internet for paper but in my opinion that does more harm than good to a person who is no prepared to understand why the paper is doing and if it right or wrong.

Usually those paper do some Heresy to the laws of Physics and get something that works fine in some particular case, but fail everywhere else.
When some popular self appointed expert, usefully poor informed in Math and Physics, take one of those paper and make some demo, it take the internet like a storm.
These pseudo laws replace for the real laws of Physics until that stuff start to get stress tested and fail miserably.
This is how we got stuff like Shock Propagation way, Impulse Base physics, Position Correction, Clip Impulse, and another whole bunch of some other non sense.

There truth is that at simple as the laws you are learning in school look to you, those are the Law I use for Newton.
-Force equal Mass time acceleration
-Law of Inertia or Conservation of Momentum
-Principle of Action Reaction.

The different is that you need and advance class in Linear programming to see how they get applied to the problem of multi body dynamics.

My suggestion is this.
Take your time, learn the basics of Math and Physics, you will need the simple thong to go to the more advance thing.
for example if I tell you to calculate a optimal mix of of ingredient for a nutrition supplement given the protein contain and the cost.
This is a typical problem you will se as you start learning advance linear programming.
You will say what does tha have to do with physics?
well it turns out that the Mathematics formation that solve the nutritional problem, also solves the rigid body problem.
but the nutritional problem is intuitive and it is used for learning a branch of mathematic called Constrained optimizations which is at the core of solve physics problems.

Take your time learn the basics, and believe in time if you apply yourself and with teh advances of computers, you will know stuff I can only dream off.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: newton model ?

Postby tiresius » Mon Oct 19, 2009 4:49 pm

Thanks Julio. I think if I learn more vector and matrix math my understanding should go a long way. I don't know if I can tackle Linear programming. :( I went to school for English Literature, not Computer Science (unfortunately).

Julio Jerez wrote:
tiresius wrote:So is the iterative solver in 2.0 one that is industry-standard?

what does that means?

With the previous description of your "deterministic solver" on the website homepage it sounded like the most common methods were iterative or LCP, and that you were doing something different/unique to those. So I was wondering... since now you are using an iterative solver in 2.0, is it different than what other iterative solvers are doing?

Without giving away trade secrets, what makes your iterative solver unique? Perhaps the home page could be updated with this information to (more accurately) show what makes Newton so good.
An apple fell on my head and I haven't been the same since...
tiresius
 
Posts: 32
Joined: Tue Nov 09, 2004 9:15 pm

Re: newton model ?

Postby Julio Jerez » Mon Oct 19, 2009 6:29 pm

Do not be confused. LCP (Linear complementary program) with iterative method, that's missing Orages and Apples.
LCP is a very specific mathematical formulation for a constrained optimization, and it can be expressed like this
Say you have a linear system of equation, given by a matrix M, an unknown variable X and a known variable B
where X and B are vectors, You can write the equation as

M * X = B

Now I will define Complementarrity, and you will see that what you learned in High School apply.
Do you remember in High School when the teacher mentioned complemetarity Angle?
He said two angle are complement when they sum to 90 degree,
Well two vectors defined by those angles are called complementarity vectors, and the have the nice property that their Dot product is zero.
Complementarily is a very nice feature to have, you use it all the time when you make a transformation matrix,
because the axis are perpendicular to each other so their dot product is zero.
It is used in digital signal processing, in data compression, teh duffrence is that those areas the vectors do no have to be uinit lenght
and they can have more than three complements. But teh principle is the same.

Mathematically you can say the two vectors A and B are complementary if and only is
dotproduct (A , B ) = 0

Now going Back to the linear system M * X = B
This system can be solved for X will have only unique solution. Bu teh siolution is unretricted, meaning teh teh componedt of X can me positive or negative.
when you need to solve a linear system but you impose some retrictions on the values that then component of X can take, this is called a linear optimization.

If you remember from you physics classes when you have to calculate the forces to keep a box in equilibrium,
usuatlly they give you a box supported by two contacts at each extrme of eth Box,
you assumed that the contacts will be in the direction of the floor normal, and you calculate the two unknown forces.
Basically you end up solving a 2 x 2 system of equations,

Here is the difference that they did tell you because ti was obviuos. You knew that the forces at the contact point should be positive;
in fact you used that to find out if the solution right or wrong.
Also you knew that the Box was no moving so the acceleration at the contact point was zero, and you also used that to formulate the system of equation.
when you said sume of all force = 0 and sum of all torque = 0. and the allolwed you to get the equations with the two unknowns.

Those two conditions are a way to say the Force vector, (force a the two point, and the acceleration vector are complementary, That is Dot (F (f1, f2) , A (a0, a1) = 0
But the book or the teacher did no tell you that because it was not the goal of the class.
However if teh Box was already accelerating then you could not solve the problem, only when the Box was at rest thsi was posible.
if the Box was acceleration you still can solve the problem but you need to use the more general formula. Bu trhe same prosinple apply.
Now the sum of all forces is equal to the box acceleration, and the sum of all torque are equal to the Box net torque, and that leads to an inequality.

A = M * F – B > 0

Where F are the forces at the contact point and A is the acceleration at each contact and B is a vector that at each contact point tha is a funtion of the
mass, velocity, and position of the contact points.
The condition tah alway prevale is teh complementarity:

DotProduct (F, A) = DotProduct (F, M * F – B) = 0

That is the product of the acceleration at each contact point time the force at each point must be zero.
What that means is that at each point you must have fi * a1 = 0
And the only way this can be satisfied is if fi = 0 or ai = 0,
There is also a this condition and that is that ai must be equal of largert than zero because if it was negative them the box will going into the ground,
If fi must be largest that zero, tha meant the f1 too must be larger than zero.
Now you have the full system given by

f(f) = F dot (M * F - B) = 0
F >= 0
A >= 0

And the set of variable F (f1, f2) that satisfy all those conditions is what is called a Linear complementary problem, or a convex quadratic program.

An iterative method is a way to solve the above set of linear system by station with an initial Guess for all the force, then in each iteration it calculate a better approximation to the solution.
A Direct Method is one that solves the system and finds the unique solution in a finite number of steps.
Bothe Iterative method can be stationary and non stationary, a Stationary method is one the fins the solution by calculation one variable ate a time while keep the other fixed, and non stationary is one the calculate a contribution to all the variables in each iteration,

As you can see there is a lot of terminology that you can only get with practice and time, but it all comes for the fundamentals of the Law of Physics and algebra.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: newton model ?

Postby Julio Jerez » Mon Oct 19, 2009 7:07 pm

Every physics engine and I mean the real ones not the ones that are inventing brand new laws of Physics, must formulate those equation and solve it.
How the equation is solved? is a trade secret, known method are Lemkel, Danzig, witch can use pivoting or Gauss iterations,
there is also Gradient Decent, Conjugate Gradients, and even Secant and Newton iterations.
Now not all physics engines are equal, the solution of these equations is very time consuming,
so you have a group of self appointed mavericks expert that have come up with brand new Law for physics to replace the principle of action reaction wich say
"for each action there is an equal and opposite reaction", action meaning Force.
With the speudo Law "for each impulse there is an equal and opposite impulse" which is false but lead to the same formulation contrained formulation.

There is not such thing are the equal and Opposite Impulse Law, so all the stuff like:
Clip Impulse, Clamp Impulse, Set Mass to infinite, Position Correction, and all the other nonsense you find out there is just mombojumbo.
Basically those are mathematical tricks commercial and open source spin off of Commercial engines, use to find a fast solution to a system
of equation than allows object to move with not penetration but physically incorrect.
They call it Plauble Physics.

Putting a different way, all physical principles can be formulated Mathematically, but not all mathematical formulations are Physical principles.
And that is what the self appoints expert do, they invent a brand new laws of physical in they hope to make the computer to go faster.

Theoretical physicist face that dilemma all the time, because there are many theoretical principles that are consequence
of Mathematical formulation but for which there is not evidence of physical phenomenal.
stuff like worm hole, multiple dimensions, Parallel universe, etc are all mathematical formulation that so far the only application are Science fiction movies,
Experimental physicist spend a lot of time testing for empirical evidence.

The same way Impulsive action Reaction is not a Law of Physics, and the only application are pseudo Physics engine for video Games,
you can never expect a realistic simulation from those things.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: newton model ?

Postby Carli » Tue Oct 20, 2009 4:18 am

That means, newton will once be able to calculate a worm hole?
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: newton model ?

Postby JernejL » Tue Oct 20, 2009 4:53 am

Carli wrote:That means, newton will once be able to calculate a worm hole?


It already supports Parallel universes ( NewtonCreate ), AND wormholes:


;)
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: newton model ?

Postby tiresius » Tue Oct 20, 2009 10:22 am

Julio Jerez wrote:Basically those are mathematical tricks commercial and open source spin off of Commercial engines,
use to find a fast solution to a system of equation than allows object to move with not penetration but physics ally incorrect.
They call it Plauble Physics.

Putting a different way, all physical principles can be formulated Mathematically,
but not all mathematical formulations are Physical principles.
And that is what the self appoints expert do, they invent a brand new laws of physical in the hope to make the computer to go faster.

I've read about Plausible Physics, which sounds like it's physics behavior good enough for people to believe it with their eyes, but it takes serious shortcuts and workarounds with equations. Sounds like it is an old technique needed when computers were very slow and shouldn't be used anymore.

So what you're saying is that Newton uses the real laws of physics as much as possible, while many other physics libraries do not? If true that is very interesting.
An apple fell on my head and I haven't been the same since...
tiresius
 
Posts: 32
Joined: Tue Nov 09, 2004 9:15 pm

Re: newton model ?

Postby Carli » Tue Oct 20, 2009 10:38 am

Delfi wrote:
Carli wrote:That means, newton will once be able to calculate a worm hole?


It already supports Parallel universes ( NewtonCreate ), AND wormholes:


;)

Is it possible to use newton for quantum reserch?

Really nice effects that could be useful for my game, too.
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: newton model ?

Postby fleischman » Tue Oct 20, 2009 11:17 am

I also find that Newton is the most interesting physics engine. But what are your longer term plans for it?

Now that pretty much all physics engines are free (except on game consoles maybe - but I haven't checked that recently), I could imagine that it would be quite hard to make money with it (if you wanted to pursue this route). I know from reading this and other forums that you had some very bad experiences with open source zealots but wouldn't it make sense to go open source nevertheless? You wouldn't have to let anybody touch the core but you for sure could get more help with stuff like tool development, linux compilation,... and I think soon people would notice that your engine is superior and then you probably could also attract support from companies like AMD.

(I am not an open source zealot. I just find this worth a thought and I hope that Newton will have a bright future! :))
fleischman
 

Re: newton model ?

Postby Carli » Tue Oct 20, 2009 1:02 pm

Yes, that's a great reason to go opensource. You don't have to publish a built-up version of newton every release because you can give us the link to your repository and we can build newton for all platforms we want to. (vor example ARM mobile phones)
The LGPL also protects your work and you can be able to get benefits from users.

Support by Companies like AMD (or ATI) is also a great chance - just look at "linux microkernel".....
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: newton model ?

Postby Stucuk » Tue Oct 20, 2009 1:57 pm

I don't see why everyone always wants to make everything open source. "Too many cooks spoil the broth".
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: newton model ?

Postby aqnuep » Tue Oct 20, 2009 2:34 pm

Making some code open-source doesn't necessarily mean that anybody can alter it. It means that people can for example learn from it or figure out that what an actual part of the software is doing why it is not doing what we would expect and stuff like that. I'm also not a big fan of open-source software because as you said usually those are poor quality softwares but there are some benefits as well for sure.
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron