Solving the Kinematic Equations using Runge-Kutta

Click For Summary
SUMMARY

The discussion focuses on using the Runge-Kutta method to solve kinematic equations for simulating the motion of an object under gravitational forces. The primary equation referenced is x = vt + (at²)/2, applicable in both X and Y directions. Participants emphasize the need to convert these equations into a set of first-order ordinary differential equations (ODEs) with state variables for position and velocity. The conversation highlights the challenge of finding relevant code examples, as most available resources pertain to spring equations rather than pure kinematics.

PREREQUISITES
  • Understanding of kinematic equations, specifically x = vt + (at²)/2
  • Familiarity with ordinary differential equations (ODEs)
  • Knowledge of numerical methods, particularly the Runge-Kutta method
  • Proficiency in at least one programming language for implementation
NEXT STEPS
  • Research the implementation of the Runge-Kutta method in Python or MATLAB
  • Study the transformation of second-order kinematic equations into first-order ODEs
  • Explore existing physics simulation libraries that utilize kinematic equations
  • Learn about numerical stability and error analysis in solving ODEs
USEFUL FOR

This discussion is beneficial for physics simulation developers, students in computational physics, and programmers interested in numerical methods for solving differential equations.

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:
Physics news 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?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 65 ·
3
Replies
65
Views
9K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K