Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- close all;
- hold on; grid on;
- czas=20;
- a1=7;
- a0=3;
- b=4;
- u0=7;
- du=0;
- t0=0
- t= 0:0.01:5;
- xs1=0*t;
- xw1=28+0*t;
- x1= xs1 + xw1;
- xs2=-6*exp(-3/7*t);
- x2=xs2+xw1;
- xs3=-28*exp(-3/7*t);
- x3=xs3+xw1;
- xs4=-19*exp(-3/7*t);
- x4=xs4+xw1;
- xw5=7+t*0;
- xs5=-5*exp(-t);
- x5=xs5+xw5;
- figure(1)
- xlabel('t');
- ylabel('x(t)');
- plot(t,xs1,'g')
- plot(t,x1,'b')
- plot(t,xw1,'r')
- legend('xs(t)','x(t)','xw(t)');
- figure(2)
- hold on;
- grid on;
- xlabel('t');
- ylabel('x(t)');
- plot(t,xs2,'g')
- plot(t,x2,'b')
- plot(t,xw1,'r')
- legend('xs(t)','x(t)','xw(t)');
- figure(3)
- hold on;
- grid on;
- xlabel('t');
- ylabel('x(t)');
- plot(t,xs3,'g')
- plot(t,x3,'b')
- plot(t,xw1,'r')
- legend('xs(t)','x(t)','xw(t)');
- figure(4)
- hold on;
- grid on;
- xlabel('t');
- ylabel('x(t)');
- plot(t,xs4,'g')
- plot(t,x4,'b')
- plot(t,xw1,'r')
- legend('xs(t)','x(t)','xw(t)');
- %simulink
- x0=28;
- figure(5)
- hold on;
- grid on;
- xlabel('t');
- ylabel('x(t)');
- plot(t,xs5,'g')
- plot(t,x5,'b')
- plot(t,xw5,'r')
- legend('xs(t)','x(t)','xw(t)');
- figure(6)
- subplot(2,3,1);
- hold on;
- grid on;
- plot(t,x,'r')
- sim('l4')
- x0=6;
- subplot(2,3,2);
- hold on;
- grid on;
- plot(t,x,'r')
- x0=0;
- subplot(2,3,3);
- hold on;
- grid on;
- plot(t,x,'r')
- x0=9;
- subplot(2,3,4);
- hold on;
- grid on;
- plot(t,x,'r')
- x0=0;
- u0=0;
- du=1;
- subplot(2,3,5);
- hold on;
- grid on;
- plot(t,x,'r')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement