Question

In: Physics

use python to graph the projectile motion of an object under quadratic drag

use python to graph the projectile motion of an object under quadratic drag

Solutions

Expert Solution

As you have not specified the mass of the particle, the angle, it's inital velocity, angle of projection, etc., here is a general python program which you can use accordingly.

import numpy as np

import matplotlib.pyplot as plt

% matplotlib inline

# Model parameters

M = (put some value) # Mass of projectile in kg

g = 9.8 # Acceleration due to gravity (m/s^2)

V = () # Initial velocity in m/s

ang = () # Angle of initial velocity in degrees

Cd = () # Drag coefficient

dt = () # time step in s

t = [0]

vx = [V*np.cos(ang/180*np.pi)]

vy = [V*np.sin(ang/180*np.pi)]

x = [0]

y = [0]

drag=Cd*V**2

ax = [-(drag*np.cos(ang/180*np.pi))/M ]

ay = [-g-(drag*np.sin(ang/180*np.pi)/M) ]

counter = 0

while (y[counter] >= 0):

t.append(t[counter]+dt)

vx.append(vx[counter]+dt*ax[counter])

vy.append(vy[counter]+dt*ay[counter])

x.append(x[counter]+dt*vx[counter])

y.append(y[counter]+dt*vy[counter])

vel = np.sqrt(vx[counter+1]**2 + vy[counter+1]**2)

drag = Cd*vel**2

ax.append(-(drag*np.cos(ang/180*np.pi))/M)

ay.append(-g-(drag*np.sin(ang/180*np.pi)/M))

counter = counter +1

plt.plot(x,y,'ro')

plt.ylabel("y (m)")

plt.xlabel("x (m)")

print "Range of projectile is {:3.1f} m".format(x[counter])


Related Solutions

In python. Projectile motion: Write a python program that will ask the user for      an...
In python. Projectile motion: Write a python program that will ask the user for      an initial height y0, initial velocity v, launch angle theta, and mass m.      Create two functions, one that will calculate max height      of the projectile, and one that will calculate the range. Ask the     user which one he/she would like to calculate, then present them with the answer. (use kg, m and m/s)
What is the horizontal component of acceleration of a projectile in projectile motion, AND what is...
What is the horizontal component of acceleration of a projectile in projectile motion, AND what is the horizontal component of velocity of a projectile in projectile motion? Please assume that there is no air resistance? Please explain your answer in a short paragraph and type in any calculations you would need to determine this. in a problem.
Use the model for projectile motion, assuming there is no air resistance and g=32 feet per...
Use the model for projectile motion, assuming there is no air resistance and g=32 feet per second per second. Determine the maximum height and range of a projectile fired at a height of 8 feet above the ground with an initial speed of 300 feet per second and at an angle of 45degrees above the horizontal. (Round your answers to three decimal places.) (a) maximum height (feet) (b) maximum range (feet)
The projectile motion equation is s(t)=-16t^2+vt+h where s(t) represents the distance or height of an object...
The projectile motion equation is s(t)=-16t^2+vt+h where s(t) represents the distance or height of an object at time t, v represents the initial speed of the object in ft/s, and h is the initial height of the object, measured in feet. If an object is starting at rest, then v=0 (such as for a penny being dropped from a building). If the object is starting from the ground, h=0. The baseball or cannonball situations, each have an initial velocity. For...
Projectile motion with air resistance code in c language
Projectile motion with air resistance code in c language
Introduction to Projectile Motion Solution(Mastering Physics Chapter 03: Motion in Two Dimensions)
Consider a particle with initial velocity v that has magnitude 12.0m/s and is directed 60.0 degrees above the negative x axis. a. What is the x component vx of v? b. What is the y component vy of v? c. Look at this applet (I don’t have a copy of the applet, sorry). The motion diagram for a projectile is displayed, as are the motion diagrams for each component. The x component motion diagram is what you would get if you shined a...
For the following exercises, use the table of values that represent points on the graph of a quadratic function. By determining..
For the following exercises, use the table of values that represent points on the graph of a quadratic function. By determining the vertex and axis of symmetry, find the general form of the equation of the quadratic function.
Projectile Motion A projectile, launched over level ground from a height of 450 meters above the...
Projectile Motion A projectile, launched over level ground from a height of 450 meters above the flat sur face below, has an initial speed of 175 m/s . The projectile is launched at a 43.5 degree angle in relation to the horizontal direction a What are the initial horizontal and vertical components of the velocity of the projec tile? bIn terms of the initial horizontal and vertical components of the velocity, write down equations for the motion of the x...
1. Derive each mathematical model of projectile motion and compare each part of derive, ( projectile...
1. Derive each mathematical model of projectile motion and compare each part of derive, ( projectile motion only, projectile motion with wind force, projectile motion with wind force and projectile motion with wind force and air resistance) Note of sign of velocity Y as indicate go up or down. (a)projectile motion Derive the mathematical model (in 2D) using Newton’s 2nd Law and produce the ODEs (ordinary differential equation) involving the horizontal and vertical velocities respectively. Solve for the velocities using...
How wind force affect projectile velocity? what is the equation of projectile motion velocity x &...
How wind force affect projectile velocity? what is the equation of projectile motion velocity x & y with wind force effect?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT