TASK: If a penny is dropped down a well that reaches the center of the earth, when will it hit the bottom?
COMMENT: If an object, initially at a height of H feet, is released, it will fall towards the center of the earth. Its position after T seconds will be
y(t) = H - 16 t^2
Blacksburg has an elevation of 2,080 feet. The earth's radius is about 20,900,000 feet.
Using these facts, write a program that computes the location, second by second, of a penny that is dropped down a Blacksburg well. We assume that the well goes all the way to the center of the earth.
Use this program to report, to the nearest second, the moment when the penny reaches the center of the earth.
Note to physics students: Actually, the formula we are using is only appropriate for motion near the surface of the earth; as the penny bores through the earth, the effect of gravity will decrease, and the time required to reach the center will significantly increase, to about 21 minutes.
INSTRUCTIONS:
Initialize your time to 0. Start a "Do Forever" While loop Use the formula to determine the Y position at the current time. If the Y position is below the center of the earth, terminate the loop Otherwise, increase time by one second. End the loop Print the time and Y location
CHECK: If we wait just until the penny drops from Y=2080 to Y=0 (sea level), that takes about 12 seconds. From the "note to physics students", we can also guess that our model will reach the center of the earth in less than 21 minutes. So you should expect an answer somewhere within that range.
SUBMIT: Your work should be stored in a script file called "hw030.m". Your script file should begin with at least three comment lines:
% hw030.m % YOUR NAME % This script (describe what it does) % Add any comments here that you care to make.If this problem is part of an assignment, then submit it to Canvas.