Ecuación del Calor Grupo CCE
| Trabajo realizado por estudiantes | |
|---|---|
| Título | Ecuación del Calor. Grupo CCE |
| Asignatura | EDP |
| Curso | 2025-26 |
| Autores | Coloma de Lara
Carlos de Miguel Elena Rodríguez |
| Este artículo ha sido escrito por estudiantes como parte de su evaluación en la asignatura | |
Medio:PosterecuacioncalorCCE.pdf
Contenido
1 Ilustrar la solución fundamental de la ecuación del calor en dimensión 1.
Primero vamos a ilustrar la solución fundamental de la ecuación del calor en dimensión [math] 1 [/math] , tomando [math]x\in [-1,1] [/math] y [math]t\in [10^{-2},1] [/math]. Recordamos que la solución fundamental de la ecuación del calor es :
[math]\Phi(x,t) = \frac{1}{\sqrt{4\pi k t}} e^{-\frac{x^2}{4kt}}[/math]
donde [math] k [/math] es la constante de difusión térmica del material. Para ilustrarla vamos a suponer [math] k=1 [/math].
| Implementación en MATLAB | Resultado Gráfico |
|---|---|
% Parámetros iniciales
k = 1; % Asumimos difusividad 1
x = linspace(-1, 1, 1000);
% Instantes de tiempo dentro del intervalo [10^-2, 1]
tiempos = [0.01, 0.05, 0.1, 0.5, 1];
figure;
hold on;
grid on;
colores = lines(length(tiempos));
% Calcular y dibujar la solución en cada instante de tiempo
for i = 1:length(tiempos)
t = tiempos(i);
% fórmula de la solución fundamental
Phi = (1 / sqrt(4 * pi * k * t)) * exp(-(x.^2) / (4 * k * t));
% dibujamos
plot(x, Phi, 'LineWidth', 2, 'Color', colores(i,:), ...
'DisplayName', ['t = ', num2str(t)]);
end
title('Solución fundamental de la ecuación del calor', 'FontSize', 14);
xlabel('Posición (x)', 'FontSize', 12);
ylabel('\Phi(x,t)', 'FontSize', 12);
legend('show', 'FontSize', 11);
xlim([-1 1]);
hold off; |
2 Ilustrar la solución fundamental de la ecuación del calor en dimensión 2.
Vamos a representar ahora la solución fundamental en dimensión [math] 2[/math] para los tiempos [math]t=0.001 [/math], [math] t=0.01[/math] y [math] t= 0.1[/math] y veremos como se acerca a una Delta de Dirac, ya que toda la energía se concentra en un solo punto a medida que el tiempo se acerca a 0. Ahora la solución fundamental es de la forma:
[math]\Phi(x,t) = \frac{1}{4\pi k t} e^{-\frac{x^2 + y^2}{4kt}}[/math]
El código es:
| Implementación en MATLAB: Representación dim=2 | ||
|---|---|---|
k = 1;
tiempos = [0.1, 0.01, 0.001];
[X, Y] = meshgrid(linspace(-1, 1, 100), linspace(-1, 1, 100));
figure('Position', [100, 100, 1200, 400]);
for i = 1:length(tiempos)
t = tiempos(i);
Phi_2D = (1 / (4 * pi * k * t)) * exp(-(X.^2 + Y.^2) / (4 * k * t));
subplot(1, 3, i);
surf(X, Y, Phi_2D, 'EdgeColor', 'none');
colormap(jet);
view(-30, 30);
title(['t = ', num2str(t)], 'FontSize', 14);
xlabel('x_1', 'FontSize', 12);
ylabel('x_2', 'FontSize', 12);
zlabel('\Phi', 'FontSize', 12);
xlim([-1 1]);
ylim([-1 1]);
end
sgtitle('Solución fundamental en dimensión 2', 'FontSize', 16, 'FontWeight', 'bold'); | ||
| 1. t=0.1 | 2. t=0.01 | 3. t=0.001 |
3 Autosemejanza
| Implementación en MATLAB | Resultado Gráfico |
|---|---|
clear; clc; close all;
% Parámetro de difusión
k = 1;
% Valores de tiempo
t_values = [0.01, 0.05, 0.1, 0.5, 1];
% Dominio espacial
x = linspace(-1, 1, 1000);
%% 🔹 Gráfica 1: u(x,t) para distintos tiempos
figure;
hold on;
for t = t_values
u = (1./sqrt(4*pi*k*t)) .* exp(-x.^2./(4*k*t));
plot(x, u, 'LineWidth', 2);
end
title('Solución de la ecuación del calor');
xlabel('x');
ylabel('u(x,t)');
legend('t=0.01','t=0.05','t=0.1','t=0.5','t=1');
grid on;
%% 🔹 Gráfica 2: Autosemejanza
figure;
hold on;
for t = t_values
u = (1./sqrt(4*pi*k*t)) .* exp(-x.^2./(4*k*t));
xi = x ./ sqrt(t); % variable reescalada
u_rescaled = u .* sqrt(t); % reescalado vertical
plot(xi, u_rescaled, 'LineWidth', 2);
end
title('Autosemejanza: colapso de curvas');
xlabel('\xi = x / sqrt(t)');
ylabel('u(x,t) * sqrt(t)');
legend('t=0.01','t=0.05','t=0.1','t=0.5','t=1');
grid on; |
| Implementación en MATLAB | Resultado Gráfico |
|---|---|
clear; clc; close all;
% Simulación Completa de Autosemejanza en 2D (Visualización 3D en 6 subplots)
clear; clc; close all;
% --- Parámetros de la simulación ---
k = 1; % Difusividad térmica
tiempos = [0.1, 0.01, 0.001]; % Instantes de tiempo solicitados
[X, Y] = meshgrid(linspace(-1, 1, 200)); % Malla de visualización base
R2 = X.^2 + Y.^2;
% Preparar la figura principal (grande para que se vea bien)
figure('Color', 'w', 'Position', [50, 50, 1300, 750]);
colores = jet(length(tiempos)+1); % Paleta de colores cálidos
% --- Bucle para generar las 6 gráficas ---
for i = 1:length(tiempos)
t = tiempos(i);
% 1. Calcular la solución fundamental u(x, y, t) en 2D
u = (1 / (4*pi*k*t)) * exp(-R2 / (4*k*t));
% --- GRÁFICAS SUPERIORES: Solución Original u(x, y, t) ---
subplot(2, 3, i);
surf(X, Y, u, 'EdgeColor', 'none', 'FaceAlpha', 0.9);
colormap(jet); shading interp; % Suavizar colores
camlight; lighting gouraud; % Iluminación 3D
view(3); grid on;
% Ajuste de títulos y ejes (Notarás que las escalas cambian)
title(['Original $u(x,y)$, $t = ' num2str(t) '$'], 'Interpreter', 'latex', 'FontSize', 12);
xlabel('$x$', 'Interpreter', 'latex');
ylabel('$y$', 'Interpreter', 'latex');
zlabel('$u(x,y,t)$', 'Interpreter', 'latex');
% --- GRÁFICAS INFERIORES: Colapso (Autosemejanza 2D) ---
subplot(2, 3, i+3);
% APLICAR VARIABLES DE ESCALA PARA 2D:
% Ejes X,Y: eta = r / sqrt(t)
% Eje Z (Altura): u * t (En 1D era u * sqrt(t))
Eta_X = X / sqrt(t);
Eta_Y = Y / sqrt(t);
U_escalada = u * t;
% Graficar la superficie escalada
surf(Eta_X, Eta_Y, U_escalada, 'FaceColor', colores(i,:), ...
'EdgeColor', 'none', 'FaceAlpha', 0.8);
shading interp; camlight; lighting gouraud;
view(3); grid on;
% Configuración de ejes fijos para notar el colapso geométrico
% (Aquí todos deben verse iguales)
axis([-5 5 -5 5 0 0.1]);
title(['Escalada $Phi \cdot t$, $t = ' num2str(t) '$'], 'Interpreter', 'latex', 'FontSize', 12);
xlabel('$\eta_x = x/\sqrt{t}$', 'Interpreter', 'latex');
ylabel('$\eta_y = y/\sqrt{t}$', 'Interpreter', 'latex');
zlabel('$Phi(x,y,t) \cdot t$', 'Interpreter', 'latex');
end
% Título general del póster
sgtitle('Difusión en 2D: De la Delta de Dirac a la Autosemejanza Universal', 'FontSize', 16, 'FontWeight', 'bold'); |
4 =Mapa de calor
| Implementación en MATLAB | Resultado Gráfico |
|---|---|
clear; clc; close all;
k = 1;
t_final = 1;
Nx = 300;
Nt = 300;
x_full = linspace(-1, 1, Nx);
t_full = linspace(1e-4, t_final, Nt); después de cero para evitar la división por cero
[X, T] = meshgrid(x_full, t_full);
Phi_XT = (1 ./ sqrt(4 * pi * k * T)) .* exp(-(X.^2) ./ (4 * k * T));
figure('Position', [100, 100, 800, 700], 'Color', 'k'); % Fondo negro
axes('Color', 'k', 'XColor', 'w', 'YColor', 'w'); % Ejes blancos sobre fondo negro
hold on; grid off; % Eliminamos la rejilla para un look más limpio
% Usamos pcolor y shadin interp para el degradado
p = pcolor(X, T, Phi_XT);
shading interp;
% elegir y ajustar el mapa de colores para el efecto "luz"
colormap(hot); % mapa de colores cálido
caxis([0 3.5]);
title({'MAPA ESPACIO-TEMPORAL: DELTA DE DIRAC PUNTUAL}, ...
'FontSize', 16, 'FontWeight', 'bold', 'Color', 'w', 'Interpreter', 'latex');
xlabel('Posición (x)', 'FontSize', 14, 'Color', 'w');
ylabel('Tiempo (t)', 'FontSize', 14, 'Color', 'w');
xlim([-1 1]);
ylim([-0.02 t_final]);
view(0, 90);
hold off; |
4.1 Decaimiento
| Implementación en MATLAB | Resultado Gráfico |
|---|---|
clear; clc; close all;
% Parámetros iniciales
k = 1;
t = logspace(0, 4, 100);
Phi_max_1D = (1 ./ sqrt(4 * pi * k * t));
Phi_max_2D = (1 ./ (4 * pi * k * t));
figure;
hold on;
grid on;
% Dibujamos el decaimiento usando escala logarítmica en ambos ejes
loglog(t, Phi_max_1D, 'LineWidth', 2, 'Color', [0 0.4470 0.7410], ...
'DisplayName', 'Decaimiento 1D (\propto t^{-1/2})');
loglog(t, Phi_max_2D, 'LineWidth', 2, 'Color', [0.8500 0.3250 0.0980], ...
'DisplayName', 'Decaimiento 2D (\propto t^{-1})');
loglog(t, 0.2 * t.^(-0.5), '--k', 'LineWidth', 1, ...
'DisplayName', 'Pendiente de referencia: -1/2');
loglog(t, 0.05 * t.^(-1), ':k', 'LineWidth', 1, ...
'DisplayName', 'Pendiente de referencia: -1');
% ----------------------------------
title('Decaimiento térmico en el origen cuando t \rightarrow \infty', 'FontSize', 14);
xlabel('Tiempo (t)', 'FontSize', 12);
ylabel('Temperatura máxima \Phi(0,t)', 'FontSize', 12);
legend('show', 'FontSize', 11, 'Location', 'southwest');
xlim([1 10^4]);
hold off; |
| Implementación en MATLAB | Resultado Gráfico |
|---|---|
clear; clc; close all;
k = 1;
t = logspace(0, 4, 100);
Norma_L1 = ones(size(t));
Norma_L2_1D = (8 * pi * k * t).^(-1/4);
figure;
hold on;
grid on;
loglog(t, Norma_L1, 'LineWidth', 2, 'Color', [0.4660 0.6740 0.1880], ...
'DisplayName', 'Norma L^1 (Conservación de energía)');
loglog(t, Norma_L2_1D, 'LineWidth', 2, 'Color', [0 0.4470 0.7410], ...
'DisplayName', 'Norma L^2 (Decaimiento \propto t^{-1/4})');
loglog(t, 0.5 * t.^(-0.25), '--k', 'LineWidth', 1, ...
'DisplayName', 'Pendiente de ref: -1/4');
title('Evolución de las normas L^1 y L^2 en 1D (t \rightarrow \infty)', 'FontSize', 14);
xlabel('Tiempo (t)', 'FontSize', 12);
ylabel('Valor de la norma', 'FontSize', 12);
ylim([0.01 2]); % Para dar algo de aire por arriba de la línea L1
legend('show', 'FontSize', 11, 'Location', 'southwest');
hold off; |
| Implementación en MATLAB | Resultado Gráfico |
|---|---|
clear; clc; close all;
% Parámetros iniciales
k = 1;
x = linspace(-2, 2, 100);
y = linspace(-2, 2, 100);
[X, Y] = meshgrid(x, y);
tiempos = [0.05, 0.2, 0.5, 1];
figure('Position', [100, 100, 1200, 350], 'Name', 'Solución Fundamental 2D');
for i = 1:length(tiempos)
t = tiempos(i);
Phi = (1 / (4 * pi * k * t)) * exp(-(X.^2 + Y.^2) / (4 * k * t));
subplot(1, 4, i);
surf(X, Y, Phi, 'EdgeColor', 'none');
colormap turbo;
grid on;
zlim([0 1.6]);
title(['t = ', num2str(t)], 'FontSize', 12);
xlabel('Posición (x)', 'FontSize', 10);
ylabel('Posición (y)', 'FontSize', 10);
zlabel('\Phi(x,y,t)', 'FontSize', 10);
view(-30, 30);
end |