# Clumps+Eigen problem

Bug #577581 reported by Anton Gladky on 2010-05-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Undecided
Unassigned

### Bug Description

Clumps are working strangely with Eigen library. Part of them disappear, some of them behave wrongly.

It can be seen in ./examples/regular-sphere-pack and ./examples/buldozer

## Related branches

 Václav Šmilauer (eudoxos) wrote on 2010-05-09: #1

Could you check that clump's inertia is computed the same for eigen and wm3? I just cut&pasted what you did for wm3-eigen into the matrixEigenDecomposition function. If that's correct, I will have a look at other possible causes.

 Anton Gladky (gladky-anton) wrote on 2010-05-10: Re: [Bug 577581] Re: Clumps+Eigen problem #2

Ok, I will try.
______________________________

2010/5/10 Václav Šmilauer <email address hidden>

> Could you check that clump's inertia is computed the same for eigen and
> wm3? I just cut&pasted what you did for wm3-eigen into the
> matrixEigenDecomposition function. If that's correct, I will have a look
> at other possible causes.
>
>

 Václav Šmilauer (eudoxos) wrote on 2010-05-13: #3

I just tried with scripts/test/clump.py and got no weird effects.

Running

O.bodies.appendClumped([utils.sphere((0,0,0),1),utils.sphere((0,0,2),1)])
print O.bodies[2].state.mass, O.bodies[2].state.inertia, O.bodies[2].state.pos, O.bodies[2].state.ori

gave me this with eigen:

8377.58040957 Vector3(11728.612573401895,11728.612573401895,3351.0321638291125) Vector3(0,0,1) Quaternion((1,0,0),0)

and this with wm3:

8377.58040957 Vector3(3351.0321638291116,11728.612573401895,11728.612573401895) Vector3(0,0,1) Quaternion((0.57735026918962584,0.57735026918962584,-0.57735026918962584),2.0943951023931957)

so it only seems as difference in the ordering of principal axes (didn't check by hand, but it looks so)

I should make one that I compute by hand and check it.

Sorry, I had no time to check it yet.
But I tried to start ./examples/regular-sphere-pack script. There are also
some clumps.
Several clumps merely disappear after first simulation step.

I had the same weird behavior previously, while eigen was in testing stage.

______________________________

2010/5/13 Václav Šmilauer <email address hidden>

> I just tried with scripts/test/clump.py and got no weird effects.
>
> Running
>
> O.bodies.appendClumped([utils.sphere((0,0,0),1),utils.sphere((0,0,2),1)])
> print O.bodies[2].state.mass, O.bodies[2].state.inertia,
> O.bodies[2].state.pos, O.bodies[2].state.ori
>
> gave me this with eigen:
>
> 8377.58040957
> Vector3(11728.612573401895,11728.612573401895,3351.0321638291125)
> Vector3(0,0,1) Quaternion((1,0,0),0)
>
> and this with wm3:
>
> 8377.58040957
> Vector3(3351.0321638291116,11728.612573401895,11728.612573401895)
> Vector3(0,0,1)
>
> Quaternion((0.57735026918962584,0.57735026918962584,-0.57735026918962584),2.0943951023931957)
>
> so it only seems as difference in the ordering of principal axes (didn't
> check by hand, but it looks so)
>
> I should make one that I compute by hand and check it.
>
> --
> Clumps+Eigen problem
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Yet Another Dynamic Engine: New
>
> Bug description:
> Clumps are working strangely with Eigen library. Part of them disappear,
> some of them behave wrongly.
>
> It can be seen in ./examples/regular-sphere-pack and ./examples/buldozer
>
> To unsubscribe from this bug, go to:
>

 Changed in yade: milestone: none → 0.5

After first step regular-sphere.....py several clumps rotate for about 90degrees.
Then the behavior more-less normal.

 Bruno Chareyre (bruno-chareyre) wrote on 2010-05-24: Re: [Yade-dev] [Bug 577581] Re: Clumps+Eigen problem #6

It really sounds like a axis-ordering problem, as suggested by Vaclav above.

I have just compared the "left leg" parameters from regular-sphere-pack.py.
The only one difference is in ori:

WM3:
Quaternion((0.67370345435821666,-0.34789334947257838,0.65199223383300886),2.4927476592092566)
Eigen:
Quaternion((0.6545924830602815,-0.33764604960977579,-0.67639029140274298),1.344135865637631)

I think the problem is in EigenDesomposition.
______________________________

> It really sounds like a axis-ordering problem, as suggested by Vaclav
> above.
>
> --
> Clumps+Eigen problem
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Yet Another Dynamic Engine: New
>
> Bug description:
> Clumps are working strangely with Eigen library. Part of them disappear,
> some of them behave wrongly.
>
> It can be seen in ./examples/regular-sphere-pack and ./examples/buldozer
>
> To unsubscribe from this bug, go to:
>

I have spent yesterday 2 hrs trying to find what is the problem in.
But with no result. Will try again.

The problem is definitely with "ori" quaternion, but where...
Actually, I think clumps.* should be completely reworked as there are some
"fixmes", "errors" and commented code.
It needs to be cleaned up completely.

When I have time, probably, I will try to do it, but first I should
understand, how it is working.

 Václav Šmilauer (eudoxos) wrote on 2010-06-02: #9

Please try with 2266 and close if appropriate. I tested both regular-sphere-pack and bulldozer and they work fine here.