# Runge-Kutta Projectile Approximation From Initial Conditions

• VexCarido
In summary, the new member asks some questions about implementing the RK4 method for projectile motion and is looking for advice on how to proceed. They suggest using Excel as a starting point and show a short video on how to do it.
VexCarido
Hi everyone. I'm a new member, great to be here:)

I have a few questions that I wanted to ask you guys regarding the method by which we implement the Runge-Kutta approximation of Projectile Motion if we should do it using a numerical iterative method with a Spreadsheet like Excel.

I have already constructed a simulation in Excel using the Euler method basic physics formulas and implemented both gravity, drag and wind forces. Now I wish to improve upon the accuracy by using a better approximation of the X,Y coordinates over time with RK4.

Here's how I constructed the spread sheet with The Euler numerical method (using gravity, but ignoring drag and wind):

and I suppose these are the formulas that should use to get the improved approximation with the Runge Kutta Method:
To clarify, I am trying to get a list X, Y coordinates as function of time, using a set of initial conditions. The initial values should be able to be freely changed to get approximations of any type of movement along the x-y plane.

I hope my phrasing & terminology is sufficient. This is mostly a DIY project, not homework or school related.

Last edited:
Hi @VexCarido and welcome to PF.

You said you have a few questions. What are they?

kuruman said:
Hi @VexCarido and welcome to PF.

You said you have a few questions. What are they?

I thought it may have been clear from OP, but it may have been too broad. I'm trying to get an understanding of how to relate a set of initial conditions to the evolution of motion, using the RK4 method, in a similar fashion to what you would do with the Euler-Cromer method.

That is, I have an object a x,y position thrusted in any direction with a specified velocity. Using Euler's method I use the simple iteration of x= vx*dt+x, y=vx*dt+y formula.

How can I use the RK4 to solve the exact same problem? I recon I need to calculate the value of the function "f" ? How does one go about it?

My goal is to then compare the two solutions to see how much they diverge over time when I plug in different initial values.

Here is a short video that I found with minimal search to get you started. I hope it helps. I am sure there are other examples on the web if it doesn't.

kuruman said:
Here is a short video that I found with minimal search to get you started. I hope it helps. I am sure there are other examples on the web if it doesn't.

Unfortunately the video skips a couple of steps in relation to my question and I have looked at other videos that also seem not to mention how I get the function of the ODE from a set of initial conditions.

In this video he uses f=3X^2Y. If I need to go from the information(Example); Starting point (0,0) velocity = 75/ms at (35) degree angle and translate this info into a function, what would be the appropriate steps then?

Have you seen this?

kuruman said:
Have you seen this?

No, that particular site escaped my search and it does in fact provide some very useful info. Thanks.
Only problem is that it deals with RK2, not 4. Hopefully I will be able to deduce the logic behind it and modify it to suit a forth order approximation instead.

Is there any particular reason you are using Excel for this instead of a programming language that is more suited to numerical simulation?

VexCarido said:
No, that particular site escaped my search and it does in fact provide some very useful info. Thanks.
Only problem is that it deals with RK2, not 4.

This post might help:
https://scicomp.stackexchange.com/a/21063

This paper compares different methods for ballistics:
https://www.researchgate.net/publication/333985200_Two_Numerical_Algorithms_for_the_Ballistic_Motion_Equations

boneh3ad said:
Is there any particular reason you are using Excel for this instead of a programming language that is more suited to numerical simulation?

I have been thinking that Excel serves as a very sound starting point for my practice in scientific programming & creating physics simulations. It is very suitable as you are working at a truly fundamental level with all the equations of physics without the need for knowing additional coding languages.

I was inspired by a couple of different persons online who showed me the versatility of the program given a little know-how & I'm confident I'll be able to translate a lot of the knowledge directly to a range of programming languages moving forward.

If you want to see some of the awesome capabilities of Excel (particularly the 2003 version) i suggest you check out this website.: http://www.excelunusual.com/

Or this Youtube Channel (same guy):

## 1. What is the Runge-Kutta method for projectile approximation from initial conditions?

The Runge-Kutta method is a mathematical algorithm used to approximate the solution of a differential equation. In the context of projectile motion, it can be used to calculate the trajectory of a projectile given its initial conditions, such as its initial velocity and angle of launch.

## 2. How does the Runge-Kutta method differ from other methods of projectile approximation?

The Runge-Kutta method is a higher-order method, meaning it uses more information from the differential equation to calculate a more accurate approximation. This makes it more accurate than simpler methods, such as Euler's method, which only use the initial conditions to calculate the trajectory.

## 3. What are the advantages of using the Runge-Kutta method for projectile approximation?

The Runge-Kutta method is more accurate than other methods, making it useful for situations where precision is important. It is also more versatile, as it can be applied to a wide range of differential equations, including those with non-constant coefficients.

## 4. Are there any limitations to using the Runge-Kutta method for projectile approximation?

While the Runge-Kutta method is more accurate than simpler methods, it can also be more computationally intensive. This means it may take longer to calculate the trajectory of a projectile, especially if the initial conditions are complex or the differential equation is highly nonlinear.

## 5. How can the Runge-Kutta method be used in real-world applications?

The Runge-Kutta method is commonly used in fields such as physics, engineering, and aerodynamics to model the motion of projectiles, such as rockets, missiles, and artillery shells. It can also be used in computer simulations to predict the trajectory of objects in various scenarios, such as in video games or virtual reality environments.

### Similar threads

• Differential Equations
Replies
4
Views
57
• Mechanics
Replies
3
Views
854
• Mechanics
Replies
4
Views
1K
• Differential Equations
Replies
16
Views
3K
• Programming and Computer Science
Replies
8
Views
2K
• Programming and Computer Science
Replies
15
Views
2K
• Calculus and Beyond Homework Help
Replies
14
Views
2K
• Differential Equations
Replies
6
Views
3K
• Differential Equations
Replies
7
Views
2K
• Engineering and Comp Sci Homework Help
Replies
2
Views
2K