$$v''(x) = -m^2 v(x), \quad 0 < x < \pi, \quad v(0) = v(\pi) = 0$$
We may approximate $v$ using its interpolating polynomial at the
$x_j$ and use the
differentiation matrix.
The system
$$v''(x_j) + m^2 v_j = 0, \quad j = 1, \ldots, n-1$$
becomes
$$D^2 \mathbf{v} + m^2 \mathbf{v} = 0,$$
with $D_{ij} = L_i'(x_j)$ and $L_i$ denoting the $i$th Lagrange
basis polynomial corresponding to the nodes $x_0, x_1, \ldots, x_n$.