   implementing semi implicit euler
  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.   
  Does anyone have any ideas?  Does anyone have any information in general about the implementation of a general integrator?Thanks   ;Quote:Original post by daniel_i_l... 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.Hi Daniel,Rather than simply feeding the integration function with an array, I'd give it a predefined struct with clearly defined position, velocity, and force vectors, like this particle struct I use for various different simulation purposes.//  point mass structurestruct PointMass{float mass;//  massfloat radius;   //  radiusvec2f frc; //  force vectorvec2f acc; //  accelleration vectorvec2f vel; //  velocity vectorvec2f psn; //  position vector};Although I'm not using the integration method you request, you may find it useful to look at this example (c++ source code + exe). http://www.jernmager.dk/stuff/cpp/softbody_glfw.zipDon't know if I can be of more help...Cheers & gl,Mike;  Thanks for the help, I'll try what you suggested.   