If you change your definition for U to take patterns:
Clear[U];
U[x_, t_] =
Sum[(An*Cos[omegan*t] + Bn*Sin[omegan*t])*Sin[n*Pi*x/L], {n, 1,
10 L}]
Then
Table[Plot[Evaluate[U[x, t]], {x, -10, 10},
PlotRange -> {{-10, 10}, {0, 1}}], {t, 0, 1, .1}]
works.
I truncated the fourier series at many fewer terms than your example. You may get improvement if you use the builtin fourier series functions.
You may want to use a Manipulate instead of Table. Also, if your sum is numerical, you should get better performance with NSum rather than Sum.