Advertisement
_ash__

Untitled

Oct 4th, 2020
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.10 KB | None | 0 0
  1. clc; close all; clear all;
  2. % initial data
  3. ang0 = 16.19; % initial angle
  4. del_t = 0.05; % time interval
  5. end_t = 5.0; % plot from [0, end_t]
  6. clear_t = 0.224; % fault clearing time
  7. K = 2.8125; % this parameter was changed due to frequency change
  8. % Necessary Equation: Pa = 1.6955 - 5.5023 * sin((ang - 0.755) in degree)
  9. % Data Generation:
  10. ang = [16.19]; % list of angles
  11. time = [0]; % list of time
  12. cur_time = 0;
  13. cur_del_ang = 0; % change of angle
  14. cur_ang = ang0;
  15. while (cur_time + del_t) <= end_t
  16.     cur_time = cur_time + del_t;
  17.     Pa = 0;
  18.     if cur_time - del_t < clear_t
  19.         Pa = 1.6955 - 5.5023 * sind(cur_ang - 0.755);
  20.         if(cur_time == del_t)
  21.             Pa = Pa * 0.5;
  22.         end
  23.     else
  24.         Pa = 1.6696 - 6.4934 * sind(cur_ang - 0.847);
  25.     end
  26.        
  27.     kPa = K * Pa;
  28.     cur_del_ang = cur_del_ang + kPa;
  29.     cur_ang = cur_ang + cur_del_ang;
  30.     time = [time; cur_time];
  31.     ang = [ang; cur_ang];
  32. end
  33. plot(time, ang, 'r.', time, ang, 'k');
  34. title('Swing Curve for machine 2');
  35. xlabel('t, seconds');
  36. ylabel('\delta, electrical degrees');
  37. ylim([0 22]);
  38. grid on;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement