Sorry for this very simple question but I am still very new to the laws of motion.

I am dealing with 2-dimensional vectors in my programming environment and I'm following these slides to learn about simple integrators.

Near the end of the slides for the 4th Order Runge Kutta Integrator he is calculating acceleration like this:

a2 = acceleration(p2, v2)

However, I'm not quite sure where that function is defined in the slides. I'm sure the answer is very simple but for all prior slides the acceleration was always constant.


closed as off-topic by Qmechanic Jul 9 '13 at 20:30

  • This question does not appear to be about physics within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.


That function is not defined there because you want to use a different one, depending on what kind of motion you're modelling. Using the obvious Newton law $$ a \propto F, $$ you can think of it as calculating the force that acts on your object, e.g. the spring force. In the case of gravitation, you simply put in the constant gravity acceleration downwards.

(I'd like to note that in this case, 4th order Runge-Kutta is something of an overkill as 2nd order is already exact! But it's nevertheless a good idea to use it here, to be consistent: 4th-order Runge-Kutta is used in a very wide range of applications.)

  • $\begingroup$ Sorry but that's what symbol between the a and F mean? $\endgroup$ – John Tylerc Mar 10 '12 at 17:57
  • $\begingroup$ Proportionality. You can also write $F=m\cdot a$, with $m$ constant. $\endgroup$ – leftaroundabout Mar 10 '12 at 17:59
  • $\begingroup$ Alright thanks! Yeah I wrote a console application comparing euler, improved euler, and runge kutta but I can't find a scenario where runge kutta and improved euler don't give the same results.. You said 4th-order runge-kutta is used in a lot of applications.. I hope it's not too off-topic to ask when and why it's needed? $\endgroup$ – John Tylerc Mar 10 '12 at 18:04
  • $\begingroup$ @JohnTylerc: as soon as you have multiple particles interacting in some way, RK4 performs much better. In nontrivial classical physics simulations, there are of course always more than two particles involved (otherwise you'd just calculate the time-evolution analytically, for all times in one go1) – it's certainly different in e.g. game development. $\endgroup$ – leftaroundabout Mar 10 '12 at 23:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.