# 2010-09-30

# 2010-09-30

clc
clear all
close all

A = 1; B = 0.8;
Ti = 0.7;
deltat = 0.0001;

entrada = 1; # i*t)

N = 100000;
n = 1;

error = zeros(N,1); # e(t)
f = zeros(N,1);
o = zeros(N,1);


while n <= N -1
#  error(n) = entrada - o(n);
  error(n) = rand() - o(n);
  f(n+1) = deltat * error(n)/Ti + f(n);
  o(n+1) = -(B/A)*deltat*o(n) + (deltat/A)*f(n) + o(n);
  n += 1;
end


figure(1, "visible", "off");
plot(o);
grid;
print -deps "../media/lazo_cerrado.eps";
