Solving the Kinematic Equations using Runge-Kutta

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 · 5K views
livenail
Messages
1
Reaction score
0

Homework Statement


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.

Homework Equations


I have x=vt+(at^2)/2 as the equation i need to solve.
Same in the Y direction.

The Attempt at a Solution


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 language it would be much appreciated!
thanks in advance
 
Last edited:
on Phys.org
In general you need to transform your problem into a set of first order ordinary differential equations with one equation for each independent state variable. Assuming you want to calculate your trajectory in 2D you would then have 4 state variables (the 2 position components x and y, and the 2 velocity components u and w) and the equations for constant acceleration ax and ay would then be something like du/dt = ax, dw/dt = ay, dx/dt = u, dy/dt = w.

Having a set of first order ODE's you can start applying a numerical method to solve it [1], like Runge-Kutta [2].

[1] http://en.wikipedia.org/wiki/Numerical_ordinary_differential_equations
[2] http://en.wikipedia.org/wiki/Runge–Kutta_methods
 
livenail said:

Homework Statement


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.

Homework Equations


I have x=vt+(at^2)/2 as the equation i need to solve.
Same in the Y direction.

The Attempt at a Solution


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 language it would be much appreciated!
thanks in advance

What language are you going to be working in?