Numerically solving position and velocity of a particle

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
cytochrome
Messages
163
Reaction score
3
I have derived a 2nd order differential equation for the position of a particle. I can turn it into a first order ODE by making it an equation for the velocity of a particle, which is easy to solve. Once I have the velocity (which is a large data vector), what is the best way to numerically get the position?

I am using Heun's method for solving the ODE, but I'm confused how to use it for a 2nd order ODE and how to get the velocity AND the position
 
Physics news on Phys.org
Same way you would by hand - integrate it. From calculus you know that,

[tex]x(t) = \int_{t_0}^t v(\xi) d\xi[/tex]

You can do this quite accurately numerically using Gaussian Quadrature.