Any mathematical mistake in my script ?
이전 댓글 표시
Hi, I am trying to plot the self-derived analytical solution using matlab. However, I get different answer from what I obtained using excel sheet.
I suspect the mistake is in somewhere within this script, where I could have miss out.
Could anyone spare a help here ?
Self-derived Analytical Solution :


syms n y real
assume([n y] >= 0);
Y = 0:0.02:1;
b =1; t=1; br=1; Pr=1;
%t = t*
K1=(1-exp(-((2.*n)+1).^2.*pi.^2.*t./(4.*Pr)))./(((2.*n)+1).^2.*pi.^2);
K2=((((2.*n)+1).^2.*pi.^2.*exp(-((2.*n)+1).^2.*pi.^2.*t./(4.*Pr)))-(((2.*n)+1).^2.*pi.^2.*cos(2.*b.*t))-(8.*b.*Pr.*sin(2.*b.*t)))./((64.*b.^2.*Pr.^2)+(((2.*n)+1).^4.*pi.^4));
T = subs( sum( subs( 8.*br./(((2.*n)+1).*pi).*(K1+K2).*sin((((2.*n)+1)./2).*pi.*y), n, 1:100 )), y, Y );
Tn = double(T);
disp(Tn);
plot(Tn,Y);
Thanks,
Andy
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
