Original Post
I'm slowly making my way through the math for constraints, and trying to build a global solver instead of the iterative one most engines use. What's the best way mathematically to solve the constraints all at once? Suppose I've set up my system of equations like this:
| O11 O12 O12 ... | | j0 | | b0 |
| O21 O22 O23 ... | * | j1 | = | b1 |
| O31 O32 O33 ... | | j2 | | b2 |
| ... | | ...| | ...|
The jn are basically the unknown scalar impulse of some particular constraint (It's formulated differently from how it's usually done with Jacobians, etc., but I think it's mathematically equivalent). I can solve that system right now and get the impulses for my constraints. But now I want to add things like friction (secondary impulses) and max/min box constraints. Which sounds suspiciously like some form of linear (or quadratic, etc.) programming. So basically I want to add additional box constraints such as: c0.min <= j0 <= c0.max And also add in secondary impulses (the friction) like so: jf <= j0 * coefficient friction plus some sort of constraint saying that friction can't make an object slide backwards. My current thinking is to first solve the system I present at the top to get all the impulse terms, and then set up a linear programming problem to minimize the difference between the calculated constraints and what they need to be to satisfy the additional box constraints. But that sounds really inefficient since I'm basically solving two slightly different linear systems. Plus I really don't know how to formulate friction mathematically so it can fit in to the system. My thinking is that there's a more complex form of linear programming that will do what I want, and I'm just not familiar with it. Can anyone point me in the right direction for this stuff? I've seen Chris Hecker's presentation on MLCP, and my guess is that there's something here that would help me, but I'm having trouble making heads or tales of it. I also have the Numerical Recipes book, and have been trying to make my way through the linear programming sections. If I could even figure out the optimal way to present the system to be solved, that'd get me a long way.