Question: Write a C program to simulate a falling object. The program should ask for the initial height of the object, in feet. The output of
Write a C program to simulate a falling object. The program should ask for the initial height of the object, in feet. The output of the program should be the time for the object to fall to the ground, and the impact velocity, in ft/s and miles/hour. Your program should use Eulers method to numerically solve the differential equations describing the motion of a falling object. In Eulers method, the state of the object at some small future time is calculated using the values at the present time. This small future timestep is typically called delta time, or dt. Thus the position (p) and speed (v) of the object in the next timestep t + dt is written as a simple function of the position and speed at the current timestep t (g is the acceleration due to gravity): v(t+dt) = v(t) + g * dt
p(t+dt) = p(t) + v(t+dt) * dt You should actually start out with the velocity as zero, and the position at the initial height of the object. Then your position (above the ground) would be: p(t+dt) = p(t) - v(t+dt) * dt And you would integrate until the position becomes less than or equal to zero. The input/output formats for your program should look like this: Program to calculate fall time and impact speed of a falling object dropped from a specific height.
Enter initial height in feet: 100 Falling time = 2.492224 seconds Impact speed = 80.249613 feet/sec Impact speed = 54.715645 mph
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
