In a finite difference model for a vibrating string, how does the number of mesh points predict how many modes can be produced? If you are modeling a vibrating string (like a guitar or piano) using a finite difference approach as described here:
http://hplgit.github.io/num-methods-for-PDEs/doc/pub/wave/html/._wave001.html#wave:string
How does the number of mesh points in your calculation affect the number of modes that can be reproduced?
Is it a simple matter such that for the first mode, you would need 3 points (the two end points and one in the middle to oscillate)? Then for the first and second mode, you would need 5 points (adding two more points to oscillate at 1/4 way from each end)?
And so on?
If so, what's the simple equation for the number of modes that can be reproduced based on the N number of nodes in a rudimentary finite difference approximation?
Thanks.
 A: My professor covered a similar topic in one of my courses on wave dynamics. To answer your question bluntly, to model $n$ normal modes you will need $n+2$ mesh points. Since the $n$th mode has $n$ peaks, and the two endpoints are fixed, you will definitely need (at least) $n+2$ mesh points. Perhaps this is all you wanted, but I've added a neat discrete model that you can use below for your experimentation purposes.
The following is a discretized model of the continuous wave equation on a finite string. Instead of a vibrating string, we can model the situation as $N$ small masses, each of mass $m$, all connected by springs with spring constant $k$ in a line, as shown in the diagram below.

Apologies for the poor diagram. It was done rather quickly in MSPaint. Let the displacement from equilibrium of the $n$th mass be denoted as $x_n$. It can easily be seen that for the $N-2$ central masses, their equations of motion are
$$m\ddot{x}_n=-k(x_n-x_{n-1})+k(x_{n+1}-x_n)=k(x_{n-1}-2x_n+x_{n+1})$$
And for the two end masses,
$$mx_1=-kx_1+k(x_2-x_1)=k(-2x_1+x_2)$$
$$mx_N=-k(x_N-x_{N-1})-kx_N=k(x_{N-1}-2x_N)$$
If we let
$$\underline{x}=\begin{bmatrix}
x_{1}\\
\vdots \\
x_{N}
\end{bmatrix}$$
Then we can represent this system as
$$\ddot{\underline{x}}=-\frac{k}{m}\mathbf{M}\underline{x}$$
Where
$$\mathbf{M}=\begin{bmatrix}
2 & -1 & 0 & \dotsc  & 0\\
-1 & 2 & -1 & \dotsc  & 0\\
\vdots  & \ddots  & \ddots  & \ddots  & \vdots \\
0 & \dotsc  & -1 & 2 & -1\\
0 & \dotsc  & 0 & -1 & 2
\end{bmatrix}$$
And is a tridiagonal matrix, which are reasonably well studied. It turns out that the $j$th normal mode of $x_n$, which I'll denote $x_{n,j}$ , is precisely
$$x_{n,j}(t)=\sin\left(n\frac{j\pi}{N+1}\right)\cos(\omega_j t+\varphi_j)$$
Here $\varphi_j$ is some arbitrary phase angle that can be computed via initial/boundary conditions, and $\omega_j$ is the $j$th normal frequency, given by
$$\omega_j=\frac{2k}{m}\left(1-\cos\left(\frac{j\pi}{N+1}\right)\right)=\frac{4k}{m}\sin^2\left(\frac{j\pi}{2(N+1)}\right)$$
I can provide some references on the above if you wish. Since each $x_n$ can be any linear combination of its normal modes, we can see that
$$\underline{x}(t)=\sum_{i=1}^{N}\left(\sum_{j=1}^{\infty}a_j x_{i,j}(t)\right)\hat{\underline{e_i}}$$
The $a_j$s can be computed via Fourier series.
