power Load flow equations

7 vues (au cours des 30 derniers jours)
veekesh
veekesh le 18 Août 2024
Commenté : Umar le 25 Août 2024
constraints=[Costraints,Pg(1,1)-Pd(1,1)==vmag(1,1)*[vmag(1,1)*Ymag(1,1)*cos(Yang(1,1))+...
vmag(1,2)*Ymag(2,1)*cos(Yang(2,1) + vang(1,1) - vang(1,2))+...
vmag(1,3)*Ymag(3,1)*cos(Yang(3,1) + vang(1,1) - vang(1,3))+...
vmag(1,4)*Ymag(4,1)*cos(Yang(4,1) + vang(1,1) - vang(1,4))]; Constraints=[Costraints,Qg(1,1)-Qd(1,1)==(-vmag(1,1))*[vmag(1,1)*Ymag(1,1)*sin(Yang(1,1))+..
vmag(1,2)*Ymag(2,1)*sin(Yang(2,1) + vang(1,1) - vang(1,2))+...
vmag(1,3)*Ymag(3,1)*sin(Yang(3,1) + vang(1,1) - vang(1,3))+...
vmag(1,4)*Ymag(4,1)*sin(Yang(4,1) + vang(1,1) - vang(1,4))];
  7 commentaires
Torsten
Torsten le 23 Août 2024
Modifié(e) : Torsten le 23 Août 2024
Why do you always include pictures of your code and not the code itself ? Pictures are useless and have to be copied because they cannot be executed.
Umar
Umar le 25 Août 2024

Hi,

So, I implemented the code based on your header and code snippet provided by defining symbolic variables for voltage magnitudes (vmag1, vmag2, etc.), voltage angles (vang1, vang2, etc.), and power variables (Pg, Qg, Pd, Qd). The real and reactive power demands at bus 1 are set to 100 MW and 50 MVAR, respectively. The admittance matrix components are also defined with example values. Two power balance equations are formulated in which the first equation makes sure that the real power generated (Pg) equals the real power demand (Pd) plus the power losses in the system. The second equation does the same for reactive power. Afterwards, the solve function is called with the constraints and the list of variables to find the solution. Finally, the results are displayed, showing the generated power, reactive power, voltage magnitudes, and angles at each bus.

% Define symbolic variables
syms vmag1 vmag2 vmag3 vmag4 vang1 vang2 vang3 vang4 Pg Qg Pd Qd   
Qd1 Qd2 Qd3 Qd4 Ymag1 Ymag2 Ymag3 Ymag4 Yang1 Yang2 Yang3 Yang4
% Define known parameters (example values)
Pd = 100; % Real power demand at bus 1
Qd = 50;  % Reactive power demand at bus 1
% Admittance matrix components (example values)
Ymag = [0.5; 0.4; 0.3; 0.2]; % Magnitude of admittance
Yang = [30; 45; 60; 90];     % Angle of admittance in degrees
% Constraints
constraints = [
  Pg - Pd == vmag1 * (vmag1 * Ymag(1) * cosd(Yang(1)) + ...
                  vmag2 * Ymag(2) * cosd(Yang(2) + vang1) + ...
                  vmag3 * Ymag(3) * cosd(Yang(3) + vang1 + vang2) + ...
                  vmag4 * Ymag(4) * cosd(Yang(4) + vang1 + vang2 +                     vang3));
  Qg - Qd == -vmag1 * (vmag1 * Ymag(1) * sind(Yang(1)) + ...
                  vmag2 * Ymag(2) * sind(Yang(2) + vang1) + ...
                  vmag3 * Ymag(3) * sind(Yang(3) + vang1 + vang2) + ...
                  vmag4 * Ymag(4) * sind(Yang(4) + vang1 + vang2 +                     vang3));
];
% Solve equations
vars = [Pg, Qg, vmag1, vmag2, vmag3, vmag4, vang1, vang2, vang3, vang4];
sol = solve(constraints, vars);
% Display results
disp('Results:');
disp(['Pg: ', char(sol.Pg)]);
disp(['Qg: ', char(sol.Qg)]);
disp(['Voltage Magnitudes: ', num2str(double([sol.vmag1, sol.vmag2,     
sol.vmag3, sol.vmag4]))]);
disp(['Voltage Angles: ', num2str(double([sol.vang1, sol.vang2, 
sol.vang3,sol.vang4]))]);

Please see attached.

Please let us know if you have any further questions.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Word games dans Help Center et File Exchange

Produits


Version

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by