Yes - sorry Zokomoko, this is probably beginning to get a bit deeper than you wanted.
**EDIT** Don't bother reading this - it's rubbish!!
Codemachine, yes, where t<t1, ie. where the object doesn't reach max velocity v before the time t elapses is something I hadn't fully considered. My scenario 1 was assuming t=t1, and the object just reaches v at time t. In a semiconscious way, I'd kind of thought that if t<t1, and v isn't reached, then that would make the time t2 negative, which would make the rectangle negative, which would mean the equation would automatically subtract this distance from the total distance that would be covered - on applying a little more brain power though I don't think it would actually work in that particular case. It would be like taking away a rectangle from a trapezium whereas you'd need to take away a trapezium. Arghh my brain hurts.....
Bear with me on this one ....
So, if we say the object only reached v' after the interval t, then we could make our v-t graph out of two trapeziums, the first with area as given before, s1=0.5(u+v)t1, which will give the distance the object
would cover if it reached v in a time t1, and the second trapezium s2=0.5(v'+v)t2, the distance it
would have travelled after t, from v' to top speed v. This will then be taken away from s1 if a is so small that t1>t, making t2 negative.
So the equation for s becomes s=0.5(u+v)t1 + 0.5(v'+v)t2.
If scenareo 2 is the case (ie it reaches v in t1<t) then v' would be equal to v, and the equation reduces back to what we had before. Making sense so far? Okay, so, now we can simplify the equation. Well, v'=u+at (remember t is the total time, at which point the object has reached v'). And t1=(v-u)/a and t2=t-t1 as before, which barring major cockups, gives an equation for s as follows,
distance=[{(v^2)-(u^2)}/2*a] + [0.5{u+at+v}{t-(v-u)/a}]
upon expanding and simplifying, I make that:
distance=(1/(2*a))*(((a^2)*(t^2))+(2*(v^2))+(2*u*a*t)-(2*u*v))
I'd be interested to know if a) Codemachine can confirm/correct that, and b) if it seems to work in Zokomoko's code.