effects of projectile motion in a non-uniform ... · in order to study projectile motion one needs...

13
Effects of Projectile Motion in a Non-Uniform Gravitational Field, with Linearly Varying Air Density Todd Crutcher December 12, 2002 Abstract In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces. The model in this paper will explore the effects of variable gravity, variable air resistance, and curvature of the earth, on projectile motion. 1

Upload: others

Post on 01-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

Effects of Projectile Motion in a Non-Uniform GravitationalField, with Linearly Varying Air Density

Todd Crutcher

December 12, 2002

Abstract

In order to study Projectile Motion one needs to have a good working model of how a projectile is effectedby external forces. The model in this paper will explore the effects of variable gravity, variable air resistance,and curvature of the earth, on projectile motion.

1

Page 2: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

1 Introduction

To study Projectile Motion the first thing that we need to do is come up with a good model of how a projectiletravels. To do this properly we need to account for (among other things not covered here) the effects of: variablegravity, variable air resistance, and the curvature of the earth. Once we have found an expression for theresistive force, (this will be the force opposing the projectile due to gravity and air resistance) we will use it toget a set of four dynamical equations. This set of dynamical equations will be solved numerically for the pathof the projectile. The numeric solutions to these dynamical equations will be performed using the fourth orderRunge-Kutta method programmed in C++ (see Appendix A).

2 Theory

To come up with a good model for projectile motion, we must first derive a set of dynamical equations thatcan be solved (either analytically or numerically) for the path of the projectile. These equations have to accountfor:

1. Launching a projectile at any angle (0o � 90o).

2. The curvature of the earth.

3. The fact that gravity varies with the height of an object.

4. The fact that air resistance varies with the height of an object.

To start off we will get an expression for the force of a gravity field that is dependent on altitude. This willbe done by using Newton’s Law of Universal Gravitation:

F � GMmR2 ur � (1)

where G � 6 � 672x10� 11 Nm2

kg2 and is the universal gravitation constant. M is the mass of the interstellar body

that you are on (in our case MEarth� 5 � 98x1024 kg), m is the mass of the object being thrown, and R is the radial

distance measured between the center mass of the two objects.We next need to get an expression for air resistance that is dependent on the altitude of our projectile (r).

To do this we used the book’s1 quadratic model of air resistance (F � � cv�v�) where c � � 22D2 and D is the

diameter of the projectile. To get a variable air resistance we make the assumption that this is correct at sealevel (Re) only, and that the air resistance reduces linearly to zero at the edge of the atmosphere (Ra). In orderto accomplish this we need to multiply this equation by some expression that is one at r � Re and zero at r � Ra.This leads us to the expression:

F � � c

�1 � r

Ra

1 � ReRa � v

�v�

(2)

By combining equations (1) and (2) we are able to get the following expression for the forces opposing themotion of our projectile.

F � � GMmr2 ur

� c

�1 � r

Ra

1 � ReRa � v

�v�

(3)

By dividing this equation by m and by breaking v�v�into its component vectors we get.

2

Page 3: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

a � � GMr2 ur

� cm

�1 � r

Ra

1 � ReRa � v

�v�

(4)

� � GMr2 ur

� cm

�1 � r

Ra

1 � ReRa � vr � vr

2 � vφ2 ur� cm

�1 � r

Ra

1 � ReRa � vφ � vr

2 � vφ2 uφ (5)

We also know from class2, and the Round Earth and Variable Gravity Effects on Projectile Motion handout(equation # (1.20)), that

a � r � rφ2 � ur� 2rφ � rφ � uφ � zuz (6)

By combining equations (5) and (6) we are able to get:

r � rφ2 � � GMr2� c

m

�1 � r

Ra

1 � ReRa � vr � vr

2 � vφ2 (7)

and

2rφ � rφ � � cm

�1 � r

Ra

1 � ReRa � vφ � vr

2 � vφ2 (8)

Finally by using equations (7) and (8) we are able to find the dynamical equations. This is done by solving eachequation for r and φ respectively.

drdt� r (9)

drdt� rφ2 � GM

r2� c

m

�1 � r

Ra

1 � ReRa � vr � vr

2 � vφ2 (10)

dφdt

� φ (11)

dφdt

� � 2rφr� c

mr

�1 � r

Ra

1 � ReRa � vφ � vr

2 � vφ2 (12)

These are four coupled second order ordinary differential equations and therefore a numeric solution is re-quired.

3

Page 4: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

3 The Program

To solve the dynamical equations (9, 10, 11, & 12) I modified the C++ Runge-Kutta program that wasprovided in class2. This program uses fourth order Runge-Kutta to numerically solve differential equations.The program was changed to solve the dynamical equations for r and φ with projectiles of any diameter (D),initial velocity (Vo), and launch angle (θ) this program was also setup to take these initial values as commandline arguments.

Taking the initial values as command line arguments allowed the ”Projectile Launch” program (AppendixA) to be run by a bash script (Appendix B) that would pass it the initial values. The program was then run forobjects with a diameter of 10.0 m, 1.0 m, 0.01 m, & 0.001 m. The initial velocity and launch angle varied from0.0 m/s to 10000 m/s (in increments of 10 m/s) and 0o to 90o (in increments of 5o) respectively. This resulted in72000 data sets.

Note: The density used for all objects is that of a baseball (689.736kg/m3), & all projectiles are launched from1 km above the Earth’s surface.

4 Results

The results for all the data sets turn out to be some what similar. Because of these similarities, and sheervolume, I am not including all of the data. Several examples of data sets are included in Appendix C. In everycase at high initial velocity the object is able to escape, at low initial velocity the object returns to the Earth. Aninteresting point is that no object was found to be able to circle the Earth. This is because the launch position isonly 1 km above the earth surface, and so the effect of air resistance is still quite large.

4

Page 5: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

Figure 1: Projectiles with D � 10m , θ � 40o, & varying initial velocity’s.

In Figure 1 it can be seen that for high velocities such as the green and brown traces (Vo� 10000 m � s & Vo

�5000 m � s) that the projectile will escape the Earth’s gravitational pull. and for lower initial velocity’s such asthe red, blue, and black traces (Vo

� 1000 m � s & Vo� 500 m � s& Vo

� 100 m � s) the projectile will eventuallyreturn to Earth. This figure shows what is typical for all of the data collected.

Figure 2: Projectiles with D � 1m ,Vo� 1000 m � s and varying initial velocity’s θ

5

Page 6: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

Figure 2 shows an example of the comparison between different initial launch angles for projectiles with thesame diameter and velocity. The traces on this figure are for launch angles of 5o to 90o in increments of 5o.The diameter and velocity of these projectiles is 1 m and 1000 m/s respectively. This figure also shows (as wasexpected) that the optimum launch angle to achieve maximum range is approximately 45o.

5 Conclusion

The results obtained from this model of projectile motion are what would be expected of a good model.If you launch a projectile with an extremely large initial velocity it will escape the gravitational pull of theEarth. The angle that you launch it at has an effect on the flight of the projectile. The optimum launch angleis approximately 45o. I was not able to show that you could put an object into orbit, however this is due to thelaunch position of the projectile.

6

Page 7: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

6 Appendix A

The following code is the C++ program used for this project.

#include <iostream.h>#include <stdio.h>#include <math.h>

#define N 4 // number of first order equations#define DELTA_T 0.091 // stepsize in t#define T_MAX 1000.0 // max for t

#define GM 3.9898e14#define R_e 6370000 //rad. of earth (m)#define R_a 6432000 //distance from center of earth to space (m)#define Dens 689.736 //density of a baseball (kg/mˆ3)#define Pi 3.141592653static float c;static float m;

int main(int argc, char **argv){

float Diam; //diam. of object (m)float V_o; //inital velocity (m/s)float theta_o_deg; //launch angle (deg.)double t, y[20],inputs[argc];int i,j,k;

void runge4(double x, double y[], double step); // Runge-Kutta function

if (argc<=3){

cout << "\n\n\nYou need to include command line arguments!!\n" << endl;cout << "\nExample: ./a.out <Diam> <V_o> <theta_o_deg> !!\n\n\n" << endl;return 0;}else{sscanf(argv[1], "%f", &Diam);sscanf(argv[2], "%f", &V_o);sscanf(argv[3], "%f", &theta_o_deg);}

float theta_o_rad = theta_o_deg*(Pi/180); //launch angle (rad.)

c = 0.22*Diam*Diam;m = Dens*(4.0/3.0)*Pi*(Diam/2)*(Diam/2)*(Diam/2);

y[0]= R_e+1; // initial ry[1]= V_o*sin(theta_o_rad); // initial r_doty[2]= 0.0; // initial phiy[3]= V_o*cos(theta_o_rad)/R_e; // initial phi_dot

printf("%lf\t", y[2]);printf("%lf\t", y[0]);

7

Page 8: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

printf("\n");

for (j=1; j*DELTA_T <= T_MAX ;++j) { // time loopt=j*DELTA_T;runge4(t, y, DELTA_T);

if (y[0]<=R_e)return 0; // will check if the projectile has hit the ground

printf("%lf\t", y[2]);printf("%lf\t", y[0]);printf("\n");}return 0;}//end of main

double f(double x, double y[], int i) {

double V_r = y[1];

double V_phi = y[0]*y[3];

if (i==0) return(y[1]);

if (i==1) return((y[0]*y[3]*y[3])-(GM/(y[0]*y[0]))-((c/m)*((1-(y[0]/R_a))/(1-(R_e/R_a)))*(V_r*sqrt((V_r*V_r)+(V_phi*V_phi)))));

if (i==2) return(y[3]);

if (i==3) return(((-2*y[1]*y[3])/y[0])-((c/(m*y[0]))*((1-(y[0]/R_a))/(1-(R_e/R_a)))*(V_phi*sqrt((V_r*V_r)+(V_phi*V_phi)))));

}//end of f

void runge4(double x, double y[], double step) {double h=step/2.0; // the midpointdouble t1[N], t2[N], t3[N]; // temporary storage arraysdouble k1[N], k2[N], k3[N],k4[N]; // for Runge-Kuttaint i;

for (i=0;i<N;i++) t1[i]=y[i]+0.5*(k1[i]=step*f(x, y, i));for (i=0;i<N;i++) t2[i]=y[i]+0.5*(k2[i]=step*f(x+h, t1, i));for (i=0;i<N;i++) t3[i]=y[i]+(k3[i]=step*f(x+h, t2, i));for (i=0;i<N;i++) k4[i]=step*f(x+step, t3, i);

for (i=0;i<N;i++) y[i]+=(k1[i]+2*k2[i]+2*k3[i]+k4[i])/6.0;return;

}//end of runge4

8

Page 9: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

7 Appendix B

Below is the bash script used to run the C++ program

#!/bin/bash

Diam=0.001V_o=0

while [ "$V_o" -lt 10001 ] # Beginning of outer loopdo

theda=0 # Reset theda.

while [ "$theda" -lt 91 ] # Beginning of inner loopdo

./theo_proj_1.2.out $Diam $V_o $theda > $Diam"_"$V_o"_"$theda.dat

let "theda += 5"done # End of inner loop

let "V_o += 10" # Increment pass count.

done # End of outer loop# All done.

Diam=0.01V_o=0

while [ "$V_o" -lt 10001 ] # Beginning of outer loopdo

theda=0 # Reset theda.

while [ "$theda" -lt 91 ] # Beginning of inner loopdo

./theo_proj_1.2.out $Diam $V_o $theda > $Diam"_"$V_o"_"$theda.dat

let "theda += 5"done # End of inner loop

let "V_o += 10" # Increment pass count.

done # End of outer loop# All done.

9

Page 10: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

Diam=1.0V_o=0

while [ "$V_o" -lt 10001 ] # Beginning of outer loopdo

theda=0 # Reset theda.

while [ "$theda" -lt 91 ] # Beginning of inner loopdo

./theo_proj_1.2.out $Diam $V_o $theda > $Diam"_"$V_o"_"$theda.dat

let "theda += 5"done # End of inner loop

let "V_o += 10" # Increment pass count.

done # End of outer loop# All done.

Diam=10.0V_o=0

while [ "$V_o" -lt 10001 ] # Beginning of outer loopdo

theda=0 # Reset theda.

while [ "$theda" -lt 91 ] # Beginning of inner loopdo

./theo_proj_1.2.out $Diam $V_o $theda > $Diam"_"$V_o"_"$theda.dat

let "theda += 5"done # End of inner loop

let "V_o += 10" # Increment pass count.

done # End of outer loop# All done.

10

Page 11: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

8 Appendix C

Figure 3: Projectiles with D � 10m , θ � 75o, & varying initial velocity’s.

Figure 4: Projectiles with D � 1m , θ � 10o, & varying initial velocity’s.

11

Page 12: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

Figure 5: Projectiles with D � 0 � 01m , θ � 40o, & varying initial velocity’s.

Figure 6: Projectiles with D � 0 � 001m , θ � 75o, & varying initial velocity’s.

12

Page 13: Effects of Projectile Motion in a Non-Uniform ... · In order to study Projectile Motion one needs to have a good working model of how a projectile is effected by external forces

9 References

1. Fowles and CassidayAnalytical Mechanics, sixth edition

2. Class notes & handouts (Tutorial 1’s)Dr. Anthony A. TovarEastern Oregon UniversityTheoretical Physics 441

3. Programming and Problem Solving with C++Nell DaleChip WeemsMark Headington

13