# Need distance/speed formula

1. Jan 7, 2014

### acapro

Hi Guys, sorry in advance if I am posting this in the wrong place.

I need to find the formula for calculating the following:

If
100 travels 1km in 2:50 mins
200 travels 1km in 2:20 mins
and
300 travels 1km in 3:00 mins

what would the calculation be to determine what number would travel the 1km the quickest (i.e. between 1-500)? and what time would that time would that number take to travel the 1km?

2. Jan 7, 2014

### Mentallic

What do these numbers represent?

With what you've presented so far, it's impossible to give a conclusive result.

3. Jan 7, 2014

### acapro

They represent wing angle in regards to down force v drag. so say 1 equals next to no wing angle, 500 equals 100% wing angle. so what I need to determine is with the 3 numbers we have what formula would I apply to establish which wing angle number would produce the quickest time and what time would it produce i.e what number between 1 and 500 would produce the quickest time.

4. Jan 7, 2014

### Mentallic

There are an infinite amount of possible functions that would give those time values for each given number. Some possibilities:

- the time could go down for <100 instead of the trend you might expect for it going upwards
- for 100-200 it could have possibly reached its minimum in that range
- 200 could be the minimum
- 200-300 could have the minimum
- for >300 it could steadily decline and its minimum could be there.

The only thing we know for certain is that 100 and 300 aren't the minimum.

You may want to ask in the physics section because this is an aerodynamics problem and not purely maths.

5. Jan 7, 2014

### acapro

its not simply a physics problem even though the numbers in this instance relate to wings, the numbers could represent anything

6. Jan 7, 2014

### acapro

- the time could not reduce for<100 as 200 has already shown to be quicker
- there is 30 seconds between 100 and 200 and 200 40 seconds between 200 and 300 so the answer will lay between 100 and 200
- 200 will not be the minimum as the the time increments are the same i.e the time improvement from 100 - 101 is the same as the time improvement between 101 and 102 so the fastest number should lay around 190
- 200 -300 can not have the quickest time
- yes as in point 3 the time increase or decrease is exactly the same per number

7. Jan 7, 2014

### Mentallic

That crucial information gives us a lot more to work with.

You mentioned that the time improvement between each wing number is the same, hence the functions to describe this would be linear. However, the problem with this is that as time from 100 to 200 improves (it goes from 2:50 to 2:20 over those 100 values) then it clearly needs to turn around at some point because at 300 the time has worsened to 3:00. Realistically, I can't imagine the relationship to be this simplistic, it would have to be more quadratic in nature, but if we're to work with it regardless, then we're looking at a piecewise linear function that might be something like this:

We'll convert the time into seconds

number: 100 200 300
time (s): 170 140 180

We're going to assume that the rate the time improves in the region where it does improve will be the same as the rate the time worsens in the other region. The shape of our graph will be in a V shape where the point of V is our minimum and lies somewhere between 100-200.

As the time worsens as the number goes to zero, there must be some number k<100 such that time = 180 for that value. The minimum will then lie exactly between 300 and k (the average) which is at (300+k)/2 = 150+k/2. The time at this value which is what we're looking for will be denoted by tmin.

So the line that improves in time from k to the minimum is described by

$$\frac{t-t_1}{x-x_1}=\frac{t_2-t_1}{x_2-x_1}$$

where

$$(x_1,t_1)=(k,180)$$
$$(x_2,t_2)=(150+k/2,t_{min})$$

Once you've substituted those values into the equation, consider that the line must also satisfy (100,170) because it must pass through that value. So substitute $(x,t)=(100,170)$ and you'll then have an equality in terms of k and tmin.

Now you just need to follow a similar process for the other half of the V shape. Connect $(150+k/2,t_{min})$ to $(300,180)$ to find the equation, and then consider that (200,140) lies on that line.

edit: For the second line, set the gradient to be the negative of the gradient of the first line.

Last edited: Jan 7, 2014
8. Jan 7, 2014

### acapro

Excellent Mentallic,

I am developing an excel calculator to do this equation so if I was to instruct the worksheet to do this equation (to find the k and tmin numbers) with the only manual input being as you described numbers being 100=170, 200=140, 300=180 (one number in each cell) how would I write it.

Last edited: Jan 7, 2014
9. Jan 8, 2014

### Simon Bridge

I'm still a bit puzzled - in order to get what you want, you need to decide on a theoretical model that matches the "wing angle number" with "time of flight over 1km" ... presumably with a fixed launch speed? Mentallic seems to have guessed one possible model from the behavior of the numbers.

I think you need to level with us about what you are doing this for.
Where does the data come from, what do you hope to achieve?
(i.e. are you supposed to deduce the correct theory from the data?)
If it is a secret we cannot hep you.

10. Jan 8, 2014

### Mentallic

acapro, why would you need an algorithm? Isn't the answer to this problem enough?

Given the criteria that I outlined in my previous post, the minimum would be k=187.5 with tmin=135s = 2:15.

11. Jan 8, 2014

### acapro

Its no secret

my stab at a (very simplified) theoretical

Imagine a drag car on a 1/4 mile

(Consider we have 500 wing setting increments)
If we set the wing angle on number 1 the drag is reduced to near zero however we have no grip off the start therefore we will be very slow. If we set the wing angle on 500 then we will have maximum grip however maximum drag, again very slow. so we have to find the best wing angle to produce the quickest possible time using 3 runs.

Run one with a wing angle of 100 we produce a time of 170 seconds
Run 2 wing angle 200 we produce a time of 140 seconds
and run 3 with a wing angle of 300 we produce a time of 180 second
We could go with a wing angle of 200 however Mentallic has shown that 187.5 is the fastest wing angle
(yes I am aware many more factors come into play)

So what I want to be able to do is enter the above 6 numbers in an excel sheet and for the answer to be as Mentallic has provided "k=187.5 with tmin=135s = 2:15"

What I need to know is to get the excel sheet to calculate this I have to provide it with 2, 1 line equations 1 to produce the k answer and 1 to produce the tmin answer.

ps: Metallic I appreciate the time you have provide to this

12. Jan 8, 2014

### Mentallic

In that case, it's really not that difficult to find! My first approach was rather convoluted because I only thought of setting the gradients to be negatives of each other after all was said and done.

P1 = (100,170)
P2 = (200,140)
P3 = (300,180)

We will let the numbers be denoted n and the time be denoted t (it's equivalent to having an x and y variable) so our points P = (n,t).

The equation of a line that passes through two points $(n_1,t_1)$ and $(n_2,t_2)$ is

$$t=t_1+m(n-n_1)$$

where m is the gradient and can be calculated between two points by

$$m = \frac{t_2-t_1}{n_2-n_1}$$

So since we know that the minimum point must lie to the left of P2, this means that the line on the right section of the V shape passes through P2 and P3. Plugging this into our equation gives us

(Keep in mind that it doesn't matter whether we choose P2 or P3 to be (n1,t1).
$$P2 = (n_1,t_1) = (200,140)$$
$$P3 = (n_2,t_2) = (300,180)$$

$$t=t_1+\frac{t_2-t_1}{n_2-n_1}(n-n_1)$$

Plugging our values in:

$$t=140+\frac{180-140}{300-200}(n-200)$$

simplifying:

$$t=140+\frac{2}{5}(n-200)$$

$$t=140+\frac{2n}{5}-80$$

$$t=60+\frac{2n}{5}$$

So our minimum point lies on this line. That is, if we find the value of n, then t can be calculated using this formula.

To find n, we need to find the equation of the line on the left section of the V shape. Remember the equation of the line formula:

$$t=t_1+m(n-n_1)$$

Well this time, we know that the gradient is the negative of the other line's gradient which we found to be 2/5, so in this case, m=-2/5. The reason the gradient is the negative of the other gradient is because we want the time to improve at the same rate that it worsens. You can convince yourself by plotting a few lines such as
y=x, y=-x
y=3x, y=-3x
y=2x/5, y=-2x/5

We also have a point P1. So can you find the line?

13. Jan 8, 2014

### Simon Bridge

It is so much easier now we know the context.
It's the rear spoiler ("wing" in drag-racing speak) on a ground vehicle.

Note - just put the calculation Mentalic did into the spreadsheet.
Do you follow what was done?

It would still be better to get some more data points ... the actual shape of a wing-number vs run-time would be a non-simple curve. I'd have had the three data points model as points on a parabola. This could work well if the data are close to the required ideal setting. (see links below). But you pick what you are comfortable with - it can get as complicated as you like ;)

What you need is probably best found as the relationship between lift and drag - given for aircraft.
In your case, "lift" becomes "downforce" and will act to increase traction with the ground ... allowing greater accelerations without slipping.
Drag is still the same.

To minimize your travel time, you want an angle range where the downforce-to-drag ratio is high.
If aircraft wings are anything to go by, this will actually be a range of angles.
http://www.allstar.fiu.edu/aero/lift_drag.htm
http://avstop.com/ac/flighttrainghandbook/drag.html

I don't know what the equivalent is for drag or sprint car wings off-hand - the comparison looks compelling:
See: http://www.circletrack.com/ultimateracing/ctrp_1011_sprint_car_wing_aerodynamics/
(sprint car)

Depending on the stakes, it may be worth your while to get better data anyway.
Probably faster to binary-search the settings. You know one too high and one too low, so split the difference and try again.
I think you'll find that the other factors are so variable that a difference of a few points off ideal will not do anything to the overall time.

Seems funny that you need a computer to tell you the same thing as a pen and paper.
Personally I don't trust the things.

I think you can use the "trendline" function in exell to get you the a,b,c in the equation y=ax^2+bx+c, of the parabola that passes through all three points. (y=time, x=wing number)
After that x=-b/2a is the wing number you want.

This is a nasty estimation BTW.

Last edited: Jan 8, 2014
14. Jan 8, 2014

### Office_Shredder

Staff Emeritus
Do you know how to use Excel? If you do and you understand the solution then it is fairly trivial to get a spreadsheet to do the calculation. If you do not understand the solution, then ask for it to be explained better; if you don't know how to use Excel then you should probably look up a tutorial on it or ask in the Computing and Technology section any questions you have on it.

Last edited: Jan 8, 2014
15. Jan 8, 2014

### Mentallic

If the OP's version of excel does indeed have a utility that fits a parabola to the points, then that would have to be a far better and easier solution.

16. Jan 8, 2014

### Staff: Mentor

Every version of Excel that I've used can fit a polynomial to a set of points on a graph, and display an equation for the fitted curve. First make the graph ("chart"), then look for "Add Trendline" in the menus, and choose a polynomial fit with order 2.

17. Jan 8, 2014

### Staff: Mentor

The wing has no effect when the car starts off. Air has to be flowing over the wing for it to produce a downward thrust.

18. Jan 8, 2014

### acapro

I think this is the way to go, I will look into this

Thanks
Guys

19. Jan 8, 2014

### akib

You've done really a great job here.
Thanls a lot!

20. Jan 8, 2014

### Mentallic

There's an easier approach that I posted in post #12.

Regardless, as has been mentioned many times already, a quadratic would be a far better fit than two piecewise linear functinos.