heat equation for infinite bar(rod)

2 次查看(过去 30 天)
Nicoleta
Nicoleta 2015-1-8
评论: Torsten 2015-1-9
%Ecuatia caldurii pt bara infinita function ec_cald_bara_infin a=0;b=50;L=10;T=15;Ns=20;M=50;N=50;t=linspace(0,T,50); x=linspace(0,10,50); c=linspace(a,10,b); s=linspace(0,10,50); %calcul Y for n=1:N for m=1:M
Y=f(s).*exp(-( x(n)-s).^2/(4*a*a*t(m))); y=f(s); l=length(y) z=exp(-( x(n)-s).^2/(4*a*a*t(m))); p=length(z) D=Y.*z; r=length(c)
q=trapz(D,c);
%calcul u(t,n)
A=1/(2*a*sqrt(pi*t(m)));
w=length(A)
u(m,n)=A.*q;
end
end
figure(1) surf(t,x,u'); figure(2) for m=1:M plot(x,u(m,:))
axis([-L,L,min(min(u)), max(max(u))]);
film(m)=getframe; end movie(film,3,40); function f=f(s) f=s.*(L-s); end end
I tried figuring out this problem and all I managed to do is this code. Is it correct?
  1 个评论
Torsten
Torsten 2015-1-9
I see the code, but from the title of your request, I can't deduce the problem.
Best wishes
Torsten.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Polynomials 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by