Any mathematical mistake in my script ?
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
