You are on page 1of 12

clc, clear all

T=0.1;
td=0:T:1;
x=exp(-td);
N=length(x);
wn1=0;
for n=1:N
w(n)=x(n)+wn1;
y(n)=T*wn1;
wn1=w(n);
end
y

y =

Columns 1 through 7

0 0.1000 0.1905 0.2724 0.3464 0.4135 0.4741

Columns 8 through 11

0.5290 0.5787 0.6236 0.6643

clc, clear all


T=0.01;
td=0:T:1;
x=exp(-td);
N=length(x);
wn1=0;
for n=1:N
w(n)=x(n)+wn1;
y(n)=T*wn1;
wn1=w(n);
end
y

y =
Columns 1 through 7

0 0.0100 0.0199 0.0297 0.0394 0.0490 0.0585

Columns 8 through 14

0.0679 0.0773 0.0865 0.0956 0.1047 0.1136 0.1225

Columns 15 through 21

0.1313 0.1400 0.1486 0.1571 0.1656 0.1739 0.1822

Columns 22 through 28

0.1904 0.1985 0.2065 0.2144 0.2223 0.2301 0.2378

Columns 29 through 35

0.2454 0.2530 0.2605 0.2679 0.2752 0.2825 0.2897

Columns 36 through 42

0.2968 0.3038 0.3108 0.3177 0.3246 0.3313 0.3380

Columns 43 through 49

0.3447 0.3512 0.3577 0.3642 0.3706 0.3769 0.3831

Columns 50 through 56

0.3893 0.3954 0.4015 0.4075 0.4135 0.4193 0.4252

Columns 57 through 63

0.4309 0.4367 0.4423 0.4479 0.4534 0.4589 0.4644

Columns 64 through 70

0.4697 0.4751 0.4803 0.4856 0.4907 0.4959 0.5009

Columns 71 through 77

0.5059 0.5109 0.5158 0.5207 0.5255 0.5303 0.5350

Columns 78 through 84

0.5397 0.5443 0.5489 0.5534 0.5579 0.5624 0.5668

Columns 85 through 91

0.5711 0.5755 0.5797 0.5840 0.5881 0.5923 0.5964

Columns 92 through 98

0.6005 0.6045 0.6085 0.6124 0.6163 0.6202 0.6240

Columns 99 through 101

0.6278 0.6316 0.6353


clc, clear all
T=0.1;
td=0:T:1;
x=exp(-td);
N=length(x);
xn1=0; yn1=0;
for n=1:N
y(n)=yn1+T*xn1;
xn1=x(n);
yn1=y(n);
end
y

y =

Columns 1 through 7

0 0.1000 0.1905 0.2724 0.3464 0.4135 0.4741

Columns 8 through 11

0.5290 0.5787 0.6236 0.6643

clc, clear all


T=0.01;
td=0:T:1;
x=exp(-td);
N=length(x);
xn1=0; yn1=0;
for n=1:N
y(n)=yn1+T*xn1;
xn1=x(n);
yn1=y(n);
end
y
y =

Columns 1 through 7

0 0.0100 0.0199 0.0297 0.0394 0.0490 0.0585

Columns 8 through 14

0.0679 0.0773 0.0865 0.0956 0.1047 0.1136 0.1225

Columns 15 through 21

0.1313 0.1400 0.1486 0.1571 0.1656 0.1739 0.1822

Columns 22 through 28

0.1904 0.1985 0.2065 0.2144 0.2223 0.2301 0.2378

Columns 29 through 35

0.2454 0.2530 0.2605 0.2679 0.2752 0.2825 0.2897

Columns 36 through 42

0.2968 0.3038 0.3108 0.3177 0.3246 0.3313 0.3380

Columns 43 through 49

0.3447 0.3512 0.3577 0.3642 0.3706 0.3769 0.3831

Columns 50 through 56

0.3893 0.3954 0.4015 0.4075 0.4135 0.4193 0.4252

Columns 57 through 63

0.4309 0.4367 0.4423 0.4479 0.4534 0.4589 0.4644

Columns 64 through 70

0.4697 0.4751 0.4803 0.4856 0.4907 0.4959 0.5009

Columns 71 through 77

0.5059 0.5109 0.5158 0.5207 0.5255 0.5303 0.5350

Columns 78 through 84

0.5397 0.5443 0.5489 0.5534 0.5579 0.5624 0.5668

Columns 85 through 91

0.5711 0.5755 0.5797 0.5840 0.5881 0.5923 0.5964

Columns 92 through 98

0.6005 0.6045 0.6085 0.6124 0.6163 0.6202 0.6240

Columns 99 through 101

0.6278 0.6316 0.6353


%Función bilin con aprox. Euler en adelanto
cs=tf([1 5],[1 0]);
T=0.1;
cz=tf(bilin(ss(cs),1,'FwdRec',T))

cz =

z - 0.5
-------
z - 1

Sample time: 0.1 seconds


Discrete-time transfer function.

cz=pid(1,5,0,0,0.1,'IF','F')

cz =

Ts
Kp + Ki * ------
z-1

with Kp = 1, Ki = 5, Ts = 0.1

Sample time: 0.1 seconds


Discrete-time PI controller in parallel form.

You might also like