Documentos de Académico
Documentos de Profesional
Documentos de Cultura
ndice
1. Funciones peridicas 2. Series de Fourier 3. Variable compleja 4. Transformada de Fourier 5. Ecuacin de onda 6. Ecuacin del calor 7. Ecuacin de Laplace 3 3 3 3 4 4 5
1.
Funciones peridicas
%grca una funcin peridica t=-pi:0.1:pi; ft=t.^2+t; for n=-3:3 tt=t+2*n*pi; hold on plot (tt,ft,g-,LineWidth,3) hold o end xlabel(t,FontSize, 20) ylabel(f(t),FontSize, 20)
2.
Series de Fourier
%serie de Fourier function y = fourier(t) y=0.0; for n = 1:5; y =y + pi^2/3+4*(-1)^n*cos(n*t)/(n^2)-2*(-1)^n*sin(n*t)/n; end y=y-min(y);
3.
Variable compleja
%nmero complejo a=3-2*i; polar(angle(a), abs(a), *r); legend(z=3-2i) title(Plano Complejo,Color,b,FontSize,20)
4.
Transformada de Fourier
%Espectro de una seal pas=0.01; t=0:pas:10; senal=sin(10*pi*t)+cos(15*t+t.^2); %graco de la senal ejet=[0:pas:(length(senal)-1)*pas]; subplot(1,2,1); plot(ejet,senal); axis([ min(ejet) max(ejet) min(senal) max(senal)]); xlabel(t (s)); title(Grco de la senal)
%espectro subplot(1,2,2); dim=length(senal)*pas; ejefrec=[0:1/dim:(length(senal)-1)/dim]; spectr=abs(t(senal)); plot(ejefrec,spectr); axis([0 10 0 max(spectr)]); xlabel(frecuencia (Hz)); title(Espectro de amplitud de la seal)
5.
Ecuacin de onda
%Ecuacin de onda function u = onda(x,t) a=1; l=3; u=0.0; for n = 1:5; integrando=@(x)(-.03*x+.1).*sin(n*pi*x/l); integral=quad(integrando,0,l); cn=(2/l)*integral; u =u + (cn*cos(a*n*pi*t/l)).*sin(n*pi*x/l); end
%grco de la ecuacin de onda de una cuerda l=3; xg=0:0.05:l; tg=0:0.05:10; [x,t]=meshgrid(xg,tg); u=onda(x,t); mesh(x,t,u) title(Solucion de la ecuacion de onda,Color,b,FontSize,20) xlabel(x,FontSize, 20) ylabel(t,FontSize, 20) zlabel(u,FontSize, 20)
6.
7.
Ecuacin de Laplace
%grco de la ecuacin de Laplace R1=6; R2=4.5; u1=11; u2=6.4; xg=-5:.1:5; yg=-5:.1:5; [x,y]=meshgrid(xg,yg); r=(x.^2+y.^2).^.5; u=u1+(u2-u1)*log(r/R1)./log(R2/R1); mesh(x,y,u) title(Solucion de la ecuacion de Laplace,Color,b,FontSize,20) xlabel(x,FontSize, 20) ylabel(y,FontSize, 20) zlabel(u,FontSize, 20)