0

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?

  • 1
    This is an example of piecewise function, nothing wrong with it: https://en.wikipedia.org/wiki/Piecewise –  Sep 22 '18 at 09:29
  • 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

    – Karol Szustakowski Sep 22 '18 at 11:06
  • 2
    What you are asking about is mathematics not physics. – sammy gerbil Sep 22 '18 at 11:14
  • 1
    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. – PM 2Ring Sep 22 '18 at 13:03
  • why would you believe there is a single (not piecewise) function for the distance when your velocity is a piecewise function? – ZeroTheHero Sep 22 '18 at 13:19
  • Lack of solution is a solution as well. Today I learned something about processing such data with mathematics. Thanks everyone for help. – Karol Szustakowski Sep 22 '18 at 21:21

1 Answers1

0

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)]$$

Andrei
  • 37,370