Projectile motion time of impact

AI Thread Summary
The discussion revolves around calculating the time of impact for a projectile in a C program. The user has successfully implemented calculations for projectile motion but struggles to determine when the projectile impacts the ground or a hill. It is suggested that the impact time can be found by comparing the vertical height of the projectile (y(t)) with the height of the hill (H(x)) at each time step, stopping iterations when y(t) is less than or equal to H(x). The user is also advised to clarify the equations used and focus on the iterative calculations rather than complex formulas. Understanding this approach should help finalize the program's functionality.
thintheherd
Messages
4
Reaction score
0

Homework Statement



This is an output of a c program example given by my professor. I have written a program that makes it as far as calculating everything but impact. I have all equations figured out except for how the time of impact was calculated.

Enter initial magnitude (0 to 250 m/s): 100
Enter initial angle (0 to 90 degrees): 45
Enter starting time (s): 7
Enter time step (s): 0.1

t x(t) y(t) H(x)
------------------------------------
7.00 494.975 255.630 216.917
7.10 502.046 255.785 226.366
7.20 509.117 255.842 235.990
7.30 516.188 255.801 245.777


Impact occurred between t= 7.30 s and 7.40 s.



Homework Equations



not sure of the relevant equations, but i tried to calculate using these formulas:
Vx = 100 × Cos 45° =
Viy = 100 × Sin 30° =
Vfy = - Viy

t = ( Vfy - Viy ) / a Time of vertical flight
t = ( -70.17 - 70.17 ) / -9.8
t = ?
being we already know the time step, where am i going wrong here?

The Attempt at a Solution



I am getting an answer of -14.28. I trying to figure out this impact equation to incorporate it into the above program. I am writing this program and I am almost done but I can't figure out how the professor figured out when the impact occurred?


Thanks!
 
Physics news on Phys.org
Sorry, i could not figure out what you are asking ;] what is H(x)? And what kind of impact are you talking about? At t = 7.3, from your data it is seen that projectile is at its maximum height, so with what does the impact occur? With wall? Another particle?
 
Enter initial magnitude (0 to 250 m/s): 100
Enter initial angle (0 to 90 degrees): 45
Enter starting time (s): 7
Enter time step (s): 0.1

t x(t) y(t) H(x)
------------------------------------
7.00 494.975 255.630 216.917
7.10 502.046 255.785 226.366
7.20 509.117 255.842 235.990
7.30 516.188 255.801 245.777


Impact occurred between t= 7.30 s and 7.40 s.


Ok,sorry I will try and explain better here. This is for a C program I am writing .Given the initial magnitude, angle, starting time and time step, the program calculates the time of flight and when it impacts the ground. It is simply a parabolic projectile launching over a hill. H(X) is given by the far right column. Force is not of concern and there is no air resistance. Somehow my professor was able to calculate how long the object was in the air? For example this output shows the projectile was in the air for just over .30 seconds. How is this known knowing the magnitude, angle?!? or what have you?
 
so H(x) is the height of the hill? If it is that, then i guess that maybe your professor used some minimum difference between hill height and height of projectile at which he assumed that impact occurs and stopped iterations. For example, if you tried to do iterations until particle hits the ground (y = 0), you will put some condition, which when met stops iterations. That is something like: "if y(t)<=0 stop iterations". For your problem it could be: "if y(t)-H(x(t))<10, stop". But from the data you shown I am not sure that it is true that impact occurred between 7.3s and 7.4s
 
Well also it might be that data at time 7.4 is simply not shown in output, and that at time 7.4 calculated value of y(t) was smaller than that of H(x(t)). And by the way, it shows that projectile was in the motion not for only 0.3 s, but for 7.3-7.4 s. Cause you starting time is 7s and from the data i guess it was launched from zero level, that is y = 0.
 
here is a link to the assignment if this helps:

http://web.cecs.pdx.edu/~pkwong/ECE103.htm

it seems this should be a very simple thing because i have derived everything else but it is beyond me at this point.
 
well, the relevant equations you wrote is also kinda strange ;] as i understood, you should find impact time not from some fancy formula like t= ( -70.17 - 70.17 ) / -9.8 whatever that means, but from simply calculating coordinates of projectile at each time step and comparing vertical height (that is y(t)) with the height of the hill.
 
yeah sorry about that, thought i was on the right track
 
Back
Top