Find speedometer error given total time, and distance/recorded speed per trip

algebra-precalculus

I have been given a problem where someone is driving a car whose speedometer is off by some constant c (e.g. if the speedometer shows 30, but the true speed is 45, then c=15)

They begin to log their n drives, each time taking note of the distance traveled and speedometer reading during that drive. (assume the speed was constant throughout the whole ride)

I am given the total time t driven over all the drives, but not the time for each individual drive.

I am supposed to find the error, c, given n, t, and d1,d2,…,dn and s1,s2,…sn where d(i) is the distance traveled during a drive and s(i) is the speedometer reading on that drive

So far I've found that t = [d1/(r1+c)]+[d2/(r2+c)]+…+[dn/(rn+c)]

I'm wondering how to algebraically solve this equation for c

Any help is appreciated (or perhaps there is a better way to solve this problem, any help in that direction would be appreciated too)

Best Answer

Starting from @Wouter's answer, you are looking for the zero of function $$f(c)=\sum_{i=1}^n \frac{d_i}{r_i+c}-t$$ I would not recommend to transform it to a polynomial. Just keep it like that and use Newton method with analytical derivatives with $c_0=0$. It should converge quite fast (assuming $c >0$).

Since the higher order derivatives are very simple, you could even use Halley or Householder methods for faster convergence.

Notice that starting with $c_0=0$, since $f''(0)>0$ and $f(0)<0$, by Darboux theorem, there will be one overshoot of the solution.