You arrive at a racetrack and observe a car moving around a track at what appears to be a constant rate of speed. You would like to be able to predict where the car is at any point in time. To do this, you take a measurement of how far around the track the vehicle has traveled at two points in time. Assume that the track is marked so that you can determine position very precisely. You note the time of this first position measurement. A short while later (before the vehicle has passed the "starting" point on the track), you take a second measurement for how far around the track the vehicle has traveled, again noting the time. Now, assume that you'd like to reconstruct the position of the vehicle at any time between the first measurement and the second. Since you assume the vehicle is moving at constant speed, this calculation can be found precisely by linear interpolation. • Determine what variables you will need to use, and what formula(s) you will need to use to perform this calculation. You should use variables for all of the values that could change. Part 1. Now, assume that for your observation, the first measurement was taken 30 seconds after you arrived, and the second was taken 45 seconds after you arrived. At the first measurement, the car was 50 meters past the starting line of the track. At the second measurement, the car was 615 meters past the starting line of the track. Write a program that determines, for any time between 30 and 45 seconds, where the car will be on the track (in terms of meters past the starting line). The time to evaluate at should be a variable in your program. The program should print both the time and the position at that time to the screen, with a line describing what is being output. You should test your program at various times and make sure the results seem reasonable. For your final program that you turn in, you can assume that you want to know the position at a time 37 seconds after you first arrived. (Next week, we will see how you can read in numbers from a user, but for now, just assume it is a fixed number of seconds.)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please help me solve parts a and b in python. Attach screenshots of your code for better understanding. Thank you! :)

Part 2.
Assume the racetrack is circular with radius 0.5 kilometers. Assume the same observed data as before: 30
seconds after you arrive, the car is 50 meters past the starting point, and 45 seconds after you arrive, the
car is 615 meters past the starting point. Assume the car's speed is constant.
When a time is specified, we want to report the distance from the starting point, not the total distance
traveled. So, every time the car passes the starting point of the track, its "distance" from the starting point
gets reset to zero (0). So, if you go far into the future, say at a point 20 minutes after your arrival time,
simple linear interpolation will not produce the result we want. You'll need to modify your code to report
distances correctly regardless of the time.
Here are a few hints for Part 2:
• If we use the same code from above and enter a time of 20 minutes, we calculate a distance
greater than the track circumference. (Estimate that calculated distance from your plot.)
However, we want report a position of the track between 0 meters and the numerical value of the
track circumference expressed in meters.
We could do this using a series of subtractions. We could perform successive subtractions of the
circumference from the total position until the result was between 0 meters and the numerical
value of circumference in meters. That would represent the position with respect to the starting
point.
Transcribed Image Text:Part 2. Assume the racetrack is circular with radius 0.5 kilometers. Assume the same observed data as before: 30 seconds after you arrive, the car is 50 meters past the starting point, and 45 seconds after you arrive, the car is 615 meters past the starting point. Assume the car's speed is constant. When a time is specified, we want to report the distance from the starting point, not the total distance traveled. So, every time the car passes the starting point of the track, its "distance" from the starting point gets reset to zero (0). So, if you go far into the future, say at a point 20 minutes after your arrival time, simple linear interpolation will not produce the result we want. You'll need to modify your code to report distances correctly regardless of the time. Here are a few hints for Part 2: • If we use the same code from above and enter a time of 20 minutes, we calculate a distance greater than the track circumference. (Estimate that calculated distance from your plot.) However, we want report a position of the track between 0 meters and the numerical value of the track circumference expressed in meters. We could do this using a series of subtractions. We could perform successive subtractions of the circumference from the total position until the result was between 0 meters and the numerical value of circumference in meters. That would represent the position with respect to the starting point.
You arrive at a racetrack and observe a car moving around a track at what appears to be a constant rate of
speed. You would like to be able to predict where the car is at any point in time. To do this, you take a
measurement of how far around the track the vehicle has traveled at two points in time. Assume that the
track is marked so that you can determine position very precisely. You note the time of this first position
measurement. A short while later (before the vehicle has passed the “starting" point on the track), you
take a second measurement for how far around the track the vehicle has traveled, again noting the time.
Now, assume that you'd like to reconstruct the position of the vehicle at any time between the first
measurement and the second. Since you assume the vehicle is moving at constant speed, this calculation
can be found precisely by linear interpolation.
• Determine what variables you will need to use, and what formula(s) you will need to use to
perform this calculation. You should use variables for all of the values that could change.
Part 1.
Now, assume that for your observation, the first measurement was taken 30 seconds after you arrived, and
the second was taken 45 seconds after you arrived. At the first measurement, the car was 50 meters past
the starting line of the track. At the second measurement, the car was 615 meters past the starting line of
the track.
Write a program that determines, for any time between 30 and 45 seconds, where the car will
be on the track (in terms of meters past the starting line). The time to evaluate at should be a
variable in your program. The program should print both the time and the position at that time
to the screen, with a line describing what is being output. You should test your program at
various times and make sure the results seem reasonable.
For your final program that you turn in, you can assume that you want to know the position at
a time 37 seconds after you first arrived. (Next week, we will see how you can read in numbers
from a user, but for now, just assume it is a fixed number of seconds.)
Transcribed Image Text:You arrive at a racetrack and observe a car moving around a track at what appears to be a constant rate of speed. You would like to be able to predict where the car is at any point in time. To do this, you take a measurement of how far around the track the vehicle has traveled at two points in time. Assume that the track is marked so that you can determine position very precisely. You note the time of this first position measurement. A short while later (before the vehicle has passed the “starting" point on the track), you take a second measurement for how far around the track the vehicle has traveled, again noting the time. Now, assume that you'd like to reconstruct the position of the vehicle at any time between the first measurement and the second. Since you assume the vehicle is moving at constant speed, this calculation can be found precisely by linear interpolation. • Determine what variables you will need to use, and what formula(s) you will need to use to perform this calculation. You should use variables for all of the values that could change. Part 1. Now, assume that for your observation, the first measurement was taken 30 seconds after you arrived, and the second was taken 45 seconds after you arrived. At the first measurement, the car was 50 meters past the starting line of the track. At the second measurement, the car was 615 meters past the starting line of the track. Write a program that determines, for any time between 30 and 45 seconds, where the car will be on the track (in terms of meters past the starting line). The time to evaluate at should be a variable in your program. The program should print both the time and the position at that time to the screen, with a line describing what is being output. You should test your program at various times and make sure the results seem reasonable. For your final program that you turn in, you can assume that you want to know the position at a time 37 seconds after you first arrived. (Next week, we will see how you can read in numbers from a user, but for now, just assume it is a fixed number of seconds.)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY