Автоматическая система регулирования промышленного кондиционера

0000;

000.1/5400;

0000;

0000.2/950;

0000];

%B=[ 0 0 0 0;0 0.4/430 0 0;0 0 0 0;0 0 0.3/470 0;0 0 0 0;0 0 0 0.9/480;0 0 0 0;-0.7/430 0 0 0;0 0 0 0;0 0.2/840 0 0;0 0 0 0;0 0 0.9/800 0;0 0 0 0;0 0 0 0.5/570;0 0 0 0;-0.1/450 0 0 0;0 0 0 0;0 0.1/640 0 0;0 0 0 0;0 0 0.1/540 0;0 0 0 0;0 0 0 0.2/950;0 0 0 0];

C=[0 -1 1 -1 1 0 -1 -1 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0;

0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 1 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 1 -1 1 -1 1 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 1 -1 1 -1 1];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

dt=0.1/max(abs(eig(A))); %0.25

D=zeros(4);

t=[0:dt:5000];

[Ad Bd]=c2d(A,B,dt);

G=length(t);

y=dstep(Ad,Bd,C,D,1,G);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure(1)

subplot(4,4,1); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u1,1%');

subplot(4,4,5); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,9); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,13); plot(t,y(:,4));grid;ylabel('y4,РЎ');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

y=dstep(Ad,Bd,C,D,2,G);

subplot(4,4,2); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u2,1%');

subplot(4,4,6); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,10); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,14); plot(t,y(:,4));grid;ylabel('y4,РЎ');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

y=dstep(Ad,Bd,C,D,3,G);

subplot(4,4,3); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u3,1%');

subplot(4,4,7); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,11); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,15); plot(t,y(:,4));grid;ylabel('y4,РЎ');

y=dstep(Ad,Bd,C,D,4,G);

subplot(4,4,4); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u4,1%');

subplot(4,4,8); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,12); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,16); plot(t,y(:,4));grid;ylabel('y4,РЎ');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A1=[Ad zeros(33,4); C eye(4)];

B1=[Bd;zeros(4)];

C1=[zeros(4,33) eye(4)];

Q=[eye(33) zeros(33,4);zeros(4,33) eye(4)];

R=eye(4);

Q1=eye(37);

R1=eye(4);

K=dlqr(A1,B1,Q,R);

L=dlqr(A1',C1',Q1,R1)';

K1=K(:,1:33);

K2=K(:,34:37);

L1=L(1:33,:);

L2=L(34:37,:);

Ar=[Ad-Bd*K1 -Bd*K2-L1 L1; C eye(4)-L2 L2; zeros(4,33) zeros(4) eye(4)];

Br=[zeros(33,4); zeros(4); eye(4)];

Cr=[-K zeros(4)];

x=zeros(33,1); xr=zeros(41,1); u=zeros(4,1);

yy=[]; uu=[];f=[0.5;0.5;0.5;1];z=[7;0.8;1.5;2.8];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

for i=1:10000,

y=C*x; e=-z+y;

u=Cr*xr; xr=Ar*xr+Br*e;

y=C*x; x=Ad*x+Bd*(u+f);

yy=[yy; y']; uu=[uu; u'];

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

x1=x; xr1=xr; u1=u;

figure(2)

subplot(4,4,2); plot(yy(:,1));grid;ylabel('y1,C');title('y1');

subplot(4,4,4); plot(yy(:,2));grid;ylabel('y2,C');title('y2');

subplot(4,4,6); plot(yy(:,3));grid;ylabel('y3,C');title('y3');

subplot(4,4,8); plot(yy(:,4));grid;ylabel('y4,C');title('y4');

subplot(4,4,1); plot(uu(:,1));grid;ylabel('u1,%');title('u1');

subplot(4,4,3); plot(uu(:,2));grid;ylabel('u2,%');title('u2');

subplot(4,4,5); plot(uu(:,3));grid;ylabel('u3,%');title('u3');

subplot(4,4,7); plot(uu(:,4));grid;ylabel('u4,%');title('u4');

Функциональная схема автоматизации приведена на рисунке

Рисунок – Функциональная схема автоматизации

Страница:  1  2  3  4  5  6  7  8 


Другие рефераты на тему «Программирование, компьютеры и кибернетика»:

Поиск рефератов

Последние рефераты раздела

Copyright © 2010-2024 - www.refsru.com - рефераты, курсовые и дипломные работы