If you are redistributing all or part of this book in a digital format, Then you must include on every physical page the following attribution: If you are redistributing all or part of this book in a print format, Changes were made to the original material, including updates to art, structure, and other content updates. Want to cite, share, or modify this book? This book uses theĪnd you must attribute Texas Education Agency (TEA). To do this, we separate projectile motion into the two components of its motion, one along the horizontal axis and the other along the vertical. Since vertical and horizontal motions are independent, we can analyze them separately, along perpendicular axes. Keep in mind that if the cannon launched the ball with any vertical component to the velocity, the vertical displacements would not line up perfectly. You can see that the cannonball in free fall falls at the same rate as the cannonball in projectile motion. Figure 5.27 compares a cannonball in free fall (in blue) to a cannonball launched horizontally in projectile motion (in red). The most important concept in projectile motion is that when air resistance is ignored, horizontal and vertical motions are independent, meaning that they don’t influence one another. Ask students to guess what the motion of a projectile might depend on? Is the initial velocity important? Is the angle important? How will these things affect its height and the distance it covers? Introduce the concept of air resistance. By multiplying a row vector and a column vector, array broadcasting ensures that the resulting matrix behaves the way we want it (i.e.Review addition of vectors graphically and analytically. I also used and to turn 1d numpy arrays to 2d row and column vectors, respectively. I made use of the fact that plt.plot will plot the columns of two matrix inputs versus each other, so no loop over angles is necessary. Plt.plot(x,y) #plot each dataset: columns of x and columns of y Timemat = tmax*np.linspace(0,1,100) #create time vectors for each angle Theta = np.arange(25,65,5)/180.0*np.pi #convert to radians, watch out for modulo division G = 9.81 #improved g to standard precision, set it to positive So here's what I'd do: import numpy as np Unless you set the y axis to point downwards, but the word "projectile" makes me think this is not the case. This assumes that g is positive, which is again wrong in your code. ![]() Lastly, you need to use the same plotting time vector in both terms of y, since that's the solution to your mechanics problem: y(t) = v_*t - g/2*t^2 This is not what you need: you need to compute the maximum time t for every angle (which you did in t), then for each angle create a time vector from 0 to t for plotting! Thirdly, your current code sets t1 to have a single time point for every angle. You have to convert your angles to radians before passing them to the trigonometric functions. Secondly, your angles are in degrees, but math functions by default expect radians. P = # Don't fall through the floorįirstly, less of a mistake, but matplotlib.pylab is supposedly used to access matplotlib.pyplot and numpy together (for a more matlab-like experience), I think it's more suggested to use matplotlib.pyplot as plt in scripts (see also this Q&A). X = ((v*k)*np.cos(i)) # get positions at every point in time T = np.linspace(0, 5, num=100) # Set time as 'continous' parameter.įor i in theta: # Calculate trajectory for every angle #increment theta 25 to 60 then find t, x, y One more thing: Angles can't just be written as 60, 45, etc, python needs something else in order to work, so you need to write them in numerical terms, (0,90) = (0,pi/2). So time is continuous parameter! You don't need the time of flight. ![]() Initial is important! That's the time when we start our experiment. Initial velocity and angle, right? The question is: find the position of the particle after some time given that initial velocity is v=something and theta=something. What do you need to know in order to get the trajectory of a particle? You know this already, but lets take a second and discuss something. First of all g is positive! After fixing that, let's see some equations:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |