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.
  • #31
And yes we get times at those points too.
 
Physics news on Phys.org
  • #32
CraigDNeo said:
And yes we get times at those points too.

So you can get x=[60,330, 660, 1000,1320] - a list of distances and t=[t[1],t[2],t[3],t[4],t[5]] a list of times when the car passed those points.

In the original case, we only had two distances, [60,330] and two times [t[1],t[2]] and we basically said that x(t) is of the form x(t)= k[2]t^2+k[3]t^3 where k[2] and k[3] are constants that we want to find. I think we said k[2]=A/2 and k[3]=B/2. Now we have 5 distances, and we can say x(t)=k[2]t^2+k[3]t^3]+k[4]t^4+k[5]t^5+k[6]t^6 and we have 5 constants that we want to find. We do the same procedure to find them, only its more complicated. Sometimes its better to reduce the number of constants to 4 or 3, it depends on your data. Do you have some actual data for a car at these 5 points?
 
  • #33
Here is an example for an 1/8th mile (660). Most of the races (90%) are eighth mile. And this is three points of data, and would somewhat less confusing to start with for me at least. Thanks again for your interest and feedback.

Car 1
60 feet 1.3389s
330 feet3.909s
660 feet 6.1023s
660 MPH 112.36

Car2
60 feet 1.4216s
330 feet 3.9436
660 feet 6.0951s
660 MPH 114.36

we do not get MPH for 60 or 330, only for 660, sometimes 1000 and if they are doing quarter mile, then we get the MPH at 1320.
 
  • #34
so would we do something like this then

X = At^3 + Bt2^2 + C*t + D for 0, 60, 330 and 660. Then solve for A, B, C and D. My other question is that when solving for these unknowns, which data point would you start with?
 
  • #35
CraigDNeo said:
so would we do something like this then

X = At^3 + Bt2^2 + C*t + D for 0, 60, 330 and 660. Then solve for A, B, C and D. My other question is that when solving for these unknowns, which data point would you start with?

But we know that when t=0, X=0 so D=0. You can calculate the velocity by taking the time derivative of X, so V=3At^2+Bt/2+C. But we know that the velocity is zero at t=0, so that means C=0. (See how knowing the velocity helps?)

The general way we are doing it is this: (lets use A0, A1, A2 ... as our constants)

X(t) = A0 + A1 t + A2 t^2 + A3 t^3 +A4 t^4 + ... etc

where we carry out the sum as far as we want. Now we know that A0=0 and A1=0 because the position and velocity at t=0 are zero. That takes care of X=0. Now we have points at X=60, 330, and 660. That will give us three equations, and that means we can't solve things unless we have three or less unknowns. So let's use three unknowns.

X(t) = A2 t^2 + A3 t^3 + A4 t^4

Thats the equation we want to use. Make three equations using X=60, 330, and 660 and the times that you have for each of those three positions. Then you will have 3 equations and you can solve them for A2, A3, and A4.

It doesn't matter which one you solve for first. You can solve these by hand with a calculator, but its even better if you have a computer program that solves linear equations. There is a pretty good one at http://wims.unice.fr/wims/en_tool~linear~linsolver.en.html

Just type in something like 4=2*A2+3*A3 on the first line, 6=3*A2+7*A3 on the second line, hit the solve button, and it will give you the values for A2 and A3. Type in your 3 equations and it will solve for A2, A3, and A4.

If you want to use velocity, at 660, then you have another equation, and you can put in another constant. You can have

X(t)=A2 t^2+A3 t^3+A4 t^4+A5 t^5

the velocity is

V(t) = 2 A2 t +3 A3 t^2 + 4 A4 t^3 + 5 A5 t^4

Just put in your velocity at 660, and the time at 660, and use this as your fourth equation, then put the four equations into the solver and it will solve for A2, A3, A4 and A5.
 
Last edited:
  • #36
I put these into the linear solver for a
60 foot in 1.083s,
330 foot in 3.112s
660 foot in 4.83s

60 = A*1.17 + B*1.21 + C*1.31
330 = A*9.67 + B*30.08 + C*93.55
660 = A*23.33 + B*112.68 + C*544.23

and I get this in return
{ a = 63.82661360552823, b = -13.508610964551533, c = 1.273497212701 }

Now taking these values an finding the distance this car is as opposed to the other car,

for example, the other car's (CAR2) time at the 330 was 2.7038

So, my confusion currently, is calculating the other cars distance, do I still do the following:

X(t) = (A + B + C * 2.7038) * (2.7038)^2/2?

Then I would get 330 -X(t) = distances CAR1 is ahead or behind CAR2.
 
  • #37
CraigDNeo said:
I put these into the linear solver for a
60 foot in 1.083s,
330 foot in 3.112s
660 foot in 4.83s

60 = A*1.17 + B*1.21 + C*1.31
330 = A*9.67 + B*30.08 + C*93.55
660 = A*23.33 + B*112.68 + C*544.23

and I get this in return
{ a = 63.82661360552823, b = -13.508610964551533, c = 1.273497212701 }

Now taking these values an finding the distance this car is as opposed to the other car,

for example, the other car's (CAR2) time at the 330 was 2.7038

So, my confusion currently, is calculating the other cars distance, do I still do the following:

X(t) = (A + B + C * 2.7038) * (2.7038)^2/2?

Then I would get 330 -X(t) = distances CAR1 is ahead or behind CAR2.

X(t)=At^2+Bt^3+Ct^4 is the form of the equation for the position of any car. For car 1 we say X1(t)=A1 t^2+B1 t^3 + C1 t^4 where X1(t) is the position of car 1 at any time t, A1, B1, C1 are the ABC's we calculate for car 1 by substituting car 1's distances (60,330,66) and car 1's times into that equation. You have just done this for car 1.

For car 2, we have X2(t)=A2 t^2+B2 t^3 + C2 t^4 where X2(t) is the position of car 2 at any time t, A2, B2, C2 are the ABC's we calculate for car 2 by substituting car 2's distances (60,330,66) and car 2's times into that equation. You have to do the same thing for car 2.

Now we calculate how far car 2 is ahead of car 1 at time t by calculating X2(t)-X1(t). I see you said "Then I would get 330 -X(t) = distances CAR1 is ahead or behind CAR2." You are being not very clear. X2(t)-X1(t) is how far car 2 is ahead of car 1 at time t. 330-X1(t) is the distance car 2 is ahead of car 1, but at what time? - at the time that car 2 crossed the 330 mark, and you have to be sure that this is the time that you substitute into X1(t).
 
Last edited:
  • #38
Ok, now I think I understand. If below is CAR1
60 foot in 1.083s,
330 foot in 3.112s
660 foot in 4.83s

60 = A*1.17 + B*1.21 + C*1.31
330 = A*9.67 + B*30.08 + C*93.55
660 = A*23.33 + B*112.68 + C*544.23

and I get this in return
{ a = 63.82661360552823, b = -13.508610964551533, c = 1.273497212701 }

and we know that CAR2 was at the 330 in 2.7038 so this would be X2(2.038)

then X(t) = (At^2 + Bt^3 + Ct^4) so this would then be

X1(t) = (63.83 * (2.7038)^2 + (-13.51) * (2.7038)^3 + 1.27 * (2.7038)^4, so this would tell me the distance CAR1 traveled in CAR2's 330 foot time. so then I would be able to do
X2(t) - X1(t), and X2(2.7038) we know for CAR2 is 330 feet, the X1(2.7038) is what we calculated, which comes to 304.06, so CAR2 (330) - CAR1 (304) = @25.94 feet.I am still working on putting the velocity at the 660 in for the fourth equation.

Thanks again so much for your time and feedback, I have truly learned so much from this thread, and it is greatly appreciated.
 
  • #39
CraigDNeo said:
Thanks again so much for your time and feedback, I have truly learned so much from this thread, and it is greatly appreciated.

Yes - you are doing it right.

You are using 3 constants for 3 measurements, 4 for 4 measurements, etc. The next thing you might want to learn is that all of your measurements have errors in them. If you had 100 measurements, you probably would not want to use 100 constants, because the X(t) would be going through every point, trying to get not only the X(t) but all the little errors too. You don't need an X(T) that is that exact. So you might have 100 measurements, but you only need maybe 6 constants to get the X(t) so that it doesn't bother going through all the errors too. Just remember that there is a way to do that, called "least squares curve fitting". You probably don't need to learn this more complicated method if you have just a few measurements, but if you ever do have a lot of measurements, it might be the next thing you want to learn.
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K
Replies
6
Views
2K
Replies
1
Views
1K
  • · 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