pb with hingeActuator joint in Dynamic

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: pb with hingeActuator joint in Dynamic

Postby Julio Jerez » Mon Mar 26, 2018 11:38 am

The parallel solver was a total failure.
I only have me to blame because I knew going in that jacobi method is not guarantee to converge for PSD matrices.
I got exicted when I saw the simple stack converging so thought it was enough proof to go a head, but the result is a disaster.
The reason is that the simple stack generates a tri-diagonal matrix without loops which is strict diagonal dominant, but the general joints array do no generate those kind of matrices, in fact the general joints generate ill condition matrices with many loops.

I committed the code anyway, some one day I can try some other methods that apply preconditioners to the matrix, but for now I will shelve that project and focus on the joints against.

What is committed is not stable, wait until tonight until I disable the bogus code.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: pb with hingeActuator joint in Dynamic

Postby blackbird_dream » Mon Mar 26, 2018 12:20 pm

To vanquish without peril is to triumph without glory.
hold on.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: pb with hingeActuator joint in Dynamic

Postby Julio Jerez » Mon Mar 26, 2018 3:37 pm

I did find a couple of logical bug, but that does not solve the problems.
Basically this is one of those cases where I applied a toll to the wrong problems.
in come down to this,

if you have a matrix linear system represented by a M[n x n] matrix.

you can determine If some par5ticaul algorithm will converge by calculation what is called the Spectral radio of the matrix and apply to the algorithm step.
https://en.wikipedia.org/wiki/Spectral_radius

In general these are pedant exercises with more academic value that practical value until you try to apply the wrong algorithm to a system.
you end up debugging the problem and tweaking it to find a compromise s9olution for one set for problems only to have it fail when applied to a different set of problem, and that was what I did the last two week. Shame on me because I know better than that and I ignored the theory.

you can not really determine the Spectral radio to a system at run time because this required extreme expensive, however a lot of smart people has done these analysis and we can just use the results. https://en.wikipedia.org/wiki/Jacobi_method
and indeed the Spectral radios of any small system with a loop is larger that 1.0, therefore Jacobi a naïve will never work.

for example a very simple system like tow ball on top of each other
will yield a systm like this
M = 2 1
1 1

and the Spectral radio of the system using Jacobi iteration is precisely 1.0
this mean that system will converge astatically in a infinite numeral of iterations.
by any perturbation If the system say the main diagonal becomes say

M = 1.3 1
1 1
and the Spectral radio will be much larger that 1.0 which mean that in theory that system will diverge. There are many, many paper that explain this, and I ignored them, for example
http://mathfaculty.fullerton.edu/mathew ... elMod.html
quote:
... The "true" sufficient condition for Jacobi iteration to converge is that the "spectral radius" of is less than 1, where is the diagonal of That is, the magnitude of the largest eigenvalue of M must be less than 1. This condition seems harsh because numerical computation of eigenvalues is an advanced topic compared to solution of a linear system.


which is what I did last night to see if I was doing some wrong or not, in newton this is easy because we have function to calculate then using traditional methods and indeed almost any single matrix has plenty larger than one eigenvalue, even a simple box resting on a floor will have larger than one eigenvalue unless the main diagonal is scaled by some regularizer, therefore Jacobi is just a prohibited algorithm we need something better.

The way to solve the problem is by applying a transformation the system that augment it making a larger much larger system but that has a simple solution because it add sparsity.
These method are available but required some work, I will probably do it but not for 3.14
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: pb with hingeActuator joint in Dynamic

Postby blackbird_dream » Wed Mar 28, 2018 5:52 am

can you address the joint changes by telling me what Newton version to use compatible with the second last Unity plugin ?
I've tested a lot of NDbuilds which do not match the 15/3/18 unity build (ee38fae).
Thks beforehand.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: pb with hingeActuator joint in Dynamic

Postby blackbird_dream » Wed Mar 28, 2018 12:07 pm

I suspect there is something wrong in the unity plugin also with joints. Not only a matter of processing joints with // algorithms.
It s how the gizmo behaves that makes me think there is smthing wrong.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: pb with hingeActuator joint in Dynamic

Postby Julio Jerez » Wed Mar 28, 2018 2:07 pm

I said I was going to get the plugin in and see what is wrong, but I spend all my time on some else pass weekend, I will try to get it and see why is wrong
there are many changes, that I would be surprised if they work by just compiling the code.
One big difference is that self collision if far more harmful now than is use to, in is not left to the end application.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: pb with hingeActuator joint in Dynamic

Postby blackbird_dream » Wed Mar 28, 2018 2:59 pm

ok thks
please test my basic demo as case study for the joints. The 3 axes must intersect (unity Nbody gizmo frame, Vector.down attached to the Nbody and MeshObject axis).
PS: there are no colliders in the demo
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 13 guests

cron