SHARE
TWEET

Untitled

a guest Nov 19th, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a1 = 2;
  2. a2 = 4;
  3. a3 = 2;
  4. b = 6;
  5. k = 0.1;
  6. Ti = 0.496;
  7. Tdp = 0.1;
  8. Tdl = 10;
  9. L = 100;
  10. d = (Tdl-Tdp)/L;
  11. W2 = zeros(L,2);
  12. Td = Tdp;
  13. for i=1:L
  14.  sim('lab3_P',100);
  15.  e = simout1.data;
  16.  t = simout1.time;
  17.  einf = mean(e(end-10:end));
  18.  ep1 = e - einf;
  19.  ep2 = ep1.^2;
  20.  tep2 = t.*ep2;
  21.  Q = trapz(t,tep2);
  22.  W2(i,1) = Td;
  23.  W2(i,2) = Q;
  24.  Td = Td + d;
  25. end
  26. qmin = min(W2(:,2));
  27. Val2 = W2(:,2);
  28. ind2 = find(Val2==qmin);
  29. Td = W2(ind2,1);
  30. sim('lab3_P',1000);
  31. plot(simout1);
  32. disp(Td);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top