Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. clear all;
  2. close all;
  3.  
  4. hold on; grid on;
  5. czas=20;
  6. a1=7;
  7. a0=3;
  8. b=4;
  9. u0=7;
  10. du=0;
  11. t0=0
  12.  
  13. t= 0:0.01:5;
  14.  
  15. xs1=0*t;
  16. xw1=28+0*t;
  17. x1= xs1 + xw1;
  18. xs2=-6*exp(-3/7*t);
  19. x2=xs2+xw1;
  20. xs3=-28*exp(-3/7*t);
  21. x3=xs3+xw1;
  22. xs4=-19*exp(-3/7*t);
  23. x4=xs4+xw1;
  24. xw5=7+t*0;
  25. xs5=-5*exp(-t);
  26. x5=xs5+xw5;
  27. figure(1)
  28. xlabel('t');
  29. ylabel('x(t)');
  30.  
  31. plot(t,xs1,'g')
  32. plot(t,x1,'b')
  33. plot(t,xw1,'r')
  34. legend('xs(t)','x(t)','xw(t)');
  35.  
  36. figure(2)
  37. hold on;
  38. grid on;
  39.  
  40. xlabel('t');
  41. ylabel('x(t)');
  42.  
  43. plot(t,xs2,'g')
  44. plot(t,x2,'b')
  45. plot(t,xw1,'r')
  46. legend('xs(t)','x(t)','xw(t)');
  47. figure(3)
  48. hold on;
  49. grid on;
  50.  
  51. xlabel('t');
  52. ylabel('x(t)');
  53.  
  54. plot(t,xs3,'g')
  55. plot(t,x3,'b')
  56. plot(t,xw1,'r')
  57. legend('xs(t)','x(t)','xw(t)');
  58. figure(4)
  59. hold on;
  60. grid on;
  61. xlabel('t');
  62. ylabel('x(t)');
  63.  
  64. plot(t,xs4,'g')
  65. plot(t,x4,'b')
  66. plot(t,xw1,'r')
  67. legend('xs(t)','x(t)','xw(t)');
  68. %simulink
  69.  
  70.  
  71. x0=28;
  72. figure(5)
  73. hold on;
  74. grid on;
  75.  
  76. xlabel('t');
  77. ylabel('x(t)');
  78.  
  79. plot(t,xs5,'g')
  80. plot(t,x5,'b')
  81. plot(t,xw5,'r')
  82. legend('xs(t)','x(t)','xw(t)');
  83.  
  84. figure(6)
  85. subplot(2,3,1);
  86. hold on;
  87. grid on;
  88.  
  89. plot(t,x,'r')
  90. sim('l4')
  91. x0=6;
  92. subplot(2,3,2);
  93. hold on;
  94. grid on;
  95.  
  96. plot(t,x,'r')
  97. x0=0;
  98.  
  99. subplot(2,3,3);
  100. hold on;
  101. grid on;
  102.  
  103. plot(t,x,'r')
  104. x0=9;
  105. subplot(2,3,4);
  106. hold on;
  107. grid on;
  108.  
  109. plot(t,x,'r')
  110.  
  111. x0=0;
  112. u0=0;
  113. du=1;
  114. subplot(2,3,5);
  115. hold on;
  116. grid on;
  117.  
  118. plot(t,x,'r')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement