...the best for my problem, that is!
What I have is a projectile simulator I''ve been working on. It''s really neat, you can enter various forces and velocities, and then find the position of a particle as a function of time, or when it will hit the "ground", or the highest point on the trajectory, yada yada. But one feature I wanted to add was the ability to calculate the total distance travelled by the particle as a function of time.
I''ve calculated that I have to integrate the following:
Sqrt( x''2 y''2 + z''2 )
Where x, y, and z are my position-time functions for each axis. So in the end, after squaring all the derivatives and simplifying, I end up with the square root of a quadratic function. Riveting. Now I must integrate that between 0 and
t. Holy cripes.
I''ve searched the web long and hard for different numerical integration methods, but I really don''t know which one I want to use. I''ve heard terms such as Runge-Kutta, Newton-Cotes, Gaussian quadrature, and several dozen other names for different methods. I don''t know where to start! I''ve been doing the most research on Runge-Kutta, but as first glance, it appears to just be a numerical extrapolator, and I really don''t need that (at least I don''t think, you tell me

). So far, I''ve been using the 3-point (Simpson''s) rule to approximate the area, which works fine, but requires a large number of intervals to obtain accurate results. At MathWorld, I started reading about 7-, 8-, 9-, 10-, and 11-point rules, but they look like overkill.
In the end, I need something fast and accurate (don''t we all?). Considering the nature of the problem (square root of a second degree equation), I thought there might be some quick method I have yet to learn that specializes in these types of functions. If you have any ideas, pleast post! Even if they aren''t fast, I''m open to whatever you have to say