Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. clear all; close all; clc;
  2. %parametry symulacji
  3. h=0.2;
  4. tu_max=40;
  5. ts_max=20;
  6. tan_min=0;
  7. tan_max=4;
  8. tan_step=h;
  9. %obiekt rzeczywisty (5 krotna inercja)
  10. loc=0.7;
  11. moc=conv(conv([1 2 1],[1 2 1]),[1 1]);
  12. %sterowanie
  13. tud=0:h:tu_max;
  14. Tn=40;
  15. Au=1;
  16. bn=0.5;
  17. fn=1/Tn;
  18. u=Au*sin(2*pi*fn*tud);
  19. % amplituda szumu pomiarowego
  20. An=0.6;
  21. %odp identyfikacyjna
  22. ys=lsim(loc,moc,u,tnd)+ An*randn(size(tnd));
  23. %identyfikacja MNK
  24. n_min=ceil(tan_min/h);
  25. n_max=floor(tan_max/h);
  26. n_Step=ceil(tan_step/h);
  27.  
  28. nn=n_min:n_step:n_max;
  29. J_opt=inf;
  30. Ji=zeros(size(nn));
  31. i=1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement