Advertisement
olucao

Algoritmo para obtenção de respostas a determinadas entradas

Apr 25th, 2019
2,452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.94 KB | None | 0 0
  1. s = poly(0,'s')
  2.  
  3. function createGraphResponse(zeta, wn, K, p, PO, inputType, figureIndex, titleGraph, beginInterval, stepInterval, endInterval)
  4.  
  5.     s11= -zeta*wn+%i*wn*sqrt(1-zeta^2);
  6.     num = K;
  7.     den=s^2+p*s+K;
  8.     g=num/den;
  9.     g=syslin('c',g);
  10.    
  11.     t=beginInterval:stepInterval:endInterval;
  12.     figure(figureIndex);
  13.     plot(t,csim(inputType,t,g));
  14.     xgrid;
  15.     title(titleGraph, "fontsize",4);
  16.  
  17.     ylabel("Amplitude", "fontsize", 3);
  18.     xlabel("Tempo (s)", "fontsize", 3);
  19.    
  20.     colordef('white');
  21.    
  22. endfunction
  23.  
  24.  
  25. //Exercicio 8
  26. createGraphResponse(0.733779,1.362808148,1.857246048,2,3.36,'step',0,"Resposta ao Degrau Unitário - Zeta 0.73",0,0.0001,10);
  27.  
  28. //Exercicio 9
  29. createGraphResponse(0.4,2.5,6.25,2,3.36,'step',1, "Resposta ao Degrau Unitário - Zeta 0.4",0,0.0001,10);
  30.  
  31. //Exercicio 10
  32. createGraphResponse(0.9,1.111,1.234321,1.998,3.36,'step',2, "Resposta ao Degrau Unitário - Zeta 0.9",0,0.0001,10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement