Help calculating distance between two moving objects

  • Thread starter Thread starter CraigDNeo
  • Start date Start date
Click For Summary
To calculate the distance between two moving objects, it's essential to recognize that their accelerations are not constant, as indicated by the varying times to reach specific distances. The average velocities of the two objects were calculated, with Object One at 76.12 feet/second and Object Two at 79.23 feet/second. The discussion highlights the need for more data points to accurately model their motion, suggesting a curve-fitting approach to determine the distance between them at various intervals. The calculations provided indicate that, despite the complexities of non-constant acceleration, it is possible to estimate the distance between the two objects using the derived equations. Ultimately, the final approximation shows that Object Two is approximately 70.2 feet ahead of Object One at the 330-foot mark.
CraigDNeo
Messages
21
Reaction score
0
I am working on a little side project in code and I am trying to figure out how to calculate the distance between two moving objects at a give point. If the two objects both started out from rest at the same time, moving in a straight line. Object one moved 330 feet in 4.335 seconds, Object two moved 330 feet in 4.165 seconds. Is there a way calculating an average velocity and/or acceleration to determine how many feet ahead object two is in front ob object one.

I have done the velocity and acceleration calculations, and I am still struggling. For example, I know that Object one has an average velocity of 76.12 feet/second at 330 feet, and object two has an average velocity of 79.23 feet/second. I am not sure how to get the acceleration of the two objects. I do have a reference point, object one hit 60 feet 1.562 seconds and object two hit 60 feet in 1.450 seconds.

So what I did was subtract the difference in velocity for object one to get acceleration. Object one went from 60 feet to 330 feet in (4.335s - 1.562s) which is 270 feet / 2.773s which gives me an average velocity of 97.36 feet/s. Object two went from 60 feet to 330 feet in (4.165 - 1.450) which is 270 feet / 2.715s, which gives me an average velocity of 99.44 feet/s.

From those values I calculated acceleration, object one moved that 270 feet at a rate of (97.36f/s - (60f/1.562))/2.773 is 21.25 ft/s/s, and object two moved that 270 feet at a rate of (99.44 f/s - (60f/1.450))/2.715s is 21.38 ft/s/s.

Now, I think I got the velocity and acceleration calcs correct, but I am not sure how to get distance, and when I plug in the numbers in a distance formula, they just don't seem right.

Can someone help me out, or please guide me in the right direction on what I am doing wrong.

Thanks in advance for your time and response.
 
Physics news on Phys.org
Based on your values of time given at the reference points, the acceleration is not constant, implying that the net force acting on each object is not constant, and in which case, the standard kinematic equations of motion for constant acceleration do not apply. If the accelerations were constant, then you could calculate each objects acceleration using s = 1/2at^2, then compare their displacements at 1 second 5 seconds, 10 seconds, etc., and subtract the distances to find out how far apart they are at a given time. But since their accelerations are not constant, you'd have to find the correct equations for displacement by plotting the curve based on a number of values at different points in time.
 
Would you have a sample on how to do that or a link to one.

Much thanks
 
I guess you'd have to take distance/time measuremnts at several reference points, then try to fit a curve to those points to get the distance versus time equation. Not easily done. Google or AltaVista on "Curve Fitting". I don't know what is your application for this problem.
 
It is two race cars and I am trying to figure out how to calculate the distance between them at certain foot markers. thanks for the feedback. I thought there would be a sample out there somwhere but have come up dry.
 
Well if you didn't come up with that reference point at 60 feet, I would have assumed constant acceleration, and then the distance traveled by each car could be determined from s= 1/2at^2, solve for 'a' for each vehicle from your given times at s=330, then you can find the distance apart for any time t. But your time at 60 meters clearly indicates that acceleration is not constant. And when you think about it, the value of the acceleration depends upon air drag, max traction friction, how much pedal to the metal, etc, so it is bound not to be constant in real life situations.
 
CraigDNeo said:
It is two race cars and I am trying to figure out how to calculate the distance between them at certain foot markers. thanks for the feedback. I thought there would be a sample out there somwhere but have come up dry.

You found the times at 60 ft and 330 ft. You need more data points. Get the times at 60, 90, 140, 215, and 330 ft. If you do that, I can help you figure things out.
 
Thanks for the reply, but there is no way to get those times, these values from time ticket, and as the car crosses the beams that time is stamped on the ticket, we usually get 60, 330, 660, 1000 and 1320 if doing a quarter mile. If eighth mile you get 60, 330 and 660. I do have the final MPH at the 660 foot mark for a final velocity. I tried using that number in some different formulas, but it did not look right. I can post details later. I am not looking for an exact distance, but an approximation of how far one car is ahead of the other. Do you think this is possible with the supplied data?
 
Well, the acceleration is not constant, so I think the best we can do is assume that it is linear in time. In other words, the acceleration is given by a=A+B*t. The distance traveled is a*t^2/2. We can solve this for the data at 60 and 330 feet for the first case to get A1=57.105 and B1=-5.071. For the second case we get A2=67.238 and B2=-7.009. Now you can figure the position of the first car by x1=(A1+B1*t)*t^2/2 and the position of the second car by x2=(A2+B2*t)*t^2/2. Subtract x1 from x2 to get the distance that car 2 is ahead of car 1.
 
  • #10
Please excuse me if this is a dumb question, when you are doing the a=A+B*t and calculating the 60 foot for example. I know that when plugging in the numbers it is x=a*t^2/2 which is 60 foot = a*(1.450)^2/2 which is 120/2.1025 = 57.075, which you said is A1, but how are you getting B1, and why is it negative?
 
  • #11
oh, and thanks so much for helping me with this!
 
  • #12
CraigDNeo said:
Please excuse me if this is a dumb question, when you are doing the a=A+B*t and calculating the 60 foot for example. I know that when plugging in the numbers it is x=a*t^2/2 which is 60 foot = a*(1.450)^2/2 which is 120/2.1025 = 57.075, which you said is A1, but how are you getting B1, and why is it negative?

You have two equations for the first car: Xa=(A+B*ta)*ta^2/2 and Xb=(A+B*tb)*tb^2/2 where Xa=60 feet, ta=1.562 sec, Xb=330 feet, tb=4.335 sec. This is two equations with two unknowns (A and B) and you solve them for A and B.

Use the same procedure for the second car.
 
  • #13
But x does not equal 1/2at^2, because that equation only applies for constant acceleration. It may not be too bad, however, to assume that a = A + Bt, linear over a short time period, although this is not known for sure (it may be a decaying ' e to the kt ' function). In which case, the distance is the second integral of the acceleration, per the calculus, that is, x = At^2/2 + Bt^3/3, a cubic relationship instead of the constant acceleration quadratic relationship.
 
  • #14
Ok, so for Car 1, I have the following:

60 = (A + B * 1.562) * 1.220
330 = (A + B * 4.335) * 9.396

if I use the second formula to solve for A:
330 = (4.335A + 4.335B) * 9.396
35.12 = (4.335A + 4.335B)
35.12 - 4.335B = 4.335A
8.10 - B = A

then figured I would use that value for A and plug it into the first formula and solve for B, but I don't think I got A correct.
 
  • #15
CraigDNeo said:
Ok, so for Car 1, I have the following:

60 = (A + B * 1.562) * 1.220
330 = (A + B * 4.335) * 9.396
No, you are using x =aT, which is completely wrong. As i tried to explain, using the assumption that 'a' varies linearly with time so that a =A +Bt, then
x = (1/2)At2 + (1/3)Bt3
For car 1,
60 = (0.5)A(1.562)2 + (0.333)(B)1.5623 , and
330 = (0.5)A(4.335)2 + (0.333)(B)4.3353

Solve those 2 equations with 2 unknowns for A and B.

Do likewise for the 2nd car, and solve for A and B for that car.

Then compare.

Incidentally, these accelerations initially are close to 2 g's, very high. I assume rear wheel drive and most of the car's weight on the back tires due to near lifting of the front tires, and a pretty high friction coefficient between the tires and road?

.
 
  • #16
CraigDNeo said:
Ok, so for Car 1, I have the following:

60 = (A + B * 1.562) * 1.220 (correct)
330 = (A + B * 4.335) * 9.396 (correct)

if I use the second formula to solve for A:
330 = (4.335A + 4.335B) * 9.396 (wrong - it should be 330 = A*9.396 + B*4.335*9.396)

Multiplication first, then addition. If we wanted to multiply A+B by 4.335, we would have written

330 = ((A + B) * 4.335) * 9.396

Keep going, you have the idea. But please note, PhanthomJay (below) is right. We are substituting (A+Bt) for a in the formula x=at^2/2 and this is ok, but it does not mean the acceleration is (A+Bt).

PhanthomJay said:
But x does not equal 1/2at^2, because that equation only applies for constant acceleration. It may not be too bad, however, to assume that a = A + Bt, linear over a short time period, although this is not known for sure (it may be a decaying ' e to the kt ' function). In which case, the distance is the second integral of the acceleration, per the calculus, that is, x = At^2/2 + Bt^3/3, a cubic relationship instead of the constant acceleration quadratic relationship.

Yes, you are right. If a is a function of t, then x does not equal a(t)t^2/2. But I think your expression for x is wrong. The bottom line is that we are assuming that the third derivative of x(t) is constant. Let's call the third derivative k. Then we can do a Taylor expansion to get

x(t)=x(0)+v(0)t+\frac{1}{2}a(0)t^2+\frac{1}{6}kt^3

where x(0), v(0), a(0) are the position, velocity, and acceleration at time t=0. You can see that the second derivative (the acceleration) is given by a(t)=a(0)+kt and the third derivative is k. So if a(t)=A+Bt, then A=a(0) and B=k. Since x(0)=0 and v(0)=0, when the acceleration is A+Bt we have:

x(t)=\frac{1}{2}At^2+\frac{1}{6}Bt^3

So your second equation is wrong, and my equation x(t)=a(t)t^2/2 is wrong.

I told CraigDNeo to keep going, because all this will cause confusion. All we really need to say is that the way I did it the first time, the acceleration is not (A+Bt). Instead we can tell him to substitute a=(A+Bt) into x=at2/2. The acceleration will then be (A+3Bt). Sorry for the confusion.
 
Last edited:
  • #17
"Multiplication first, then addition. "

doh, my bad. Thanks to both of you, let me work the numbers and see what I come up with. I can't thank you enough for all the info you have provided.
 
  • #18
Here is my breakdown, please correct me if I am wrong.Car1

330 = (A + B * 4.335) * 9.396
330 = 9.396A + 9.396B * 4.335
330 = 9.396A + 40.73B
(-40.73 from both sides)
9.396A = 330 - 40.73B
(divide by 9.396)
A = 35.12 - 4.33B

Now substituting A in the first formula using A = 35.12 - 4.33B I get the following:

60 = (35.12 - 4.33B + B * 1.562) * 1.220
60 = (35.12 - 4.33B + 1.562B) * 1.220
60 = (35.12 * 1.220 - 4.33 * 1.220 * B + 1.562 * 1.220 * B
60 = 42.85 - 5.28B + 1.91B
60 = 42.85 - 3.37B
(- 42.85 to both sides)
60 - 42.85 = 42.85 - 3.37B - 42.85
17.15 = -3.37B
(divide by 3.37)
17.15/3.37 = -B
5.08 = -B

so B1 = -5.08now using B, I can solve for A

A = 35.12 - 4.33 * -5.08
A = 35.12 + 21.99
A = 57.11

so A1 = 57.11

So for CAR1 A1 = 57.11 and B1 = -5.08Car 2:

330 = (A + B * 4.165) * 8.67
330 = 8.67A + 8.67B * 4.165)
330 = 8.67A + 36.11B
(-36.11 from both sides)
8.67A = 330 - 36.11B
(divide by 8.67)
A = 38.06 - 4.16B

Now Substituting A in the first forumla using A = 38.06 - 4.16B I get the following:

60 = (38.06 - 4.16B + B * 1.450) * 1.051
60 = (38.06 - 4.16B + 1.450B) * 1.051
60 = (38.06 * 1.051 - 4.16 * 1.051 * B + 1.450 * 1.051 * B)
60 = 40.00 - 4.37B + 1.52B
60 = 40.00 - 2.85B
(-40.00 to both sides)
60 - 40.00 = -2.85B
20 = -2.85B
(divide by 2.85)
20/2.85 = -B
7.01 = -B

So B2 = -7.01

now using B, I can solve for A

A = 38.06 - 4.16 * -7.01
A = 38.06 + 29.16
A = 67.22

So A2 = 67.22

So using X1 = (A1 + B1 * t) * t^2/2 for Car1 at the 330 foot time mark

X1 = (57.11 + (-6.08) * 4.165) * 8.67
X1 = (57.11 + (-25.32)) * 8.67
X1 = (57.11 * 8.67 + (-25.32 * 8.67))
X1 = 495.14 + (-219.52)
X1 = 275.62

So using X2 = (A2 + B2 * t) * t^2/2 for Car 2 at the 330 foot mark
X2 = (67.22 + (-7.01) * 4.335) * 9.396
X2 = (67.22 + (-30.38)) * 9.396
X2 = (67.22 * 9.396 + (-30.38 * 9.396))
X2 = 631.59 + (-285.45))
X2 = 346.14

X2 - X1
346.14 - 275.62 = 70.22 feet

so car 2 is ahead of car 1 by 70.22 feet at the 330 foot mark.
 
  • #19
I redid the break down with the Xa = (A + 3Bta) * ta^2/2 and Xb = (A + 3Btb) * tb^2/2 and got the following


Car1

330 = (A + 3B * 4.335) * 9.396
330 = 9.396A + 9.396B * 4.335 * 3
330 = 9.396A + 122.19B
(-122.19 from both sides)
9.396A = 330 - 122.19B
(divide by 9.396)
A = 35.12 - 13B

Now substiting A in the first formula using A = 35.12 - 13B I get the following:

60 = (35.12 - 13B + 3B * 1.562) * 1.220
60 = (35.12 - 13B + 1.562B * 3) * 1.220
60 = (35.12 - 13B + 4.686B) * 1.220
60 = (35.12 * 1.220 - 13 * 1.220 * B + 4.68 * 1.220 * B
60 = 42.85 - 15.86B + 5.71B
60 = 42.85 - 10.15B
(- 42.85 to both sides)
60 - 42.85 = 42.85 - 10.15B - 42.85
17.15 = -10.15B
(divide by 10.15)
17.15/10.15 = -B
1.699 = -B

so B1 = -1.69

now using B, I can solve for A

A = 35.12 - 13 * -1.69
A = 35.12 + 21.97
A = 57.09

so A1 = 57.09

So for CAR1 A1 = 57.09 and B1 = -1.69





Car 2:

330 = (A + 3B * 4.165) * 8.67
330 = 8.67A + 8.67B * 4.165 * 3)
330 = 8.67A + 108.33B
(-108.33 from both sides)
8.67A = 330 - 108.33B
(divide by 8.67)
A = 38.06 - 12.49B

Now Substituting A in the first forumla using A = 38.06 - 12.49B I get the following:

60 = (38.06 - 12.49B + B * 1.450) * 1.051
60 = (38.06 - 12.49B + 1.450B) * 1.051
60 = (38.06 * 1.051 - 12.49 * 1.051 * B + 1.450 * 1.051 * B)
60 = 40.00 - 13.12B + 1.52B
60 = 40.00 - 11.60B
(-40.00 to both sides)
60 - 40.00 = -11.60B
20 = -11.60B
(divide by 11.60)
20/11.60 = -B
1.724 = -B

So B2 = -1.72

now using B, I can solve for A

A = 38.06 - 12.49 * -1.72
A = 38.06 + 21.48
A = 59.54

So A2 = 59.54

So using X1 = (A1 + 3B1 * t) * t^2/2 for Car1 at the 330 foot time mark

X1 = (57.09 + 3 * (-1.69) * 4.165) * 8.67
X1 = (57.09 + (-21.11)) * 8.67
X1 = (57.09 * 8.67 + (-21.11 * 8.67)
X1 = 494.97 + (-183.02)
X1 = 311.95

So using X2 = (A2 + B2 * t) * t^2/2 for Car 2 at the 330 foot mark

X2 = (59.54 + 3 * (-1.72) * 4.335) * 9.396
X2 = (59.54 + (-22.37)) * 9.396
X2 = (59.54 * 9.396 + (-22.37 * 9.396))
X2 = 559.43 + (-210.18)
X2 = 349.25


X2 - X1
349.95 - 311.95 = 38 feet

so car 2 is ahead of car 1 by 38 feet
 
  • #20
You have the right values for A1, B1 for car 1, A2, B2 for car 2.

CraigDNeo said:
Here is my breakdown, please correct me if I am wrong.

So using X1 = (A1 + B1 * t) * t^2/2 for Car1 at the 330 foot time mark

X1 = (57.11 + (-6.08) * 4.165) * 8.67

No, that's wrong, you are scrambling things up and making errors. 4.165 is the time that car 2 passed the 330 mark. -6.08 is, I don't know, maybe -5.08 mistyped. If you want to know where car 1 is at the 330 mark,

X1 = (57.11+(-5.08)*4.335)*(4.335)^2/2 = 329.693

In other words, at the 330 mark, car 1 is at 330 feet. Of course.

You have to look at it this way. At ANY time t, car 1 is at

X1(t)=(A1+B1*t)*t^2/2

At any time t, car 2 is at

X2(t)=(A2+B2*t)*t^2/2

At any time t, then, car 2 is ahead of car 1 by x2(t)-x1(t)

If you want to know how far car 2 is ahead of car 1 when car 1 hits 330, then you know that t=4.335. You know that X1(4.335)=330 (duh!) and so you calculate X2(4.335) and get X2(4.335)-330. If you want to know how far ahead car 2 is ahead of car 1 when car 2 hits the 330 mark, then you know t=4.165. You know that X2(4.165)=330 (duh!) and so you calculate 330-X1(4.165).
 
  • #21
my bad, sorry about that.
 
  • #22
Thanks so much for all your help, this is exactly what I needed, I appreciate the feedback and explicit explanations.
 
  • #23
Rap said:
I told CraigDNeo to keep going, because all this will cause confusion. All we really need to say is that the way I did it the first time, the acceleration is not (A+Bt). Instead we can tell him to substitute a=(A+Bt) into x=at2/2. The acceleration will then be (A+3Bt). Sorry for the confusion.

So does this change the original posted approach you mentioned:

"You have two equations for the first car: Xa=(A+B*ta)*ta^2/2 and Xb=(A+B*tb)*tb^2/2 where Xa=60 feet, ta=1.562 sec, Xb=330 feet, tb=4.335 sec. This is two equations with two unknowns (A and B) and you solve them for A and B."

So should this now be Xa=(A+3B*ta)*ta^2/2, or am I misunderstanding. Sorry for the confusion.
 
  • #24
CraigDNeo said:
So does this change the original posted approach you mentioned:

"You have two equations for the first car: Xa=(A+B*ta)*ta^2/2 and Xb=(A+B*tb)*tb^2/2 where Xa=60 feet, ta=1.562 sec, Xb=330 feet, tb=4.335 sec. This is two equations with two unknowns (A and B) and you solve them for A and B."

Yes, that's right.

CraigDNeo said:
So should this now be Xa=(A+3B*ta)*ta^2/2, or am I misunderstanding. Sorry for the confusion.

No-don't do this. I know its confusing. (I got confused too, until PhanthomJay pointed out the problem.) If you just follow the recipe, it will work. In the equation x=at^2/2, ''a'' is the acceleration ONLY if the acceleration is constant. Once you say a=(A+B*t), then ''a'' is not constant, and it is not right to call it the acceleration any more. Its a good formula, but you just cannot call (A+B*t) the acceleration.

If you think you need to understand why, I can explain it if you want.
 
Last edited:
  • #25
I think I understand now. Does it change drastically if I want to do the same at the 660, 1000 and 1320 foot markers.



Again thank you so much for all the detail you have provided.
 
  • #26
CraigDNeo said:
Does it change drastically if I want to do the same at the 660, 1000 and 1320 foot markers.
Don't forget that an assumption was made that the acceleration is decreasing linearly with time. While that assumption may be pretty good over the first few hundred feet, sooner or later the acceleration will approach zero and the cars will be moving more or less at constant speed (how fast do those cars go)? Then the equations given will no longer apply. You'll have to get out that time tape at 660, 1000, and 1320 feet, and give it a look. Otherwise, you and Rap are doing real good, it is an interesting question that goes beyond the usual constant acceleration problems.
 
  • #27
the speed of the cars vary allot, but the ones I am working with are moving @115 - 150 MPH through the 660 foot mark in under 6 seconds, and you may come across @140- to over 200 MPH in the quarter mile. These are local track guys, the professionals are doing 1000 foot in under 4 seconds at over 300 MPH.
 
  • #28
CraigDNeo said:
the speed of the cars vary allot, but the ones I am working with are moving @115 - 150 MPH through the 660 foot mark in under 6 seconds, and you may come across @140- to over 200 MPH in the quarter mile. These are local track guys, the professionals are doing 1000 foot in under 4 seconds at over 300 MPH.

Does that mean you can measure the times at 330, 660, 1000, and 1320 feet for the same run? Because, if you can, you can do a lot better analysis of things.

Can you measure the speed at these points? Not the average speed, but what the speedometer reads at these points? That would help too.
 
  • #29
CraigDNeo said:
the speed of the cars vary allot, but the ones I am working with are moving @115 - 150 MPH through the 660 foot mark in under 6 seconds, and you may come across @140- to over 200 MPH in the quarter mile. These are local track guys, the professionals are doing 1000 foot in under 4 seconds at over 300 MPH.
Yow, that's fast, and very roughly, 3g's worth of acceleration, or more at the start. Getting close to 'blackout' forces. I am still trying to understand how the cars can accelerate at such a high rate.
 
  • #30
Normally we get mph at 660 if the race is only eighth mile. If we are racing quarter mile we get mph at 1320 feet too. Can you help me narrow down the distance with the mph?
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 10 ·
Replies
10
Views
2K