Advertisement
SS_B-Rabbit

MSEI 4

Mar 31st, 2020
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.47 KB | None | 0 0
  1. nblocks = 6;
  2. n1 = 1;
  3. d1 = 1;
  4. n2 = 3;
  5. d2 = 1;
  6. n3 = [5*8 5];
  7. d3= [8 0];
  8. n4 = 5;
  9. d4 = [8 10 3];
  10. n5 = 3;
  11. d5 = 1;
  12. n6 = 1;
  13. d6 = 1;
  14. blkbuild;
  15. q=[ 1 0 0;2 1 0;3 2 -5;4 3 6;5 4 0;6 0 0];
  16. iu = [1 6];
  17. iy = 4;
  18. [A, B, C, D] = connect(a, b, c, d, q, iu, iy);
  19. [Am, Bm, Cm, Dm] = minreal(A, B, C, D);
  20. t = 0.1:0.1:40;
  21. r = ones(length(t), 1);
  22. p = [ones(length(0.1:0.1:3),1) ; zeros(length(3:0.1:40)-1,1)];
  23. y = lsim(Am, Bm, Cm, Dm, [r p], t);
  24. plot(t, p, 'b--', t, r,'b:', t, y, 'b')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement