yt=[18573 20195 21268 23635]'; //93-97
plot2d(yt)
n=length(yt)
yt1=[93;yt(1:n-1)]
yt2=[93;yt(1:n-2)]
x=[yt1 yt2]
plot(yt)
b=inv(x'*x)*(x'*zt)
s=poly(0,'s')
s=s^2-b(1)*s-b(2)
raiz=roots(s)
alfa=real(raiz(1))
bet=imag(raiz(1))
r=sqrt(alfa^2+bet^2)
teta=acos(alfa/r)
t=[1:n]';
z1= (r.^t).*cos(teta*t)
z2= (r.^t).*sin(teta*t)
x=[z1 z2]
A= inv(x'*x)*(x'*zt)
z= a(1)*z1+A(2)*z2
plot2d(t,[zt z])
plot (t,zt)
t[1:n+1]';
t[1:0.1:n]';
z1= (r.^t).*cos(teta*t)
z2= (r.^t).*sin(teta*t)
z=A(1)*z1+A(2)*z2
plot(t,z)
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario