Taking an acelleration and deceleration into a piecewise function I am trying to generate a function for describing an object's motion over time, where if you were to graph the object's velocity, it would look exactly like a trapezoid. That is, there is a simple acceleration from 0 at the start and a simple deceleration to 0 at the end, with a brief period in between where the velocity is constant.    I know that the total distance the object traveled in this interval, which I call 1 time unit, is exactly 1 distance unit. and I also know what percentage of the total time will be spent in each of the acceleration and deceleration phases.   Is there enough information here to produce a (presumably piecewise) function that describes the position of the object at time t, where t is between 0 and 1, inclusive?
Also, I'm not entire sure how to classify this question.  I've tagged it initially as precalculus, because it seems to me like it should be at about that level, but if anyone who can modify tags knows a more appropriate classification, please feel free to change it or add other more suitable ones.
 A: Let's say the object starts from rest (at position $s = 0$) and undergoes uniform acceleration $a$ from $t = 0$ to $t = t_1$. Then its position is
$$s(t) = \dfrac{1}{2}at^2,\ 0 \leq t \leq t_1$$
It's position and velocity at the end of this time are, respectively, $s(t_1) = \frac{1}{2}at_1^2$ and $v(t_1) = at_1$. From $t = t_1$ to $t = t_2$, it moves with uniform velocity $v(t_1)$, so its position is $s(t_1) + (t-t_1)\,v(t_1)$:
$$s(t) = \dfrac{1}{2}at_1^2 + at_1(t-t_1) = at_1\left(\dfrac{t_1}{2} + (t - t_1)\right) = at_1\left(t - \dfrac{t_1}{2}\right),\ t_1 \leq t \leq t_2 $$
Now, at the end of time $t_2$, its position and velocity are, respectively, $s(t_2) = at_1\left(t_2 - \frac{t_1}{2}\right)$ and $v(t_2) = at_1$ (the same velocity as before, as there was an acceleration). From $t = t_2$ to $t = t_3$, it undergoes uniform deceleration $-d$, so its position is $s(t) = s(t_2) - \frac{1}{2}d(t - t_2)^2$:
$$s(t) = at_1\left(t_2 - \dfrac{t_1}{2}\right) - \dfrac{1}{2}d(t-t_2)^2,\ t_2 \leq t \leq t_3$$
Its position at the end of this time is $s(t_3) = at_1\left(t_2 - \frac{t_1}{2}\right) - \frac{1}{2}d(t_3-t_2)^2 = 1$ (as the total displacement is $1$ unit), and the velocity at the end of this time is $v(t_3) = v(t_2) - d(t_3 - t_2) = at_1 - d(t_3 - t_2) = 0$, as it comes back to rest. Plug in the values of $t_1$, $t_2$, and $t_3$ and solve.
