tsounakis

phasic diagram

Oct 28th, 2022
950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 2.51 KB | None | 0 0
  1. clc;
  2. clear;
  3. close all;
  4. figure()
  5. Lag = 45;
  6. V_a = plotVector(115.47, 0, [0 0], 'Voltage', 'E_1^A');
  7. V_b = plotVector(115.47, -120, [0 0], 'Voltage', 'E_1^B');
  8. V_c = plotVector(115.47, -240, [0 0], 'Voltage', 'E_1^C');
  9. V_a2 = plotVector(112.58, -V_a.Angle - Lag, [0 0], 'Current', 'E_2^A');
  10. V_b2 = plotVector(112.58, -V_b.Angle - Lag, [0 0], 'Current', 'E_2^B');
  11. V_c2 = plotVector(112.58, -V_c.Angle - Lag, [0 0], 'Current', 'E_2^C');
  12.  
  13. dummy_1 = plotVector(10, V_a.Angle-30-180, V_a.Head, 'Voltage', ' ');
  14. dummy_2 = plotVector(10, V_a.Angle+30-180, V_a.Head, 'Voltage', ' ');
  15. dummy_3 = plotVector(10, 90, V_b.Head, 'Voltage', ' ');
  16. dummy_4 = plotVector(10, 30, V_b.Head, 'Voltage', ' ');
  17. dummy_5 = plotVector(10, -30, V_c.Head, 'Voltage', ' ');
  18. dummy_6 = plotVector(10, -90, V_c.Head, 'Voltage', ' ');
  19. dummy_5 = plotVector(10, 100, V_a2.Head, 'Current', ' ');
  20. dummy_6 = plotVector(10, -190, V_a2.Head, 'Current', ' ');
  21. dummy_7 = plotVector(10, 45, V_b2.Head, 'Current', ' ');
  22. dummy_8 = plotVector(10, -15, V_b2.Head, 'Current', ' ');
  23. dummy_9 = plotVector(10, -70, V_c2.Head, 'Current', ' ');
  24. dummy_10 = plotVector(10, -140, V_c2.Head, 'Current', ' ');
  25.  
  26. showAngle(Lag, 25, 'black', 13, 5,  ...
  27.     ' ')
  28. hold on
  29. showAngle(120, 30, 'blue', -50, 35, ...
  30.     'phase')
  31.  
  32. title('Φασικό διάγραμμα');
  33. subtitle('3Φ τάσεις στα άκρα γραμμής με φορτίο R = 171.4Ω ');
  34. xlim([-150 150])
  35. ylim([-150 150])
  36. xlabel("Πραγματικός Άξονας");
  37. ylabel("Φανταστικός Άξονας (jω)");
  38.  
  39. function arrow = plotVector(length, angle, tail, type, name)
  40.     arrow = vector;
  41.     arrow.Angle = -angle;
  42.     arrow.Length = length;
  43.     arrow.Type = type;
  44.     arrow.Tail = tail;
  45.     arrow.Head = arrow.setHead();
  46.     arrow.Name = name;
  47.     arrow.vplot();
  48. end
  49.  
  50. function [] = showAngle (lag, r, col, posx, posy, pointer)
  51.     crcm = 2*pi*r;                                         % Arc Length Fraction Of Circumference
  52.     angfrac = deg2rad(lag);                                     % Angle Fraction Of Circumference (rad)
  53.     angv = linspace(deg2rad(45), deg2rad(45) + angfrac);                                % Angle Vector
  54.     x = r*cos(angv);
  55.     y = r*sin(angv);
  56.     plot(x, y, col, 'LineWidth', 0.5)
  57.     hold on
  58.     plot([0 0; 1 1]*x(1), [0 0; 1 1]*y(1), [0 0; 1 1]*x(end), [0 0; 1 1]*y(end), col, 'LineWidth', 0.5)
  59.     hold off
  60.     axis equal
  61.     axis([-150  150    -150  150])
  62.     text(posx, posy, sprintf('\\delta_{%s} = \\angle%2.f\\circ',pointer, rad2deg(angfrac)))
  63. end
Advertisement
Add Comment
Please, Sign In to add comment