Correcting Speed Graphs on Maps Using Excel

In summary: I'm not succeeding.In summary, the conversation is about trying to figure out how to plot a desired curve on a map using data points from a trip. The goal is to create a distance vs. speed graph using data points from an Excel sheet, but the x-axis is skewed and it is difficult to plot the numbers accurately. There is discussion about how to calculate speed using the data points and how to fix the issue with the x-axis. Ultimately, it is suggested to use a scatterplot instead of a line graph.
  • #1
DaveC426913
Gold Member
22,615
6,263
Trying to figure out how to get the curve I want, to plot on a map.
This was my first iteration:
pic_toronto_paris.jpg

It's wrong.The following sample will illuminate why. For illustration, the sample is much smaller and far more idealized than my real dataset, which is 100+ datapoints.

In my idealized trip, I've driven a course 10km long and taken odometer readings every minute.
(The course is 2 km on a back road, followed by 8km on a highway. The 2km on the back road took me 8 minutes, while the 8km by highway took me only 2 minutes.)

So, I dump all these odometer readings into Excel, and it allows me to produce the Distance / Time graph, but I can also produce the Speed / Time graph.

I took speed the graph itself and superimposed it onto the map, twisting it to match the course.

You can see that is is completely wrong. The leg of the journey from B to C,where I am travellnig at 4km/minute is 4/5ths of the entire course, but the overlay indicates that it is only 1/5th.

I know why it's wrong, what I'm trying figure out is how can I transform the datapoints in Excel so that the speed graph is correct. I'm thinking I have to change the cell formulae to calculate speed per cumulative distance travelled? I'm not sure.

speed-graph.png
 
Mathematics news on Phys.org
  • #2
So you want to plot speed vs. distance.
Your speed can be calculated by

[tex]s_n=\frac{d_n-d_{n-1}}{t_n-t_{n-1}}[/tex]

but since your data is in increments of 1 minute each, your speed (in units km/min) at a particular point is just the cumulative distance at that time minus the cumulative distance traveled at the minute before.

So if you have the time 0-10 in cells A2-A12 and distance markers in cells B2-B12, then just create a speed column in cells C2-C12 where cell C2 is 0 and cell C3 has the value =(B3-B2)/(A3-A2) or simply =B3-B2 because of what I explained earlier, and then just drag down from there to fill all the cells.

The problem I've ran into now is that excel by default skews the x-axis so that only the distance positions you've entered are shown. This means that most of your graph is distance 0-2 while the end jumps to 6 and 10. I don't use excel so I'm honestly not sure how to fix this.
 
Last edited:
  • #3
Mentallic said:
So you want to plot speed vs. distance.
Your speed can be calculated by

[tex]s_n=\frac{d_n-d_{n-1}}{t_n-t_{n-1}}[/tex]

but since your data is in increments of 1 minute each, your speed (in units km/min) at a particular point is just the cumulative distance at that time minus the cumulative distance traveled at the minute before.

So if you have the time 0-10 in cells A2-A12 and distance markers in cells B2-B12, then just create a speed column in cells C2-C12 where cell C2 is 0 and cell C3 has the value =(B3-B2)/(A3-A2) or simply =B3-B2 because of what I explained earlier, and then just drag down from there to fill all the cells.
Thank you! This is hugely helpful!

Mentallic said:
The problem I've ran into now is that excel by default skews the x-axis so that only the distance positions you've entered are shown. This means that most of your graph is distance 0-2 while the end jumps to 6 and 10. I don't use excel so I'm honestly not sure how to fix this.
I'm not sure I follow. What "problem" do you see that needs fixing?

The X-axis is marked in equal increments. How is it skewed?
Most of my graph IS in the 0-2 range because that's where I spent most of my trip.
How would you represent it differently?
 
  • #4
DaveC426913 said:
Thank you! This is hugely helpful!

You're welcome :)
DaveC426913 said:
I'm not sure I follow. What "problem" do you see that needs fixing?

The X-axis is marked in equal increments. How is it skewed?

Well my x-axis wasn't in equal increments, possibly because of my settings or whatnot. As long as it turned out right for you though.
 
  • #5
Mentallic said:
Well my x-axis wasn't in equal increments, possibly because of my settings or whatnot. As long as it turned out right for you though.
Oh, I didn't realize you'd done this yourself.

My sample above was hand-drawn, so that wasn't an issue.

For my real chart, at the top of my OP, I didn't copy anything except copy the polygon itself. You can see there's no X-axis markings at all except those I added manually.
 
  • #6
Nope. I'm doing it wrong.

$A is odometer reading
$C is $An-$An-1

$D is $Cn-$An-1.

[EDIT] Wait a minute. The X-axis shouldn't be time, it should be distance.

Don't know how to do that in Excel.
[MOAR EDIT] Oh. Scatter plot. I think
 

Attachments

  • screenshot.png
    screenshot.png
    12.8 KB · Views: 451
Last edited:
  • #7
I'm studying at uni at the moment which means I have limited resources. When I get home tonight I'll give it another look.
 
  • #8
So again you want to plot speed on the y-axis versus cumulative distance on the x-axis. The speed is calculated by your C column, so all you have to do is then plot your C column against your A column. But hopefully you can bypass the problem I've had where the x-axis spaces each odometer reading evenly, even though the readings themselves aren't linear, hence skewing the graph.

Also, that D column is meaningless.
 
  • #9
Mentallic said:
So again you want to plot speed on the y-axis versus cumulative distance on the x-axis. The speed is calculated by your C column, so all you have to do is then plot your C column against your A column. But hopefully you can bypass the problem I've had where the x-axis spaces each odometer reading evenly, even though the readings themselves aren't linear, hence skewing the graph.
Yes, it's the figuring out how to plot a column of numbers on the X-axis that's tricky. Excel doesn't like to do that.

I think the answer is to abandon line/area graph and go to scatterplot, where you are providing both a Y and an X value for any given coordinate.

Mentallic said:
Also, that D column is meaningless.
Yes. I was trying to follow your instructions, but clearly failing.
 
  • #10
DaveC426913 said:
I think the answer is to abandon line/area graph and go to scatterplot, where you are providing both a Y and an X value for any given coordinate.

Yes that seems to do it!

It's ugly and likely unreasonable, but you could get the area graph to work correctly if you tabulate every odometer increment. So you'd have 0-2 with 0.25 increments with speed 0.25, and then 2-10 with again 0.25 increments with speed 4. It would add a lot of extra data and make things ugly though, so I think the XY scatter plot is the best choice here.
 
  • #11
Mentallic said:
but you could get the area graph to work correctly if you tabulate every odometer increment. So you'd have 0-2 with 0.25 increments with speed 0.25, and then 2-10 with again 0.25 increments with speed 4. It would add a lot of extra data and make things ugly though, so I think the XY scatter plot is the best choice here.
Yes, that's the issue, I only have as much data as I have - i.e. one datapoint per minute.

What I have not yet worked out is a way of automatically taking an odometer reading at a given interval. At the moment, I'm doing it manually. i.e. clock ticks over one minute, write odo reading on a piece of paper. This is quite tedious, not to mention dangerous.

Yes, I could automate the entire process all the way to plotting the data on a map, simply by using a GPS system, but that takes all the fun out of it.
 
  • #12
A passenger could help immensely ;)

So does the XY scatterplot do the trick for you? I tried one of the line graphs of that type and it seemed to curve up and around (above speed = 4), which I guess is an attempt to smooth out the edges.
 
  • #13
Mentallic said:
A passenger could help immensely ;)
In theory, true. In practice, if I had a passenger, she would almost certainly prefer to chew her arm off rather than spend a two hour trip writing down a number every 60 seconds. :p
Mentallic said:
So does the XY scatterplot do the trick for you? I tried one of the line graphs of that type and it seemed to curve up and around (above speed = 4), which I guess is an attempt to smooth out the edges.
Turn off the smoothing option.

I'm trying the scatterplot now. At first blush, it does the trick. Now I'm plotting it on the map, and trying to see if it really does line up better than my original attempt.
 
  • #14
DaveC426913 said:
In theory, true. In practice, if I had a passenger, she would almost certainly prefer to chew her arm off rather than spend a two hour trip writing down a number every 60 seconds. :p

But Dave, I'm sure you could persuade a few ladies to join you by arguing that they'll be free to do as they wish for the other 59 seconds of each minute :D

DaveC426913 said:
Turn off the smoothing option.

I'm trying the scatterplot now. At first blush, it does the trick. Now I'm plotting it on the map, and trying to see if it really does line up better than my original attempt.
Ok and if it doesn't work, you could make good use of the area graph by getting a stopwatch to calculate the time between each distance unit on the odometer (making it as large as you deem reasonable). This can be done quite easily if you use the lap function. This way, you'll have data that will have a linear x-axis because each of your data points will be equal increments in distance.
 
  • #15
Mentallic said:
Ok and if it doesn't work, you could make good use of the area graph by getting a stopwatch to calculate the time between each distance unit on the odometer (making it as large as you deem reasonable). This can be done quite easily if you use the lap function. This way, you'll have data that will have a linear x-axis because each of your data points will be equal increments in distance.
Yes. I've considered doing it that way. But the exigencies of driving oblige me to go with the method least taxing on eyes and hands.
 
  • #16
It definitely lines up nicely.
3d-map-2.jpg
 

Related to Correcting Speed Graphs on Maps Using Excel

1. What is plotting speed over distance?

Plotting speed over distance is a way to visually represent the relationship between speed and distance traveled. It can be used to analyze patterns and trends in an object's movement.

2. How is plotting speed over distance done?

To plot speed over distance, you first need to collect data on an object's speed and distance traveled. This can be done using a stopwatch and measuring the distance traveled. Then, using a graphing tool or software, you can plot the speed on the y-axis and distance on the x-axis to create a line graph.

3. What does the slope of a speed over distance graph represent?

The slope of a speed over distance graph represents the object's velocity, or how fast it is moving in a specific direction. A steeper slope indicates a higher velocity, while a flatter slope indicates a lower velocity.

4. Can plotting speed over distance be used for any type of object?

Yes, plotting speed over distance can be used for any type of object that is moving. This includes cars, runners, bicycles, and even particles in motion.

5. How can plotting speed over distance be useful in scientific research?

Plotting speed over distance can be useful in understanding the behavior and characteristics of moving objects. It can also help in analyzing data and identifying patterns or anomalies in an object's movement. Additionally, it can be used to make predictions and calculations related to an object's speed and distance traveled.

Similar threads

  • General Discussion
Replies
24
Views
1K
Replies
1
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
24
Views
4K
Back
Top