![projectile motion with air resistance projectile motion with air resistance](https://i1.rgstatic.net/publication/329352747_PROJECTILE_MOTION_UNDER_AIR_RESISTANCE_-_A_VIDEO_PDF_SIMULATION_WITH_MATHEMATICA/links/5c031e3da6fdcc1b8d4d874d/largepreview.png)
Now that there is no known result to compare your computational trajectory to, explain how you can assess whether your computational result is accurate.
![projectile motion with air resistance projectile motion with air resistance](https://www.poemhunter.com/i/poem_images/086/projectile-motion.jpg)
Make sure your program prints out both the air-drag trajectory and the analytic trajectory when air resistance is neglected. Now that we have some confidence in our numerical routine, modify the program so it calculates the trajectory when air resistance is included (this should require very little modification to your previous program). Comment on what it means for the simulation to be a ``good approximation'' to the true result. Next, decrease the time step until the simulation appears to be a good approximation to the true result. Be sure to try some other values of $v_0$ and $\theta$ to make sure your simulation works as expected. In addition to the graph, print out the difference $\Delta y$ between the simulation and the exact result and comment on what you observe. Your graph should include axes labels (with units) and a title that gives the initial speed and launch angle. Plot a graph that shows both the simulation and the analytic result $y = \tan\theta - gx^2/2v_x^2$ (using the same $x$-values) for $v_0=10$ m/s and $\theta=60^\circ$. Note: because we will be calculating many trajectories in these exercises, it is a good idea to define a function (or subroutine) to calculate and return the trajectory $(x(t),y(t))$. Assume that the object is a baseball and begin with a time step of 0.1\,s. This approach will not only simplify the process of writing a reasonably complicated program, but it will allow us to make sure the program works in a case where we can easily check the answer.īuild a computational model to determine the trajectory $(x(t),y(t))$ of an object with a specified initial speed $v_0$ and launch angle $\theta$ in the absence of air resistance using the Euler-Cromer algorithm. With this in mind, we will begin by computing the trajectory of an object when air resistance is neglected. When translating a physical problem into computer code, it is often a good idea to begin simple and then expand the program little by little.