Piecewise functions: Got an example of a real world piecewise function?

Looking for something beyond a contrived textbook problem concerning jelly beans or equations that do not represent anything concrete. Not just a piecewise function for its own sake. Anyone?


I always thought the horizontal distance from a wall to an object is a good example of a piecewise continuous function (of the height):

enter image description here

Here the various red lines show the various distances and the green line marks the point of discontinuity.


Computing income taxes in a bracketed system.


Cab fares are a piecewise constant function of distance travelled.