c=1;
L=10;
λ[n_]=n Pi c/L

CC[n_]=(-1)^(Floor[n/2])(1-(-1)^n)^2 L/(n^2 Pi^2);
DD[n_]=0;
NN=500;

{CC[1],CC[2],CC[3],CC[4],CC[5],CC[6],CC[7]}

u[x_,t_]=Sum[Sin[n Pi x/L] (CC[n] Cos[λ[n] t]+DD[n] Sin[λ[n] t]),{n,1,NN}];

Manipulate[
Plot[u[x,t],{x,0,L},PlotRange->L/2+.5],{t,0,2 L/c}]

Manipulate[
Plot[u[x,t],{x,0,L/10},PlotRange->1],{t,0,8}]

(* Beispiel mit v0≠0 *)

CC[n_]=(-1)^(Floor[n/2])(1-(-1)^n)^2 L/(n^2 Pi^2);
NN=100;
uD[x_,t_]=Sin[Pi x/L] (CC[1] Cos[λ[1] t]+ 1/λ[1]Sin[λ[1] t])+Sum[Sin[n Pi x/L] (CC[n] Cos[λ[n] t]),{n,2,NN}];
Manipulate[
Plot[uD[x,t],{x,0,L},PlotRange->L/2+.5],{t,0,2 L/c}]

(* Beispiel mit u0 Saegezahn *)

CC[n_]=1/n;
DD[n_]=0;
NN=100;
u2[x_,t_]=Sum[Sin[n Pi x/L] (CC[n] Cos[λ[n] t]+DD[n] Sin[λ[n] t]),{n,1,NN}];
Manipulate[
Plot[u2[x,t],{x,0,L},PlotRange->2],{t,0,2 L/c}]

(* Waermeverteilung in einem Stab *)

BB[n_]=(-1)^(Floor[n/2])(1-(-1)^n)^2 L/(n^2 Pi^2);
NN=100;

u3[x_,t_]=Sum[BB[n] Exp[-λ[n]^2 t]Sin[n Pi x/L] ,{n,1,NN}];

Manipulate[
Plot[u3[x,t],{x,0,L},PlotRange->{0,5}],{t,0,40}]

BB[n_]=1/n;
NN=500;
u4[x_,t_]=Sum[BB[n] Exp[-λ[n]^2 t]Sin[n Pi x/L] ,{n,1,NN}];
Manipulate[
Plot[u4[x,t],{x,0,L},PlotRange->{0,2}],{t,0,40}]