Sei sulla pagina 1di 14

t=0:0.

0001:1; subplot(4,4,10)
A=1; plot(t,y4)
y1=(A/2)- title('f4')
((A/pi)*sin(2*pi*t)) xlabel('t')
; ylabel('y4')
subplot(4,4,1) grid
plot(t,y1) axis([0 1 -0.2 0.2])
title('fun 1')
xlabel('t') y1234=y1+y2+y3+y4;
ylabel('y1') subplot(4,4,11)
grid plot(t,y1234)
axis([0 1 0 1]) title('Y1234')
xlabel('t')
y2=- ylabel('y1234')
(A/(2*pi))*sin(4*pi* grid
t); axis([0 1 -0.2 1])
subplot(4,4,2)
plot(t,y2) y5=-
title('Y2') (A/(5*pi))*sin(10*pi
xlabel('t') *t);
ylabel('y2') subplot(4,4,14)
grid plot(t,y5)
axis([0 1 -0.2 0.2]) title('Y5')
xlabel('t')
y12=y1+y2; ylabel('y5')
subplot(4,4,3) grid
plot(t,y12) axis([0 1 -0.2 0.2])
title('Y12')
xlabel('t') y12345=y1+y2+y3+y4+y
ylabel('y12') 5;
grid subplot(4,4,15)
axis([0 1 -0.2 1]) plot(t,y12345)
title('Y12345')
y3=- xlabel('t')
(A/(3*pi))*sin(6*pi* ylabel('y12345')
t); grid
subplot(4,4,6) axis([0 1 -0.2 1])
plot(t,y3)
title('Y3')
xlabel('t') t=[0 1 0];
ylabel('y3') x=[0 A 0];
grid subplot(4,4,16)
axis([0 1 -0.2 0.2]) plot(t,x)
title('original')
y123=y1+y2+y3; xlabel('t')
subplot(4,4,7) ylabel('f(t)')
plot(t,y123) grid
title('Y123') axis([0 1 0 1])
xlabel('t')
ylabel('y123')
grid
axis([0 1 -0.2 1])

y4=-
(A/(4*pi))*sin(8*pi*
t);
t=0:0.0001:1; subplot(4,5,9)
A=1; plot(t,y4)
y1=(A/2)- title('f4')
((A/pi)*sin(2*pi*t)) xlabel('t')
; ylabel('y4')
subplot(4,5,6) grid
plot(t,y1) axis([0 1 -0.2 0.2])
title('Fundamental')
xlabel('t') y1234=y1+y2+y3+y4;
ylabel('y1') subplot(4,5,13)
grid plot(t,y1234)
axis([0 1 0 1]) title('Y1234')
xlabel('t')
y2=- ylabel('y1234')
(A/(2*pi))*sin(4*pi* grid
t); axis([0 1 -0.2 1])
subplot(4,5,7)
plot(t,y2) y5=-
title('Y2') (A/(5*pi))*sin(10*pi
xlabel('t') *t);
ylabel('y2') subplot(4,5,10)
grid plot(t,y5)
axis([0 1 -0.2 0.2]) title('Y5')
xlabel('t')
y12=y1+y2; ylabel('y5')
subplot(4,5,11) grid
plot(t,y12) axis([0 1 -0.2 0.2])
title('Y12')
xlabel('t') y12345=y1+y2+y3+y4+y
ylabel('y12') 5;
grid subplot(4,5,14)
axis([0 1 -0.2 1]) plot(t,y12345)
title('Y12345')
y3=- xlabel('t')
(A/(3*pi))*sin(6*pi* ylabel('y12345')
t); grid
subplot(4,5,8) axis([0 1 -0.2 1])
plot(t,y3)
title('Y3')
xlabel('t') t=[0 1 0];
ylabel('y3') x=[0 A 0];
grid subplot(4,5,3)
axis([0 1 -0.2 0.2]) plot(t,x)
title('Original')
y123=y1+y2+y3; xlabel('t')
subplot(4,5,12) ylabel('f(t)')
plot(t,y123) grid
title('Y123') axis([0 1 0 1])
xlabel('t')
ylabel('y123')
grid
axis([0 1 -0.2 1])

y4=-
(A/(4*pi))*sin(8*pi*
t);
Multigráfica original

Multigráfica modificada
clear all,clf,clc
n=5;
A=1;
t=0:0.0001:1;
t1=0:0.0001:1;
x=zeros(size(t));
hold on
for n=1:1:n
if n==1
y=(A/2)-((A/(n*pi))*sin(2*n*pi*t));
t1=[0 1 0];
x1=[0 A 0];
else
y=-(A/(n*pi))*sin(2*n*pi*t);
end
x=y+x;
plot(t,x)
plot(t1,x1)
end
hold off
grid
title('Aproximacion con 5 terminos')
xlabel('t')
ylabel('f(t)')
axis([0,1,-0.05,1.02])
clear all,clf,clc
n=60;
A=1;
t=0:0.0001:1;
t1=0:0.0001:1;
x=zeros(size(t));
hold on
for n=1:1:n
if n==1
y=(A/2)-((A/(n*pi))*sin(2*n*pi*t));
t1=[0 1 0];
x1=[0 A 0];
else
y=-(A/(n*pi))*sin(2*n*pi*t);
end
x=y+x;
plot(t,x)
plot(t1,x1)
end
hold off
grid
title('Aproximacion con 60 terminos')
xlabel('t')
ylabel('f(t)')
axis([0,1,-0.05,1.02])
clear all,clf,clc
n=5;
A=1;
t=0:0.0001:1;
t1=0:0.0001:1;
x=zeros(size(t));
%hold on
for n=1:1:n
if n==1
y=(A/2)-((A/(n*pi))*sin(2*n*pi*t));
%t1=[0 1 0];
%x1=[0 A 0];
else
y=-(A/(n*pi))*sin(2*n*pi*t);
end
x=y+x;
plot(t,x)
%plot(t1,x1)
end
%hold off
grid
title('Aproximacion con 5 terminos')
xlabel('t')
ylabel('f(t)')
axis([0,1,-0.05,1.02])
clear all,clf,clc
n=60;
A=1;
t=0:0.0001:1;
t1=0:0.0001:1;
x=zeros(size(t));
%hold on
for n=1:1:n
if n==1
y=(A/2)-((A/(n*pi))*sin(2*n*pi*t));
%t1=[0 1 0];
%x1=[0 A 0];
else
y=-(A/(n*pi))*sin(2*n*pi*t);
end
x=y+x;
plot(t,x)
%plot(t1,x1)
end
%hold off
grid
title('Aproximacion con 60 terminos')
xlabel('t')
ylabel('f(t)')
axis([0,1,-0.05,1.02])
t=0:0.0001:0.5; axis([0 0.5 -0.065 axis([0 0.5 0.55
y1=0.78+(0.01*(cos(4 0.065 ]) 0.99 ])
*pi*t)))+(0.1244*(si y123=y1+y2+y3;
n(4*pi*t))); subplot(4,4,7);
subplot(4,4,1); y4=(((1.56)/(1+(16*p plot(t,y123)
plot(t,y1) i^2*4^2)))*(cos(4*4* title('y123')
title('y1') pi*t)))+(((78.41)/(1 xlabel('t')
xlabel('t') +(16*4^2*pi^2)))*(si ylabel('y123')
ylabel('y1') n(4*pi*4*t))); grid
grid subplot(4,4,10); axis([0 0.5 0.55
axis([0 0.5 0.65 plot(t,y4) 0.99 ])
0.92 ]) title('y4') y1234=y1+y2+y3+y4;
xlabel('t') subplot(4,4,11);
t=0:0.0001:0.5; ylabel('y4') plot(t,y1234)
y2=(((1.56)/(1+(16*p grid title('y1234')
i^2*2^2)))*(cos(4*2* axis([0 0.5 -0.065 xlabel('t')
pi*t)))+(((39.20)/(1 0.065 ]) ylabel('y1234')
+(16*2^2*pi^2)))*(si t=0:0.0001:0.5; grid
n(4*pi*2*t))); y5=(((1.56)/(1+(16*p axis([0 0.5 0.55
subplot(4,4,2); i^2*5^2)))*(cos(4*5* 0.99 ])
plot(t,y2) pi*t)))+(((98.01)/(1
title('y2') +(16*5^2*pi^2)))*(si y12345=y1+y2+y3+y4+y
xlabel('t') n(4*pi*5*t))); 5;
ylabel('y2') subplot(4,4,14); subplot(4,4,15);
grid plot(t,y5) plot(t,y12345)
axis([0 0.5 -0.065 title('y5') title('y12345')
0.065 ]) xlabel('t') xlabel('t')
ylabel('y5') ylabel('y12345')
grid grid
y3=(((1.56)/(1+(16*p axis([0 0.5 -0.065 axis([0 0.5 0.55
i^2*3^2)))*(cos(4*3* 0.065 ]) 0.99 ])
pi*t)))+(((58.81)/(1 y0=exp(-t);
+(16*3^2*pi^2)))*(si y12=y1+y2; subplot(4,4,16);
n(4*pi*3*t))); subplot(4,4,3); plot(t,y0)
subplot(4,4,6); plot(t,y12) title('y0')
plot(t,y3) title('y12') xlabel('t')
title('y3') xlabel('t') ylabel('y0')
xlabel('t') ylabel('y12') grid
ylabel('y3') grid
grid
t=0:0.0001:0.5; grid axis([0 0.5 0.55
y1=0.78+(0.01*(cos(4 axis([0 0.5 -0.065 0.99 ])
*pi*t)))+(0.1244*(si 0.065 ]) y123=y1+y2+y3;
n(4*pi*t))); subplot(4,5,12);
subplot(4,5,6); plot(t,y123)
plot(t,y1) y4=(((1.56)/(1+(16*p title('y123')
title('y1') i^2*4^2)))*(cos(4*4* xlabel('t')
xlabel('t') pi*t)))+(((78.41)/(1 ylabel('y123')
ylabel('y1') +(16*4^2*pi^2)))*(si grid
grid n(4*pi*4*t))); axis([0 0.5 0.55
axis([0 0.5 0.65 subplot(4,5,9); 0.99 ])
0.92 ]) plot(t,y4) y1234=y1+y2+y3+y4;
title('y4') subplot(4,5,13);
t=0:0.0001:0.5; xlabel('t') plot(t,y1234)
y2=(((1.56)/(1+(16*p ylabel('y4') title('y1234')
i^2*2^2)))*(cos(4*2* grid xlabel('t')
pi*t)))+(((39.20)/(1 axis([0 0.5 -0.065 ylabel('y1234')
+(16*2^2*pi^2)))*(si 0.065 ]) grid
n(4*pi*2*t))); t=0:0.0001:0.5; axis([0 0.5 0.55
subplot(4,5,7); y5=(((1.56)/(1+(16*p 0.99 ])
plot(t,y2) i^2*5^2)))*(cos(4*5*
title('y2') pi*t)))+(((98.01)/(1 y12345=y1+y2+y3+y4+y
xlabel('t') +(16*5^2*pi^2)))*(si 5;
ylabel('y2') n(4*pi*5*t))); subplot(4,5,14);
grid subplot(4,5,10); plot(t,y12345)
axis([0 0.5 -0.065 plot(t,y5) title('y12345')
0.065 ]) title('y5') xlabel('t')
xlabel('t') ylabel('y12345')
ylabel('y5') grid
grid axis([0 0.5 0.55
axis([0 0.5 -0.065 0.99 ])
y3=(((1.56)/(1+(16*p y0=exp(-t);
i^2*3^2)))*(cos(4*3* 0.065 ])
subplot(4,5,3);
pi*t)))+(((58.81)/(1 plot(t,y0)
+(16*3^2*pi^2)))*(si y12=y1+y2;
subplot(4,5,11); title('y0')
n(4*pi*3*t))); xlabel('t')
subplot(4,5,8); plot(t,y12)
title('y12') ylabel('y0')
plot(t,y3) grid
title('y3') xlabel('t')
xlabel('t') ylabel('y12')
ylabel('y3') grid
Multigráfica original

Multigráfica modificada
clear all, clf, clc
n=5
A=1;
cn=A/pi;
t=0:0.001:0.5;

y1=0.787+0.01*cos(4*pi*t)+0.1244*sin(4*pi*t);
plot(t,y1)
plot(t,y1,'k--')

x=zeros(size(t));
hold on
for n=2:1:n

y=((1.574)/(1+16*(pi^2)*(n^2)))*cos(4*n*pi*t)+((0.78*8*pi*n)/(1+16*(pi^2)
*(n^2)))*sin(4*n*pi*t);
x=y+x;
plot(t,x+y1,'k')
end
ylabel('y1,y12,y123,y1234,y12345')
xlabel('t')
title('Aproximacion con 5 terminos')
hold off
grid
clear all, clf, clc
n=80;
A=1;
cn=A/pi;
t=0:0.001:0.5;

y1=0.787+0.01*cos(4*pi*t)+0.1244*sin(4*pi*t);
plot(t,y1)
plot(t,y1,'k--')

x=zeros(size(t));
hold on
for n=2:1:n

y=((1.574)/(1+16*(pi^2)*(n^2)))*cos(4*n*pi*t)+((0.78*8*pi*n)/(1+16*(pi^2)
*(n^2)))*sin(4*n*pi*t);
x=y+x;
plot(t,x+y1,'k')
end
ylabel('y1,y12,y123,y1234,y12345')
xlabel('t')
title('Aproximacion con 80 terminos')
hold off
grid
clear all, clf, clc
n=5;
A=1;
cn=A/pi;
t=0:0.001:0.5;

y1=0.787+0.01*cos(4*pi*t)+0.1244*sin(4*pi*t);
plot(t,y1)
plot(t,y1,'k--')

x=zeros(size(t));
%hold on
for n=2:1:n

y=((1.574)/(1+16*(pi^2)*(n^2)))*cos(4*n*pi*t)+((0.78*8*pi*n)/(1+16*(pi^2)
*(n^2)))*sin(4*n*pi*t);
x=y+x;
plot(t,x+y1,'k')
end
ylabel('y1,y12,y123,y1234,y12345')
xlabel('t')
title('Aproximacion con 5 terminos')
%hold off
grid
clear all, clf, clc
n=80;
A=1;
cn=A/pi;
t=0:0.001:0.5;

y1=0.787+0.01*cos(4*pi*t)+0.1244*sin(4*pi*t);
plot(t,y1)
plot(t,y1,'k--')

x=zeros(size(t));
%hold on
for n=2:1:n

y=((1.574)/(1+16*(pi^2)*(n^2)))*cos(4*n*pi*t)+((0.78*8*pi*n)/(1+16*(pi^2)
*(n^2)))*sin(4*n*pi*t);
x=y+x;
plot(t,x+y1,'k')
end
ylabel('y1,y12,y123,y1234,y12345')
xlabel('t')
title('Aproximacion con 80 terminos')
%hold off
grid

Potrebbero piacerti anche