0
$\begingroup$

Let's Imagine such a situation.
A man is walking for the first hour with a speed of $4km/h$.
The next hour he is jogging, with the speed of $9km/h$
Finally, after two hours, he starts to run, with the speed of $12km/h$

As one might expect, I want to calculate the distance which has been travelled after given time in hours $t$.

My approach to solve such a problem was to first determine, how long has the runner been going.
If it was less than one hour, his distance would be $t*V_{0}$.
If it was more than one hour, but less than two, it would be $V_{o}+(t-1)V_{1}$
Finally, if he has been going for more than two hours: $V_{0}+V_{1}+(t-2)V_{2}$

This way of doing calculations is valid and works, but I am looking for a better way which I guess must exist.
Is there any way to describe distance with a function of variable $(t)$ which is described by a single formula(Instead of three like right now)?

If it is not possible, can this be proven mathematically?

$\endgroup$

migrated from physics.stackexchange.com Sep 23 '18 at 20:08

This question came from our site for active researchers, academics and students of physics.

  • 1
    $\begingroup$ This is an example of piecewise function, nothing wrong with it: en.wikipedia.org/wiki/Piecewise $\endgroup$ – Stéphane Rollandin Sep 22 '18 at 9:29
  • $\begingroup$ Sure It is usable and calculations are valid, but It is hard to compare such functions. Say I have two runners, both have their distances defined by a picewise function. One of the runners starts later than the first one, but generally his average speed is higher. To calculate time after they will meet I have to consider many cases, that's why I'm looking for a faster way $\endgroup$ – Karol Szustakowski Sep 22 '18 at 11:06
  • 2
    $\begingroup$ What you are asking about is mathematics not physics. $\endgroup$ – sammy gerbil Sep 22 '18 at 11:14
  • 1
    $\begingroup$ Your speed vs time graph has 2 points where the angle changes abruptly (3 points if we include the starting point). No finite polynomial function can do that. And of course that's not physically realistic either, since it requires infinite acceleration at those points. You can paste your 3 line segments together using special functions like min & max, where min(a, b) is the minimum of a & b, but that doesn't really help much. $\endgroup$ – PM 2Ring Sep 22 '18 at 13:03
  • $\begingroup$ why would you believe there is a single (not piecewise) function for the distance when your velocity is a piecewise function? $\endgroup$ – ZeroTheHero Sep 22 '18 at 13:19
0
$\begingroup$

You can use the Heaviside function. The answer would look like $$d(t)=t[V_0H(t)+(V_1-V_0)H(t-1)+(V_2-V_1-V_0)H(t-2)]$$

$\endgroup$
  • $\begingroup$ A very wise and interesting solution! Thanks! $\endgroup$ – Karol Szustakowski Sep 27 '18 at 18:48
  • $\begingroup$ No problem. The usefulness of this solution comes from the fact that in real life (physics) you might approximate the step function with something like $erf$, or $\tanh$ $\endgroup$ – Andrei Sep 27 '18 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.