6. 41 A train departs from station A, accelerating at 0.5 kilometers/min$^2$ forward, after 2 minutes, it continues to move at a constant speed for another 7 minutes, then decelerates uniformly at 0.5 kilometers/min$^2$ to enter station B, and stops at station B for 2 minutes. Try to draw the speed-time relationship graph for the entire period from departure at station A to arrival at station B, then find the function of distance with respect to time during this period, and determine the permissible range of time for these functions.
When $0 \leqslant t \leqslant 2$, $S=\frac{1}{2} a t^{2}=\frac{t^{2}}{4}$; when $2<t \leqslant 9$, $S=\frac{2^{2}}{4}+(t-2)=1+t-2=t-1$; when $9<t \leqslant 11$, $S=(9-1)+(t-9)-\frac{1}{2} a(t-9)^{2}$ $=t-1-\frac{1}{4}(t-9)^{2}$ $=\frac{1}{4}\left(-t^{2}+22 t-85\right) ;$ when $11<t \leqslant 13$, $S=\frac{1}{4}\left(-11^{2}+22 \times 11-85\right)=9$.