= Solution
Assume the struck interval lies within the string, so $0\leq\ell-a/2<\ell+a/2\leq L$. The initially stationary straight string has $A_n=0$. Write its initial velocity as a <Fourier sine series> $g(x)=\sum_ng_n\sin(k_nx)$. Then
$$
g_n=\frac{2v}{L}\int_{\ell-a/2}^{\ell+a/2}\sin\frac{n\pi x}{L}\,dx=\frac{4v}{n\pi}\sin\frac{n\pi\ell}{L}\sin\frac{n\pi a}{2L}.
$$
Thus $y(x,t)=\sum_n(g_n/\omega_n)\sin(\omega_nt)\sin(k_nx)$. Immediately after the strike all the <energy> is <kinetic energy>:
$$
E=\frac\rho2\int_0^L g(x)^2\,dx=\frac{\rho av^2}{2}.
$$
The <orthogonality> <integral> $\int_0^L\sin(k_nx)\sin(k_mx)\,dx=(L/2)\delta_{nm}$ assigns <energy> $E_n=\rho Lg_n^2/4$ to mode $n$. Since the ideal modes evolve independently, their total kinetic-plus-elastic energies remain constant. Therefore the <modal energy of a localized velocity impulse on a string> gives
$$
\boxed{\frac{E_n}{E}=\frac{8L}{a\pi^2n^2}\sin^2\frac{n\pi\ell}{L}\sin^2\frac{n\pi a}{2L}.}
$$
The centre factor selects modes having significant motion at the impact location; the width factor accounts for cancellation across the finite hammer footprint. <Parseval's identity> ensures $\sum_{n\geq1}E_n/E=1$. The velocity discontinuities are understood in the mean-square sense and do not alter the <energy> <integrals>.
Back to article page