Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.96 KB | None | 0 0
  1. Dir = "C:\Users\gmone\Documents\Faculdade\Automação e controle"
  2. //função que corresponde a curva do sistema
  3. function A=ce(t)
  4.     A=(-%e**-t)*(cos(sqrt(15)*t)) - (1/sqrt(15)) * (%e**-t)*sin(sqrt(15)*t)+1
  5. endfunction
  6.  
  7. function A1=cm(t)
  8.     A1=18.76 *((-0.0315639 +0.011773*%i) * (%e**((-1.87724-3.52027*%i) * t)) * ((0.755722 + 0.654893*%i)+ (1) * (%e**((7.04053*%i) * t))) + 0.00983607 * %e**(-362082 * t) + 0.0532917)
  9. endfunction
  10.  
  11. t=0
  12. i=0
  13.  
  14. clear B
  15. clear C
  16. clear T
  17.  
  18. while t<=8
  19.     i=i+1
  20.     t=t+0.1
  21.     B(i) = ce(t);
  22.     C(i) = cm(t);
  23.     T(i)= t;
  24. end
  25.  
  26. subplot(2,2,1)
  27. xtitle( 'Função da questão E', 'T', 'c(t)');
  28. plot2d(T,B,[2]);
  29.  
  30. subplot(2,2,2)
  31. xtitle( 'Função da questão M', 'T', 'c(t)');
  32. plot2d(T,C,[5]);
  33.  
  34. subplot(2,1,2)
  35. xtitle( 'Função da questão E e M sobrepostas', 'T', 'c(t)');
  36. plot2d(T,B,[2]);
  37. plot2d(T,C,[5]);
  38. h1=legend(['função da E';'função da M']);
  39.  
  40. //Exportar graficos
  41. xs2png(gcf(),Dir +"\Segundo Teste.png");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement