Diferencia entre revisiones de «Series de Fourier EPNL»

De MateWiki
Saltar a: navegación, buscar
Línea 9: Línea 9:
 
# Poster  
 
# Poster  
 
# PDF
 
# PDF
 +
 +
El primer código para visualizar las series de fourier con coeficientes normales (0,1) es el siguiente:
 
<source lang: "Matlab" line>
 
<source lang: "Matlab" line>
 
x = linspace(-pi, pi, 4000);
 
x = linspace(-pi, pi, 4000);
Línea 40: Línea 42:
 
</source>
 
</source>
  
 +
Mientras que el código para las normales (0,$1/n$) y (0,$1/n^2$) es el siguiente:
 +
 +
<source lang: "Matlab" line>
 +
 +
%Fourier N(0,1/n)
 +
 +
x = linspace(-pi, pi, 4000);
 +
Ns = [100, 200, 500, 1000];
 +
 +
figure
 +
 +
for k = 1:length(Ns)
 +
   
 +
    N = Ns(k);
 +
    n = 1:N;
 +
   
 +
    % Desviación típica = 1/n
 +
    A = (1./n) .* randn(1,N);
 +
    B = (1./n) .* randn(1,N);
 +
   
 +
    f = zeros(size(x));
 +
    for j = 1:N
 +
        f = f + A(j)*cos(j*x) + B(j)*sin(j*x);
 +
    end
 +
   
 +
    subplot(2,2,k)
 +
    plot(x, f, 'DisplayName', ['N = ' num2str(N)])
 +
    xlim([-pi pi])
 +
    ylim([-5 5])
 +
    legend show
 +
    grid on
 +
   
 +
end
 +
 +
sgtitle('Serie de Fourier con A_n,B_n ~ N(0, 1/n)')
 +
 +
 +
%Fourier N(0,1/n^2)
 +
x = linspace(-pi, pi, 4000);
 +
Ns = [100, 200, 500, 1000];
 +
 +
figure
 +
 +
for k = 1:length(Ns)
 +
   
 +
    N = Ns(k);
 +
    n = 1:N;
 +
   
 +
    % Desviación típica = 1/n
 +
    A = (1./n.^2) .* randn(1,N);
 +
    B = (1./n.^2) .* randn(1,N);
 +
   
 +
    f = zeros(size(x));
 +
    for j = 1:N
 +
        f = f + A(j)*cos(j*x) + B(j)*sin(j*x);
 +
    end
 +
   
 +
    subplot(2,2,k)
 +
    plot(x, f, 'DisplayName', ['N = ' num2str(N)])
 +
    xlim([-pi pi])
 +
    ylim([-5 5])
 +
    legend show
 +
    grid on
 +
   
 +
end
 +
 +
sgtitle('Serie de Fourier con A_n,B_n ~ N(0, 1/n^2)')
 +
 +
 +
</source>
  
  

Revisión del 20:36 18 feb 2026

Trabajo realizado por estudiantes
Título Series de Fourier. Grupo EPNL
Asignatura EDP
Curso 2025-26
Autores Elsa Coutelenq

Paula León

Noé Rico

Leo Zambrano

Este artículo ha sido escrito por estudiantes como parte de su evaluación en la asignatura


  1. Poster
  2. PDF

El primer código para visualizar las series de fourier con coeficientes normales (0,1) es el siguiente:

x = linspace(-pi, pi, 4000);
Ns = [10, 20, 50, 100];

figure

for k = 1:length(Ns)
    
    N = Ns(k);
    
    A = randn(1,N);
    B = randn(1,N);
    
    f = zeros(size(x));
    for n = 1:N
        f = f + A(n)*cos(n*x) + B(n)*sin(n*x);
    end
    
    subplot(2,2,k)
    plot(x, f, 'DisplayName', ['N = ' num2str(N)])
    xlim([-pi pi])
    ylim([-30 30])
    legend show
    grid on
    
end

sgtitle('Serie de Fourier con coeficientes N(0,1)')

Mientras que el código para las normales (0,$1/n$) y (0,$1/n^2$) es el siguiente:

%Fourier N(0,1/n)

x = linspace(-pi, pi, 4000);
Ns = [100, 200, 500, 1000];

figure

for k = 1:length(Ns)
    
    N = Ns(k);
    n = 1:N;
    
    % Desviación típica = 1/n
    A = (1./n) .* randn(1,N);
    B = (1./n) .* randn(1,N);
    
    f = zeros(size(x));
    for j = 1:N
        f = f + A(j)*cos(j*x) + B(j)*sin(j*x);
    end
    
    subplot(2,2,k)
    plot(x, f, 'DisplayName', ['N = ' num2str(N)])
    xlim([-pi pi])
    ylim([-5 5])
    legend show
    grid on
    
end

sgtitle('Serie de Fourier con A_n,B_n ~ N(0, 1/n)')


%Fourier N(0,1/n^2)
x = linspace(-pi, pi, 4000);
Ns = [100, 200, 500, 1000];

figure

for k = 1:length(Ns)
    
    N = Ns(k);
    n = 1:N;
    
    % Desviación típica = 1/n
    A = (1./n.^2) .* randn(1,N);
    B = (1./n.^2) .* randn(1,N);
    
    f = zeros(size(x));
    for j = 1:N
        f = f + A(j)*cos(j*x) + B(j)*sin(j*x);
    end
    
    subplot(2,2,k)
    plot(x, f, 'DisplayName', ['N = ' num2str(N)])
    xlim([-pi pi])
    ylim([-5 5])
    legend show
    grid on
    
end

sgtitle('Serie de Fourier con A_n,B_n ~ N(0, 1/n^2)')