# Solving the Kinematic Equations using Runge-Kutta

• July 8th, 2011, 08:30 PM
livenail
Solving the Kinematic Equations using Runge-Kutta
I am attempting to write a physics simulation program using the kinematic equations and using Runge-Kutta to solve them to determine how an object will move through space subject to certain gravitational forces etc.

I have x=vt+(at^2)/2 as the equation i need to solve using Runge-Kutta.

I've attempted to find code online to help, but what i've found has been mostly the spring equations, nothing dealing with pure kinematics.
If someone knows of a place i could get code for this, in any programming language it would be much appreciated!
• July 10th, 2011, 06:19 AM
metguru
How much mathematics and physics experience do you have? This is an algebra based equation, and therefore does not need any approximation. The substituted values will solve for a solution and that is the solution. No approximation necessary. RK4 approximation is used for systems of ordinary differential equations. Mainly nonlinear ones. This is because nonlinear differential equations cannot actually be solved. So approximating is the only thing you can possibly do.
• July 11th, 2011, 06:45 PM
bludgeon
if you're dealing with actual equations...you need only write the code to calculate it? Meta took it a bit, too far. Your project is still a determination of "x", though. Depending on the variable missing, that is what becomes 'x'. Meta was jumping ahead to what happens when x becomes a non definable, or non static relativistic variable, imo.
• July 11th, 2011, 08:33 PM
metguru
My explanation was an attempt to show why the Runge-Kutta method was unnecessary. So I agree with you, whether or not my last post seems like it. Maybe a little too much math ranting? :rolleyes: :drink:
• July 12th, 2011, 03:11 AM
bludgeon
Quote:

Originally Posted by metguru
This is an algebra based equation, and therefore does not need any approximation.

You were entirely right.