[ODE] @@@ check computation of rotational force

Serge Kourdakov serge at sat-sim.org
Fri Jun 13 06:36:01 2003


Petr Sovis wrote

> I don't understand last 2 lines - "computing rotational force" -
> according to: (baraff lagrange multipliers solution && anitescu
> discretization )
>
>      (J IM J^T) lambda = w + J (IM * Fext + vold / dtime)
>      lambda >= 0 && w >= 0 && lambda * w = 0


Sorry if I got something wrong and actually will not give any hints .

But  reading your post I thougth on the following ( not just looking into
ODE code.... :)  and only taking into  my point that I see computations in
global frame...)

why to compute motion in global frame when it is possible to compute in
local frame - which is much easier and less computationally expensive...?

the Newton equations for body local V'  are

m (dV'/dt+w x V') = Sum F

J * ( dw/dt +w x J w) = Sum M

then it is possible to integrate rotations using quaternions

dq0/dt = -1/2 * w* q;

then other three terms of quternion  in vector form

dq/dt = -1/2 * ( w/q - q0*w)

( x denotes cross multiplication( product)  and * or space is dot product
all equations except for dq0/dt are meant to be vector one..)

just after that it is possible to get world rotational matrix from resulting
quaternion...

yes the approach is for unconstrained bodies....
( see for ex http://www.npsnet.org/~zyda/pubs/Presence.1.4.pdf for more
details ( equations 3.18-3.23) they use simplified inertia tensor but this
does not change the overall approach..)

so the point is - is it not easier to compute motion in local frame ( as it
is possible to move all forces to local frame ) then just move the result
( local velocities )  into global velocities and compute the global position
of the body?

seems less computationally expensive than move inertia tensor back and
forth....

Regards
Serge
http://www.vrtainment.de


----- Original Message -----
From: "Petr Sovis" <petr_sovis@hotmail.com>
To: <ode@q12.org>
Sent: Thursday, June 12, 2003 2:19 PM
Subject: [ODE] @@@ check computation of rotational force


> Hi,
> in ODE step.cpp (line 326)
>
> I don't understand last 2 lines - "computing rotational force" -
> according to: (baraff lagrange multipliers solution && anitescu
> discretization )
>
>      (J IM J^T) lambda = w + J (IM * Fext + vold / dtime)
>      lambda >= 0 && w >= 0 && lambda * w = 0
>
> should be Fext -> 2 * 3 * nobjects large vector of | f1 t1, f2 t2, .... |.
> f1e = m * gravity_vector + linear_external_force
> t1e = 0                                             - <<<<<<<<<<<<<<<
that's
> my solution
> t1e -= angvel x ((R Ibody R^T) angvel)  - <<<<<<<<<<<<<<< IN ODE in
step.cpp
>

>
> Anyone can explain me this computation ?
> Thanks in advance
>    Petr Sovis
>
> P.S. @@@ check computation of rotational force. :)
>