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$.
13. Since the maximum value of $f(x)=a x-\frac{3}{2} x^{2}$ is no greater than $\frac{1}{6}$, we have $f\left(\frac{a}{3}\right)=\frac{a^{2}}{6} \leqslant \frac{1}{6}$, so $a^{2} \leqslant 1$. Also, when $x \in\left[\frac{1}{4}, \frac{1}{2}\right]$, $f(x) \geqslant \frac{1}{8}$, so $\left\{\begin{array}{l}f\left(\frac{1}{2}\right) \geqslant \frac{1}{8} \\ f\left(\frac{1}{4}\right) \geqslant \frac{1}{8}\end{array}\right.$, which means $\left\{\begin{array}{l}\frac{a}{2}-\frac{3}{8} \geqslant \frac{1}{8} \\ \frac{a}{4}-\frac{3}{32} \geqslant \frac{1}{8}\end{array}\right.$, so $a \geqslant 1$. Therefore, we know that $a=1$