Warning: Error updating FunctionSurface. The following error was reported evaluating the function in FunctionLine update: Unable to convert expression into double array.

I'm trying to plot solution to the 2D unsteady state heat conduction equation, but when I try to plot the it I get an error. Please help, here is the code.
syms n x y Ta Tb T
H = 0.4;
L = 0.3;
Ta = symsum(80*((1-(-1)^n)/(n*pi))*sinh(n*pi*(0.4-y)/0.3)*sin(n*pi*x/0.3)/sinh(n*pi*0.4/0.3),n,1,Inf);
Tb = symsum(20*((1-(-1)^n)/(n*pi))*sinh(n*pi*y/0.3)*sin(n*pi*x/0.3)/sinh(n*pi*0.4/0.3),n,1,Inf);
T = Ta+Tb;
fsurf(Ta, [0 0.3 0 0.4]);
Error: Warning: Error updating FunctionSurface.
The following error was reported evaluating the function in FunctionLine update: Unable to convert expression
into double array.
function looks something like this:
Thanks

 채택된 답변

%f true
Ta = symsum(80*((1-(-1).^n)./(n*pi)).*sinh(n*pi*(0.4-y)./0.3).*sin(n*pi*x/0.3)./sinh(n*pi*0.4/0.3),n,1,Inf);
Tb = symsum(20*((1-(-1).^n)./(n*pi)).*sinh(n*pi*y/0.3).*sin(n*pi*x/0.3)./sinh(n*pi*0.4/0.3),n,1,Inf);
Try using element wise operator

댓글 수: 3

syms n x y Ta Tb T
H = 0.4;
L = 0.3;
Ta(x,y) = symsum(80*((1-(-1)^n)./(n*pi)).*sinh(n*pi*(0.4-y)/0.3).*sin(n*pi*x/0.3)./sinh(n*pi*0.4/0.3),n,1,Inf);
Tb(x,y) = symsum(20*((1-(-1)^n)./(n*pi)).*sinh(n*pi*y/0.3).*sin(n*pi*x/0.3)./sinh(n*pi*0.4/0.3),n,1,Inf);
T = Ta+Tb;
fsurf(T, [0 10 0 10]);
Try above with right values for x, y and H, L
It works only for finite number of terms in summation.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2021년 4월 11일

댓글:

2021년 4월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by