Ecuación del calor (Raúl, Sofía, Jaime)
De MateWiki
Revisión del 19:49 3 mar 2024 de Jaime.saenzdemiera (Discusión | contribuciones)
| Trabajo realizado por estudiantes | |
|---|---|
| Título | Ecuación del calor |
| Asignatura | EDP |
| Curso | 2023-24 |
| Autores | Raúl Ortega
Sofía Gómez Jaime Sáenz de Miera |
| Este artículo ha sido escrito por estudiantes como parte de su evaluación en la asignatura | |
Sistema
[math] \begin{cases} u_t-u_{xx}=0 & x\in(0,1),t\gt0\\ u(0,t)=0&t\gt0\\ u(1,t)=1&t\gt0\\ u(x,0)=0&x\in(0,1) \end{cases} [/math]
Estacionaria
[math] \begin{cases} v_{xx}=0 & x\in(0,1)\\ v(0)=0\\ v(1)=1\\ \end{cases} [/math]
Solución estacionaria
[math] v(x)=x [/math]
v=@(x) x;
xx=linspace(0,1,100);
plot(xx,v(xx), "Color",'b',LineWidth=1.5)
xlabel('x')
ylabel('v(x)')
Homogeneizado: [math] w(x,t)=u(x,t)-v(x) [/math]
[math] \begin{cases} w_t-w_{xx}=0 & x\in(0,1),t\gt0\\ w(0,t)=0&t\gt0\\ w(1,t)=0&t\gt0\\ w(x,0)=-x&x\in(0,1) \end{cases} [/math]
Solución por separación de variables: [math] w(x,t)=\sum_{k=1}^\infty\frac{2(-1)^k}{k\pi}\sin(k\pi x)e^{-k^2\pi^2 t} [/math]
%Definimos la función
wi=@(x,t,k) ((2*(-1)^(k))/(k*pi)).*sin(k.*pi.*x).*exp(-k^2.*pi^2.*t);
%Sumamos los 10 primeros términos
w=@(x,t) 0;
for n=1:10
w=@(x,t) w(x,t) + wi(x,t,n);
end
% Gráfica en 3D
close all
colormap jet
fsurf(w,[0 1 0 1], 'EdgeColor','interp')
xlabel('x')
ylabel('t')
zlabel('w(x,t)')
Flujo
%Definimos la función
dwi=@(x,t,k) (2*(-1)^(k+1)).*cos(k.*pi.*x).*exp(-k^2.*pi^2.*t)-1;
%Sumamos los 10 primeros términos
dw0=@(t) 0;
dw1=@(t) 0;
for n=1:10
dw0=@(t) dw0(t) + dwi(0,t,n);
dw1=@(t) dw1(t) + dwi(1,t,n);
end
% Gráfica
close all
t=linspace(0,1,100);
subplot(2,1,1)
plot(t,dw0(t))
xlabel('t')
ylabel('w´(0,t)')
subplot(2,1,2)
plot(t,dw1(t))
xlabel('t')
ylabel('w´(1,t)')
Diferencia con la estacionaria
%Definimos las funciones
wi1=@(x,t,k) ((2*(-1)^(k))/(k*pi)).*sin(k.*pi.*x).*exp(-k^2.*pi^2.*t);
wi2=@(x,t,k) ((2*(-1)^(k))/(k*pi)).*sin(k.*pi.*x).*exp(-k^2.*pi^2.*t./2);
v=@(x) x;
%Sumamos los 10 primeros términos
w1=@(x,t) 0;
w2=@(x,t) 0;
for n=1:10
w1=@(x,t) w1(x,t) + wi1(x,t,n);
w2=@(x,t) w2(x,t) + wi2(x,t,n);
end
%Hacemos la diferencia con la solución estacionaria
dif1=@(t) w1(0.5,t)-v(0.5);
dif2=@(t) w2(0.5,t)-v(0.5);
% Gráfica
close all
t=linspace(0,1,100);
subplot(2,1,1)
plot(t,dif1(t))
xlabel('t')
ylabel('w(0.5,t)-v(0.5)')
subplot(2,1,2)
plot(t,dif2(t))
xlabel('t')
ylabel('w(0.5,t)-v(0.5)')