Runge-Kutta Projectile Approximation From Initial Conditions

  • #1
VexCarido
8
4
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):
70da2c3045fda1b14f8a7a0df03558fe.png


and I suppose these are the formulas that should use to get the improved approximation with the Runge Kutta Method:
Rk4.png



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:

Answers and Replies

  • #2
kuruman
Science Advisor
Homework Helper
Insights Author
Gold Member
12,854
6,060
Hi @VexCarido and welcome to PF.

:welcome:

You said you have a few questions. What are they?
 
  • #3
VexCarido
8
4
Hi @VexCarido and welcome to PF.

:welcome:

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.
 
  • #4
kuruman
Science Advisor
Homework Helper
Insights Author
Gold Member
12,854
6,060
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.
 
  • #5
VexCarido
8
4
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?
 
  • #7
VexCarido
8
4
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.
 
  • #8
boneh3ad
Science Advisor
Insights Author
Gold Member
3,386
1,171
Is there any particular reason you are using Excel for this instead of a programming language that is more suited to numerical simulation?
 
  • #9
A.T.
Science Advisor
11,765
3,052
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
 
  • #10
VexCarido
8
4
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):
 

Suggested for: Runge-Kutta Projectile Approximation From Initial Conditions

Replies
4
Views
495
  • Last Post
Replies
2
Views
412
Replies
8
Views
458
Replies
16
Views
645
Replies
0
Views
2K
Replies
3
Views
514
Replies
3
Views
312
Replies
8
Views
2K
Replies
1
Views
2K
Replies
8
Views
642
Top