Original Post
I'm currently trying to write a general integrator. Most of the material on the web recommends making the integrate function receive a vector of doubles as the state and a function pointer to a "getDerivative" function which the integrator can use to figure out the derivative at some future point in time. This is needed for RK4 for example. So the integrate function looks like: integrate(double[] initial, double[] final, time t0, time t1, getDerivative) where initial and final are vectors constructed from all the state information (positions, velocities, rotations,...) But I don't understand how this information can be used to implement a semi implicit euler integrator. For the SIEI to work it has to first integrate the velocities and then use those to get the new positions. But if the input is just an array of doubles how does it know which part of the input is the velocity and which is the position? Thanks.