Take the 2-minute tour ×
Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free, no registration required.

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.

share|improve this question
    
Related: physics.stackexchange.com/q/18173/2451 –  Qmechanic Mar 10 '12 at 17:40
1  
You may be interested in gamedev.stackexchange.com as well. –  Manishearth Mar 11 '12 at 1:06
    
This question appears to be off-topic because it is seems to more about software than physics. –  Qmechanic Jul 9 '13 at 20:30
add comment

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.

1 Answer

up vote 0 down vote accepted

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.)

share|improve this answer
    
Sorry but that's what symbol between the a and F mean? –  John Tylerc Mar 10 '12 at 17:57
    
Proportionality. You can also write $F=m\cdot a$, with $m$ constant. –  leftaroundabout Mar 10 '12 at 17:59
    
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? –  John Tylerc Mar 10 '12 at 18:04
    
@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. –  leftaroundabout Mar 10 '12 at 23:05
add comment

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