prompt1 = 'Please input a value between 0 and 0.5 for the conductivity parameter (product of the density, thermal conductivity, and specific heat of the rod, kg^(2)s^(-3)K : ';k = input(prompt1);prompt2 = 'Please input a time range between 0 and 10 for bar to cool down (s): ';t_range = input (prompt2);prompt3 = 'Please input a whole positive value for the number of terms for the series to be calculated over (large values will take longer to run!): ';m = input (prompt3);syms n x t;v(x,t) = (400/(n*pi))*(sin((n*pi*x)/1))*(exp(-k(((n*pi)/1)^2)*t));u = symsum(v,n,1,m);fsurf(u, [0 1 0 t_range], 'ShowContours', 'on');title('Evolution of temperature of bar with time');xlabel('Length along bar (m)');ylabel('Time (s)');zlabel('Temperature (degrees Celcius)');box on;
The error is produced as a result of the use of symsum on line 10, I also get an error with line 9 and the definition of the function to be used in the sum
Best Answer