I've made multiple graphs of my function f[x,t], one for each different value of my variable t. Currently, my graphs are unlabelled. I want to use PlotLegends to label each graph with its corresponding t value. When I try the following code, I just get "t ={t}", just the letter {t}, as the label on all the graphs, and not the t value itself. How can I get PlotLegends to display the value of t corresponding to each graph, and not just the letter t every time? Below is the code Im using,
ClearSystemCache[]
h=1; l=10; v=1;
y=Sum[(8h/(n^2Pi^2))(2Sin[n Pi/4]-Sin[n Pi/2])Sin[n Pi x/l]Cos[n Pi v*t/l],{n,1,40,1}];
y2=Table[Plot[y,{x,0,10}, AxesLabel->{"x","y[x,t]"}, PlotLegends->"t={t}"],{t,0,2l/v,.02l/v}];
ListAnimate[y2]