# Looking for very simple implicit integration example

I am trying to design a robust cloth system. I have no problem at all simulating things like that using forward integration such as euler, midpoint, runge-kutta, verlet, etc. However, I just can't wrap my head around implicit methods.

I don't understand how you formulate the equations in linear algebra terms. I'd really like to see a VERY simple tutorial, and an actual example of how to construct the equations, and then solve for a very simple system (for example, 3 particles connected by 3 springs).

I looked into David Baraff's Large Steps in Cloth Simulation, and I can kind of follow it, but going from equations to code is a weak spot of mine.

I can use a package like eigen to solve, but I'd also really like to see some code for something like conjugate gradient descent. I don't care about efficiency at the moment, I just want to be able to clearly understand what's going on.

Thanks

-
I'm also interested in a detailed/step-by-step tutorial on how to properly implement more pretentious integrators. While I tampered a bit with the implicit Euler by solving a nonlinear equation using the Jacobian/Newton's method, it was not good enough. I then found OpenCloth (on google code). You can see the Exact code you requested here: code.google.com/p/opencloth/source/browse/trunk/… . It would be nice to also get a more tutorialish explanation with some figures "and stuff". – teodron Apr 16 '13 at 10:15
Fantastic! That's exactly the kind of thing I was looking for. I'm going to dig in right now, yummy! Cheers – DaleyPaley Apr 17 '13 at 1:50
It's worth mentioning that OpenCloth encompasses almost all major numerical integration methods for cloth-like objects. This piece of web deserves a lot more attention. I'll try to write a tutorial sometime in the near future (this year), as I also cannot find anything dealing with the implementation details for a not-so mathematical person. – teodron Apr 17 '13 at 6:40
@teodron: This was a good question, and seems to have been answered. Can one or both of you write up the answer, for the assistance of later members who visit this question? – Pieter Geerkens May 4 '13 at 20:12