18. Given the quadratic function $f(x)=4 x^{2}-4 a x+\left(a^{2}-2 a+2\right)$ has a minimum value of 2 on $0 \leqslant x \leqslant 1$, find the value of $a$.


18. $f(x)=4\left(x-\frac{a}{2}\right)^{2}-2 a+2$.

When $0 \leqslant \frac{a}{2} \leqslant 1$ i.e., $0 \leqslant a \leqslant 2$, $f_{\text{min}}(x)=-2 a+2=2$. This gives $a=0$.
When $\frac{a}{2}>1$, i.e., $a>2$, $f_{\text{min}}(x)=f(1)=4-4 a+a^{2}-2 a+2=2$. This yields $a=3-\sqrt{5}$ (discard) or $a=3+\sqrt{5}$.