For the general form, for other types of constraints, refer to Claude's thesis. This is valid only for linear homogeneous constraints. The Jacobian projects the generalized coordinate, so Gq is simply the constraint error. I rarely login here, so sorry for not responding quickly. Hmm, not sure this was a simple explanation, but I did my best Bullet and Box2D, but with some subtle but very important differences i signs and parameters, and also with a systematic way of dealing with physical regularization, which in turn can be used for modeling (constraint relaxation) and also makes the equations much easier to solve since the conditions numbers are improved dramatically. One result of this approach is a Schur complement equation that is very similar to the system of equations in e.g. This gives a powerful and systematic framework for modeling friction. The method also allows for dissipation to be modeled using Rayleigh dissipation functions. It can be shown that this is indeed a irreversible principle, that is, it is possible to to do the continuum limit and reproduce differential equations, but there's no obvious way to discretize the differential equations resulting in the variational stepping equations. Instead you derive a stepping equation directly from the discrete variational principle.
The advantage of all this is that you don't have to first go to a differential equation and then apply all kinds of ad hoc discretization and stabilization principles. A combination of stabilization and damping gives a very efficient method also for large timesteps. rather than enforcing strict constraint stabilization, the constraints are allowed to fluctuate somewhat near the constraint surface. The SPOOK method ensures that constraints are fulfilled "on the average", i.e. The variational framework ensures that the constraint stabilization is efficient and respects the (discrete) conservation laws. You can also add constraints to this framework, and then apply various methods to stabilize these constraints. For simple unconstrained systems you can for example derive leapfrog/verlet integration methods this way, but funny enough it is impossible to derive explicit Euler this way, which yet again proves how broken it is. What it means is that you start from a Lagrangian formulation and you discretize this Lagrangian and then apply a discrete variational (least action) principle. Raigan2 wrote:Is there any chance of a simple explanation of "variational methods"? So far I've read the thesis twice and have yet to understand it well enough to implement.