13. Given the function $f(x)=a x-\frac{3}{2} x^{2}$ has a maximum value no greater than $\frac{1}{6}$, and when $x \in\left[\frac{1}{4}, \frac{1}{2}\right]$, $f(x) \geqslant \frac{1}{8}$, find the value of $a$.