Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. clear all;
  2. k4=5;
  3. k3=2;
  4. k2=9;
  5. k1=4;
  6. u0=k4;
  7. b = 2;
  8.  
  9. t0=0;
  10. du=0;
  11. x0=0;
  12. x10=0;
  13. xw=2.5;
  14. t=[0:0.1:15];
  15. xs1=0;
  16. xs2=(-63/4)*exp(-(4/9)*t);
  17. xs3=(-2.5)*exp(-(4/9)*t);
  18. xs4=(8.5)*exp(-(4/9)*t);
  19.  
  20. y1=0*t+xw;
  21. y2=(-63/4)*exp(-(4/9)*t)+xw;
  22. y3=(-2.5)*exp(-(4/9)*t)+xw;
  23. y4=(8.5)*exp(-(4/9)*t)+xw;
  24.  
  25. t=[0:0.1:15];
  26. figure(2);
  27. subplot(4,2,1);
  28. plot(t,y1,'*',t,xs1,'g',t,0*t+2.5,'r');
  29. title('Analitycznie x"(0) = 0 ');
  30. axis([0 15 -4 4])
  31. xlabel('t');
  32. ylabel('x(t)');
  33. grid on;
  34. legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
  35. x0 = xw;
  36. sim('symulacja.slx');
  37. subplot(4,2,2);
  38. plot(t,Sim_x1);
  39. title('Symulacyjnie x"(0) = 0 ');
  40. axis([0 15 -4 4])
  41. xlabel('t');
  42. ylabel('x(t)');
  43. grid on;
  44.  
  45. t=[0:0.1:15];
  46. figure(2);
  47. subplot(4,2,3);
  48. plot(t,y2,t,xs2,'g',t,0*t+2.5,'r')
  49. title('Analitycznie x"(0) = 7 ');
  50. axis([0 15 -4 4])
  51. xlabel('t');
  52. ylabel('x(t)');
  53. legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
  54. grid on;
  55. x0 = -(53/4);
  56. sim('symulacja.slx');
  57. subplot(4,2,4);
  58. plot(t,Sim_x1);
  59. title('Symulacyjnie x"(0) = 7 ');
  60. axis([0 15 -4 4])
  61. xlabel('t');
  62. ylabel('x(t)');
  63. grid on;
  64.  
  65. t=[0:0.1:15];
  66. figure(2);
  67. subplot(4,2,5);
  68. plot(t,y3,t,xs3,'g',t,0*t+2.5,'r',t,4);
  69. title('Analitycznie x(0) = 0 ');
  70. axis([0 15 -4 4])
  71. grid on;
  72. xlabel('t');
  73. ylabel('x(t)');
  74. legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
  75. x0 = 0;
  76. sim('symulacja.slx');
  77. subplot(4,2,6);
  78. plot(t,Sim_x1);
  79. title('Symulacyjnie x(0) = 0 ');
  80. axis([0 15 -4 4])
  81. xlabel('t');
  82. ylabel('x(t)');
  83. grid on;
  84.  
  85. t=[0:0.1:15];
  86. figure(2);
  87. subplot(4,2,7);
  88. plot(t,y4,t,xs4,'g',t,0*t+2.5,'r')
  89. title('Analitycznie x(0) = 11 ');
  90. axis([0 15 -4 4])
  91. grid on;
  92. xlabel('t');
  93. ylabel('x(t)');
  94. legend('Wykres','Składowa swobodna','Rozwiązanie wymuszone');
  95. x0 = 11;
  96. sim('symulacja.slx');
  97. subplot(4,2,8);
  98. plot(t,Sim_x1);
  99. title('Symulacyjnie x(0) = 11 ');
  100. axis([0 15 -4 4])
  101. xlabel('t');
  102. ylabel('x(t)');
  103. grid on;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement