Inverse of a block K matrix

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
c0der
Posts: 74
Joined: Sun Jul 08, 2012 11:32 am

Inverse of a block K matrix

Post by c0der »

Hi !

When combining a revolute joint and an angle constraint to form the 2x2 block K matrix consisting of four 3x3 matrices below for an elbow joint with restricted angular movement, how do I invert this matrix to solve for lambda, which seems like another matrix of two 3x1 vectors as follows:

A*lambda = b

Code: Select all

// A = JM^-1JT
//
// A = [ Ma^-1 + [~ra]TIa^-1[~ra] + Mb^-1 + [~rb]TIb^-1[~rb]		[~ra]TIa^-1 + [~rb]TIb^-1 ]
//	 [                Ia^-1[~ra] + Ib^-1[~rb]							Ia^-1 + Ib^-1	      ]

// b = -Jvi
//    = [ -va - [~ra]Twa + vb + [~rb]Twb ]
//       [                -wa + wb                 ]
c0der
Posts: 74
Joined: Sun Jul 08, 2012 11:32 am

Re: Inverse of a block K matrix

Post by c0der »

That's cool, I did it in Matlab and it's a 32MB file, so it's much simpler to just apply two constraints to a point separately.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Inverse of a block K matrix

Post by Dirk Gregorius »

In 2D a revolute joint with one limit would result in a 3x3 matrix. If you have N constraints the dimension of the effective mass matrix is N x N. If this isn't your result you made a mistake.

Also note that since you mention a limit you would need to solve a LCP and not a linear system (e.g. using direct enumeration). You can find an example how to solve these kinds of problems in Box2D.
Post Reply