Advertisement
ulises114

Untitled

May 1st, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.81 KB | None | 0 0
  1. %Datos acontrol=35
  2. datos=load('datosvel35.txt');
  3. figure
  4. tiempo=0:0.05:4.95;
  5. plot(tiempo,datos(:,1))
  6. hold
  7. stairs(tiempo,datos(:,2))
  8. title('Datos velocidad con acción de control 35')
  9. xlabel('Tiempo(s)')
  10. ylabel('Velocidad angular(rad/s)')
  11. legend('Velocidad angular','Acción de control')
  12. %En un segundo hemos medido 30 veces y quedan 70, la media de estos 70
  13. %valores restantes es K
  14. %El valor más próximo a 0.632*K se da en tau
  15. k35=(mean(datos(31:100,1))-mean(datos(1:19,1)))/(datos(100,2)-datos(1,2))
  16. tau35=MasCercano(datos, k35)
  17.  
  18.  
  19. %Datos acontrol=50
  20. datos=load('datosvel50.txt');
  21. figure
  22. tiempo=0:0.05:4.95;
  23. plot(tiempo,datos(:,1))
  24. hold
  25. stairs(tiempo,datos(:,2))
  26. title('Datos velocidad con acción de control 50')
  27. xlabel('Tiempo(s)')
  28. ylabel('Velocidad angular(rad/s)')
  29. legend('Velocidad angular','Acción de control')
  30. k50=(mean(datos(31:100,1))-mean(datos(1:19,1)))/(datos(100,2)-datos(1,2))
  31. tau50=MasCercano(datos, k50)
  32.  
  33. %Datos acontrol=80
  34. datos=load('datosvel80.txt');
  35. figure
  36. tiempo=0:0.05:4.95;
  37. plot(tiempo,datos(:,1))
  38. hold
  39. stairs(tiempo,datos(:,2))
  40. title('Datos velocidad con acción de control 80')
  41. xlabel('Tiempo(s)')
  42. ylabel('Velocidad angular(rad/s)')
  43. legend('Velocidad angular','Acción de control')
  44. k80=(mean(datos(31:100,1))-mean(datos(1:19,1)))/(datos(100,2)-datos(1,2))
  45. tau80=MasCercano(datos, k80)
  46.  
  47. %Datos acontrol=-40
  48. datos=load('datosvel-40.txt');
  49. figure
  50. tiempo=0:0.05:4.95;
  51. plot(tiempo,datos(:,1))
  52. hold
  53. stairs(tiempo,datos(:,2))
  54. title('Datos velocidad con acción de control -40')
  55. xlabel('Tiempo(s)')
  56. ylabel('Velocidad angular(rad/s)')
  57. legend('Velocidad angular','Acción de control')
  58. kmenos40=(mean(datos(31:100,1))-mean(datos(1:19,1)))/(datos(100,2)-datos(1,2))
  59. taumenos40=MasCercano(datos, kmenos40)
  60.  
  61. kmedia=(k35+k50+k80+kmenos40)/4
  62. taumedia=(tau35+tau50+tau80+taumenos40)/4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement