Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.82 KB | None | 0 0
  1. %%                                     Trabalho prático 7
  2. clear;clc;
  3. % alínea b
  4. Km = 10;
  5. Kg = 0.2;
  6. Ra = 2;
  7. La = 2;
  8. D = 1;
  9. Jm = 10;
  10. Jl = 5;
  11. Jeq = Jl + Jm;
  12. %variaveis de tempo e frequencia
  13. fa = 20;                        %frequencia de amostragem
  14. V = 10;                         %tensão aplicada
  15. ts = 100;                       %simular durante 100seg
  16. %ganho
  17. s = tf('s');
  18. G=(Km*(60/(2*pi)))/(((Jeq*s)+D)*(La*s+Ra)+(Km*Kg));
  19. %criar vetor dos tempos e aplicar step
  20. time = 1:(1/fa):ts;
  21. step(G*V,time)
  22. ylabel('Velocity/rpm')
  23. xlabel('time/s')
  24. hold on
  25. % calcular pólos
  26. %[num,den]=tfdata(G,'v')
  27. %roots(den)
  28.  
  29. %alinea c
  30. Jeq2=30;
  31. G2=(Km*(60/(2*pi)))/(((Jeq2*s)+D)*(La*s+Ra)+(Km*Kg));
  32. step(G2*V,time)
  33. ylabel('Velocity/rpm')
  34. xlabel('time/s')
  35.  
  36. %alinea d
  37. for Va = 0.5:0.5:10
  38.     step(G*Va,time)
  39.     hold on
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement