computational physics: projectile motion

13
Phys 155: Laboratory Report 1 2nd Semester, A.Y. 2015-2016 Mark Christian S. Mejia Ralph Bryan H. Quirante December 10, 2015 1

Upload: markmejia025

Post on 14-Apr-2016

5 views

Category:

Documents


2 download

DESCRIPTION

Computational Physics Projectile Motion made with Tex

TRANSCRIPT

Phys 155: Laboratory Report 12nd Semester, A.Y. 2015-2016

Mark Christian S. MejiaRalph Bryan H. Quirante

December 10, 2015

1

1 Introduction

Any body that is given an initial velocity and then follows a path determined entirelyby the effects of gravitational acceleration and air resistance is known as Projectile. Itincludes objects being thrown horizontally as well as objects that are projected at an angle.A projectile travels in a curved path is called Trajectory. Projectiles always experience aconstant vertical acceleration due to the pull of gravity as they rise and fall.

A body at rest remains at rest and a body in motion remains in motion unless acted uponby an external force. That said, when a projectile is fired with an initial velocity (v0) at anangle θ, the object will continue to move with respect to the angle where it was launched.However, everything here on our planet is affected by gravity, thus the object will be pulleddownward and that causes the object to follow a curved path (Trajectory). Also, a projectilemotion is two dimensional.

2 Theory

Neglecting air resistance, the trajectory of a projectile is a combination of horizontalmotion with constant velocity and vertical motion with constant acceleration.

x(t) = xo + (vocosθ)t (1)

y(t) = yo + (vsinθ)t (2)

Equation 1 is the equation for the horizontal displacement of a projectile as a functionof time. This shows that, before the projectile hits the ground or encounters any other re-sistance, the horizontal displacement changes linearly with time. Equation 2 is the equationfor the vertical displacement of a projectile as a function of time. Unlike the horizontaldisplacement, the vertical displacement does not vary linearly with time.

2

Figure 1: Projectile motion with and without air resistance

However, this equation is only applicable to an ideal system. The assumptions aims tosimplify the calculation of the projectile motion. Air resistance is one of the major factorsthat affect the maximum range and the time of flight of the projectile. Figure 1 shows thepath of the projectile with and without air resistance. Another factor is the curvature of theEarth. This factor affects the value of acceleration due to gravity (g) as we move away fromthe center of the earth. Thus affecting the trajectory of the projectile.

The maximum range of a projectile launched from a different height can be calculatedusing the basic equation in kinematics. Equation 3 and Equation 4 describe the landingpoint after flight time of the projectile motion

0 = h+ vy −1

2gt2 (3)

R = vxT (4)

Substituting the two equations we have and converting them to polar coordinates, we have

h(1 + cos2θ) =gR2

v2−Rsin2θ (5)

To obtain the optimum launch angle, we will maximize R by differentiating with respect to θ

θ =1

2tan−1

R

h(6)

3

The maximum range is then

R =

√2v2

g

(h+

v2

2g

)(7)

4

3 Method

Algorithm are set of well defined instructions in sequence to solve a program. In thisproblem, we are dealing with projectile motion. The variables involved in solving the prob-lem should be defined and must be given an initial value if any. They must be declaredas Real or and Integer. The Implicit None statement is used to determine whetherthe variables are declared and the implicit none statement must be included in everyprogram.An open statement is used to open a program called Notepad to save the data.The general form of the open statement is as follows:

open(location,file=’filename’, status’values’)

The filename must be in .d file extension so that the gnuplot program will be able to plotthe data inside the file. For repeated execution, loops are used. Specifically do loop. Thegeneral form of do loop is as follows:

do label var = starting number, ending number, increment

Inside the do loop contains the arithmetic to be performed by the loop command. Thiscontains the equation to find the maximum range, time of flight, and the displacement ofthe projectile. To display the values calculated inside the loop command, we will use thewrite(*,*) statement. The location must be changed with respect to the value you’ve en-tered in the open statement (e.g. open (1,..), write(1,*). The IF statement is used to verifywhether the values of the calculated data contains a negative values (y¡0.0). The negativevalues indicates that the object just not reach the ground but continues to follow the curvepath below the ground(which is not right). The general form of the IF statement is as follows:

if (logical expression) thenstatements

elseif (logical expression) thenstatements

.

.else

statementsendif

After the data calculation, the values obtained will now be plotted using gnuplot. To increaseefficiency and save time, we can use notepad to automate the plotting of the data withoutopening the gnuplot program and then transferring the .d file extension to your personalworking directory. The same commands used in gnuplot is then type in the notepad. Savethe file as filename.plt.

5

4 Verification of a program

The first program calculates the vertical and the horizontal displacements using Equa-tions 1 and 2. The time of flight of the projectile can be calculated using Equation 2 viaquadratic equation:

y(t) = yo + (vsinθ)t (8)

Substituting the values for yo=0, v=25.0m/s, g=9.81m/s2, θ=30◦, we have

0 = 0 + (25sin30◦)t− (9.81)t2

2(9)

Performing the arithmetic, we have

t =−b±

√b2 − 4ac

2a(10)

t =−12.5±

√12.52 − 4(4.9)(0)

2(4.9)

The values obtained are

t2 = 2.55s

t1 = 0.00s

The computed value for time matches the value computed by the program. Substituting thecomputed time to Equation 1, the horizontal displacement agrees with the computed valueby the program. However, since we have defined the logical expression in the if statement todisregard the negative values, the horizontal displacement x=55.20911949 is not displayedbecause the the next increment of the t would make the values negative.

The maximum range can be calculated using Equation 7, the manually computed valuefor the maximum range agrees with the computed value by the program.

6

5 Results

Figure 2: The trajectory of the projectile in three different angles

Figure 5 shows the maximum range of the angle 45◦, 30◦, 65◦. The 65◦angle has thelongest time in the air has the least range of all the angles. As you can see, the 45◦angle hasthe highest value for range.

Angle Height Maximum Range Time of flight

45◦ 100 m 117.734 m 6.66006 s

45◦ 150 m 134.528 m 7.61008 s

45◦ 200 m 149.024 m 8.43010 s

Table 1: Shows the maximum range and the time of flight

The angle 45◦is the one that has a highest value for the range. Thus, an angle at 45◦ata height of 100 meters, it can travel 117.734 meters of maximum range and takes 6.66006seconds time of flight, and at 200 meter of height, it can travel 149 meters of maximum rangeand takes 8.43010 seconds time of flight. Hence, at constant 45 degree with different initialheights the maximum range changes, together with the time of flight.

7

Figure 3: The maximum range and the time of flight at different initial heights

Figure 2 presents the graph of the maximum range and the time of flight of differentinitial heights at 45◦angle. An increase in the height h, there would be an increase in therange. Since the relationship is directly proportional to each other, the graph is linear.

Height Maximum Range Angle

0 m 73.0290 m 41.1014◦

10 m 81.2862 m 38.0886◦

20 m 88.7787 m 35.6645◦

30 m 95.6863 m 33.6567◦

40 m 102.128 m 31.9572◦

50 m 108.186 m 30.4937◦

60 m 113.923 m 29.2157◦

70 m 119.385 m 28.0869◦

80 m 124.607 m 27.0803◦

90 m 129.619 m 26.1751◦

Table 2: Shows the angle with the corresponding horizontal range and initial height

From Table 1, with constant angle and different initial heights the maximum rangechanges. However, from Table 2 at angle 41.1014◦starting from the ground, the maximumrange for this angle is 73.0290 meters and at 26.1751◦with a height of 90 meters the projectilecan go as far as 129.619 meters. Therefore, the angle corresponding to maximum horizontal

8

range of the projectile depends on the initial height.

9

6 Analysis

The relationship of the projection angle to the range in different heights of initial points,if the projection angle is constant, if we release the object at a much higher position we willget longer range.Therefore, we can conclude, in a projectile problem if you have constantangle of projection but on a different height, longer range will be on the point where theobject is released on a much higher altitude.thus, the range depends on the projection angleat different heights.

10

7 Critique

In problem number one , at different angles, 45, 55, and 65 degrees. With these differentangles plotted in a graph using gnuplot, the 65 degree has the highest point vy, with theshortest range vx, the 45 degree has the average point vy of the three and has the farthestrange vx, thus, we can conclude that we can get the maximum range with 45 degree.

For problem number two, a constant angle but different heights changes the rangevalue.Hence, the range depends on the height. however, in problem number three, withdifferent a ngles for different heights, the range value changes.(refer to table 2) therefore, wecan conclude that finding the maximum range depends on the height and angle of projection.

Using the power of computer, the calculations was made easy and the values obtained areprecise and accurate. However, the precision of the value calculated depends on the machineused. The do loop command is helpful in performing repetitive task such as calculating thetotal time of flight at different initial heights. The Open statement simplifies the work incopying the values in the terminal and pasting them in the notepad. This makes the processvery efficient and less time consuming.TheImplicit None statement helps to identify if all the variables in the program are declared

and has been given a initial value if any. This reduces a lot of errors. The method ofencoding the commands in the gnuplot using the notepad also helps make the process towork efficiently. With that, you will no longer copy the .d file in your pwd or PersonalWorking Directory.

11

8 Appendix

Figure 4:

12

Figure 5:

Figure 6:

13