The values of c, L and deltat are choosen by myself. The equation is attached in the picture and this my code. I can't seem to get the curve correctly for the temperature of the rod. Is there anything wrong with my code?
syms n;
c = 4;
L = 6;
deltat = 0.2;
x = [0:6];
for k = 1:5
t = (deltat*k);
u = (200/pi)*symsum((((-1)^(n+1))/n)*(sin((n*x*pi)/L))*(exp(-(((c*n*pi)/L)^2)*t)),n,1,1000);
plot(x,u)
hold on
end
Best Answer