%u(t) = sin(2*pi*f*t)
%f=0.1 ; %Hz
%y(t)= ?
%u(t) --- [G] --- y(t)
%xi=0.3;
%w0=1/sqrt(2);

clear all;

s=tf('s');
%K = 100 * pi*pi;
%w = 100 * pi*pi;
%psi = 10*pi/(2*sqrt(w));
%G = K/(s*s +2*psi*sqrt(w)*s + w);
%G

%D1 = 100*exp(- pi*psi/(sqrt(1-psi*psi)))

%subplot(2,1,1)
%bode(G)
%grid minor

%damp(G)

xi = 0.3;
w0 = 1/sqrt(2);
K=1;
G = K/(s*s +2*xi*w0*s + w0*w0);

f = 0.1;
t = 0:0.1:100;
u=sin(2*pi*f*t);
w = 2*pi*f;

% On a G(s), il faut transformer u(t) en U(s)
Us = w /(s*s +w*w); %Laplace de u(t)
y4 = Us*G; 
[yt,t4] = impulse(y4)

subplot(2,1,2)
plot(t4,yt)
