Fall 2017 Fortran Project Write a program called trajectory.f95 that asks the us
ID: 3145085 • Letter: F
Question
Fall 2017 Fortran Project
Write a program called trajectory.f95 that asks the user for speed S0 and angle of a launched projectile, which you can assume to be a 1 kg ball with a 0.1 m diameter. Use that info to calculate the trajectory travelled before it hits the ground. Use simple numerical integration to solve the system. For our purposes, that means
a. Set initial values at time t=0. Assume that the ball starts at x0 =0 and y0 =0.Thexandy components of velocity are given above.
B. Start a loop that will run until the ball hits the ground.
C. Update the time so that t=t+t.
D. Call functions from a module that return the x and y components of acceleration, x''(t) and y''(t).
E. "Integrate" to find the values of velocity and position at the next time step. In other words
x'(t+t) = x'(t) + t x''(t) and
x(t+t) = x(t) + t x'(t)
And similarly for the y-direction.
F. Check whether the ball has fallen back to the ground (y 0) and repeat if it has not. Terminate the loop if it has.
A smaller t will result in more accurate results. You can experiment with different values for t, but test with t = 0.01 sec.
Use double-precision for all real calculations to numerical error. Write the time, x position, y position, x velocity, and y velocity at each time step to an output file with header lines for column labels and units. The output file should be named trajectory.txt. One can infer the table header and format specifications from the example below showing the first several lines of the file. Note that the example shown is for an initial velocity of 10 m/s and angle of 45o, but the program should work for any positive initial velocity and starting angle between 0o and 90o.
Write a module called accelerations.f95 with some variables and two functions. The module should define double-precision constants for gravity, the density of air, the coefficient of drag on a sphere, and . It should also define double-precision variables for the radius and mass of the ball. The first function takes the speed in the x-direction as an input variable and returns the acceleration in the x- direction. The second function does the same in the y-direction. Those are the two functions to be called in step d above.
-If this format not allowed, I can divide the work. Let me know
time (sec) x y x_dot y_dot 0.000 0.000 0.000 7.071 7.071 0.010 0.071 0.070 7.067 6.969 0.020 0.141 0.138 7.063 6.867 0.030 0.212 0.206 7.059 6.765 0.040 0.282 0.273 7.055 6.664Explanation / Answer
Please divide the work. The question is not very clear. If you will will divide this question and ask this question in a simple and nice manner, then it will be very easy to understand and solve this question.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.