Вы находитесь на странице: 1из 13

PROYECTO

Datos de la red:

1
Análisis de falla monofásica

-----------------------------------------------------------------------------------------------------------------------------------

| | | DIgSILENT | Project: |

| | | PowerFactory |-------------------------------

| | | 15.1.7 | Date: 8/2/2017 |

-----------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------

| Fault Locations with Feeders |

| Short-Circuit Calculation / Method : VDE 0102 3-Phase Short-Circuit / Max. Short-Circuit


Currents |

-----------------------------------------------------------------------------------------------------------------------------------

| Asynchronous Motors | Grid Identification | Short-Circuit Duration |

2
| Always Considered | Automatic | Break Time 0,10 s |

| | | Fault Clearing Time (Ith) 1,00 s |

| Decaying Aperiodic Component (idc) | Conductor Temperature | c-Voltage Factor


|

| Using Method B | User Defined No | User Defined No |

| | | |

-----------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------

| Grid: Nine_Bus System Stage: Nine_Bus | | Annex: /1 |

-----------------------------------------------------------------------------------------------------------------------------------

| rtd.V. Voltage c- Sk" Ik" ip Ib Sb Ik Ith |

| [kV] [kV] [deg] Factor [MVA/MVA] [kA/kA] [deg] [kA/kA] [kA] [MVA] [kA] [kA] |

-----------------------------------------------------------------------------------------------------------------------------------

| |

|Bus 1 16,50 0,00 0,00 1,10 1629,33 MVA 57,01 kA -86,51 147,98 kA 46,90 1340,32 57,01
58,32 |

| T1 Bus 4 393,68 MVA 13,78 kA 95,46 35,76 kA |

| G1 1235,96 MVA 43,25 kA -87,14 112,25 kA |

| |

|Bus 2 18,00 0,00 0,00 1,10 1488,65 MVA 47,75 kA -87,82 124,86 kA 39,00 1216,01 47,75
48,95 |

| T2 Bus 7 428,16 MVA 13,73 kA 94,03 35,91 kA |

| G2 1060,81 MVA 34,03 kA -88,57 88,97 kA |

| |

|Bus 3 13,80 0,00 0,00 1,10 1156,02 MVA 48,36 kA -86,54 125,58 kA 40,79 974,90 48,36
49,48 |

| T3 Bus 9 449,57 MVA 18,81 kA 94,39 48,84 kA |

| G3 706,55 MVA 29,56 kA -87,14 76,75 kA |

3
| |

|Bus 4 230,00 0,00 0,00 1,10 1216,17 MVA 3,05 kA -86,21 7,88 kA 2,95 1175,29 3,05
3,12 |

| T1 Bus 1 722,19 MVA 1,81 kA 91,67 4,68 kA |

| Line 1 Bus 5 260,59 MVA 0,65 kA 95,93 1,69 kA |

| Line 6 Bus 6 234,66 MVA 0,59 kA 97,92 1,52 kA |

| |

|Bus 5 230,00 0,00 0,00 1,10 898,73 MVA 2,26 kA -84,69 5,61 kA 2,26 898,73 2,26
2,29 |

| Line 1 Bus 4 528,86 MVA 1,33 kA 94,24 3,30 kA |

| Line 2 Bus 7 370,09 MVA 0,93 kA 96,86 2,31 kA |

| |

|Bus 6 230,00 0,00 0,00 1,10 854,99 MVA 2,15 kA -83,28 5,18 kA 2,15 854,99 2,15
2,17 |

| Line 5 Bus 9 338,26 MVA 0,85 kA 97,98 2,05 kA |

| Line 6 Bus 4 516,87 MVA 1,30 kA 95,89 3,13 kA |

| |

|Bus 7 230,00 0,00 0,00 1,10 1227,43 MVA 3,08 kA -87,07 8,02 kA 2,93 1167,89 3,08
3,15 |

| Line 2 Bus 5 258,53 MVA 0,65 kA 96,46 1,69 kA |

| T2 Bus 2 663,13 MVA 1,66 kA 90,90 4,33 kA |

| Line 3 Bus 8 306,77 MVA 0,77 kA 94,37 2,01 kA |

-----------------------------------------------------------------------------------------------------------------------------------

4
-----------------------------------------------------------------------------------------------------------------------------------

| Grid: Nine_Bus System Stage: Nine_Bus | | Annex: /2 |

-----------------------------------------------------------------------------------------------------------------------------------

| rtd.V. Voltage c- Sk" Ik" ip Ib Sb Ik Ith |

| [kV] [kV] [deg] Factor [MVA/MVA] [kA/kA] [deg] [kA/kA] [kA] [MVA] [kA] [kA] |

-----------------------------------------------------------------------------------------------------------------------------------

| |

|Bus 8 230,00 0,00 0,00 1,10 978,18 MVA 2,46 kA -85,91 6,26 kA 2,43 967,23 2,46
2,50 |

| Line 3 Bus 7 553,56 MVA 1,39 kA 93,67 3,54 kA |

| Line 4 Bus 9 424,65 MVA 1,07 kA 94,63 2,72 kA |

| |

|Bus 9 230,00 0,00 0,00 1,10 1104,01 MVA 2,77 kA -85,95 7,10 kA 2,60 1036,42 2,77
2,83 |

| Line 4 Bus 8 339,97 MVA 0,85 kA 93,85 2,19 kA |

| T3 Bus 3 514,14 MVA 1,29 kA 92,08 3,31 kA |

| Line 5 Bus 6 250,92 MVA 0,63 kA 98,37 1,61 kA |

|Line 2 |

| Fault 230,00 0,00 0,00 1,10 1118,16 MVA 2,81 kA -86,10 7,16 kA 2,72 1084,28 2,81
2,86 |

| Line 2a Bus 7 840,90 MVA 2,11 kA 93,10 5,38 kA |

| Line 2b Bus 5 277,60 MVA 0,70 kA 96,34 1,78 kA |

-----------------------------------------------------------------------------------------------------------------------------------

5
% function varargout = % This function has no output args, see
SEP_TrabajoB_Moya(varargin) OutputFcn.
% SEP_TrabajoB_Moya-file for % hObject handle to figure
Proyecto_Flujos_NR.fig % eventdata reserved - to be defined in a
% PROYECTO_FLUJOS_NR, by itself, creates a future version of MATLAB
new PROYECTO_FLUJOS_NR or raises the existing % handles structure with handles and user
% singleton*. data (see GUIDATA)
% % varargin command line arguments to
% H = SEP_TrabajoB_Moya returns the handle Proyecto_Flujos_NR (see VARARGIN)
to a new PROYECTO_FLUJOS_NR or the handle to
% the existing singleton*. % Choose default command line output for
% Proyecto_Flujos_NR
% handles.output = hObject;
SEP_TrabajoB_Moya('CALLBACK',hObject,eventData,h
andles,...) calls the local
% Update handles structure
% function named CALLBACK in
guidata(hObject, handles);
PROYECTO_FLUJOS_NR.M with the given input
arguments.
% % UIWAIT makes Proyecto_Flujos_NR wait for user
% SEP_TrabajoB_Moya('Property','Value',...) response (see UIRESUME)
creates a new PROYECTO_FLUJOS_NR or raises the % uiwait(handles.figure1);
% existing singleton*. Starting from the
left, property value pairs are
% applied to the GUI before % --- Outputs from this function are returned to
Proyecto_Flujos_NR_OpeningFcn gets called. An the command line.
% unrecognized property name or invalid function varargout =
value makes property application SEP_TrabajoB_MoyaFcn(hObject, eventdata,
% stop. All inputs are passed to handles)
Proyecto_Flujos_NR_OpeningFcn via varargin. % varargout cell array for returning output
% args (see VARARGOUT);
% *See GUI Options on GUIDE's Tools menu. % hObject handle to figure
Choose "GUI allows only one % eventdata reserved - to be defined in a
% instance to run (singleton)". future version of MATLAB
% % handles structure with handles and user
% See also: GUIDE, GUIDATA, GUIHANDLES data (see GUIDATA)

% Edit the above text to modify the response to % Get default command line output from handles
help Proyecto_Flujos_NR structure
varargout{1} = handles.output;
% Last Modified by GUIDE v2.5 22-06-2017
23:51:00
% --- Executes on button press in pushbutton3.
% Begin initialization code - DO NOT EDIT function pushbutton3_Callback(hObject,
gui_Singleton = 1; eventdata, handles)
gui_State = struct('gui_Name', mfilename,
...
'gui_Singleton',
gui_Singleton, ... % CÓDIGO DEL PROGRAMA %
'gui_OpeningFcn',
@SEP_TrabajoB_Moya_OpeningFcn, ...
'gui_OutputFcn', %-----------------------------------------------
@SEP_TrabajoB_MoyaFcn, ... ---------------------------
'gui_LayoutFcn', [] , ... %Datos
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback =
str2func(varargin{1});
end clc,clear

if nargout datos_lineas=xlsread('datos_lineas_SEP.xlsx');
[varargout{1:nargout}] = format long
gui_mainfcn(gui_State, varargin{:}); b_salida = datos_lineas(:,1); %
else Matriz de Barras de Inicio
gui_mainfcn(gui_State, varargin{:}); b_llegada = datos_lineas(:,2); %
end Matriz de Barras de Destino
% End initialization code - DO NOT EDIT R = datos_lineas(:,3); %
Resistencia, R
X = datos_lineas(:,4) ; %
Reactancia, X
% --- Executes just before Proyecto_Flujos_NR is B1 = datos_lineas(:,5) ; %
made visible. Susceptancia B/2
function SEP_TrabajoB_Moya_OpeningFcn(hObject, g_cte = datos_lineas(:,6);
eventdata, handles, varargin) b_cte = datos_lineas(:,7);
i=sqrt(-1);

6
num_lin_traf = length(b_salida);
%----------------------------------------------- % Número de líneas mas trafos
------------------------------------------------ num_lin=num_lin_traf= 47
------------------------------------------------ Y = zeros(num_barr, num_barr);
----------- % Creación de Y de barra llena de zeros
disp(' ESCUELA
POLITECNICA NACIONAL '); % Formación de los elementos fuera de la
diagonal %PREFALLA
disp(' ESTUDIO DE for k = 1:num_lin_traf
ESTABILIDAD TRANSITORIA '); Y(b_salida(k),b_llegada(k)) = -
disp(' y(k);
'); Y(b_llegada(k),b_salida(k)) =
disp(' Y(b_salida(k),b_llegada(k));
'); end
disp(' BYRON MOYA
'); % Formación de los elementos de la diagonal
disp(' principal
'); for m = 1:num_barr
disp(' LA FALLA SE PRODUCE for n = 1:num_lin_traf
CERCA DE LA BARRA #6 '); if b_salida(n) == m
disp(' Y(m,m) = Y(m,m) + y(n) + y_2(n)
'); + car_cte (n) ; %En el
disp(' INGRESE LOS DATOS exel la linea de salida tiene los datos de
NECESARIOS PARA EL ANALISIS' ); potencia
disp('
'); elseif b_llegada(n) == m
barra_cc = 8; Y(m,m) = Y(m,m) + y(n) + y_2(n);
%barra donde se produce el cortocircuito end;
ext_line = 4; end;
%extremo de la linea afectada por el end;
cortocircuito %---------------------------------------------
num_gen =3; ------------------------------------------------
%numero de los generadores ------------------------------------------------
--------
time = input('Ingrese el tiempo de %matriz en condiciones de:
análisis: '); prefalla,falla,posfalla
time_pre = input('Ingrese el tiempo
en que ocurre de falla: '); YBpre=Y;
tdespeje = input('Ingrese el tiempo %matriz y de barra en condicion de prefalla
de despeja la falla: ');
dt = input('Ingrese el delta t: '); %se exporta la matriz a una hoja de exel
disp('
');
disp('NOTA: ');
disp('ESCRIBA 0(cero)SI NO EXISTE YBfa=YBpre;
RECONEXION'); YBfa(:,barra_cc)=[];
disp(' YBfa(barra_cc,:)=[];
'); YBfalla=YBfa;
treconexion = input('Ingrese el %matriz y de barra en condicion de falla
tiempo de reconexión: '); YBfalla;
reg_velo = input('\nExiste regulador
de velocidad \n 1:SI \n0:NO : '); %formacion de los elementos fuera de la
reg_volt = input('\nExiste regulador diagonal
de voltaje \n 1:SI \n0:NO : '); YBpos = Y;
disp(' %formacion de la matriz en condiciones de
'); posfalla
%----------------------------------------------- for m=1:1:num_lin_traf;
------------------------------------------------ YBpos(barra_cc,ext_line) =
------------------------------------------------ -(Y(barra_cc,ext_line)/2);
---------- %Se quita la linea donde se produjo el
%Cálculos previo a la matriz y de barra cortocircuito
z = R + i*X; YBpos(ext_line,barra_cc) =
% Matriz de impedancias Z (lineas y trafos) 1 YBpos(barra_cc,ext_line);
sóla columna %en los elementos y(a,b) y y(b,a)
car_cte = g_cte + i*b_cte; end;
% potencia de las barras con carga
y = 1./z; % Formación de los elementos de la diagonal
% admitancias(lineas y trafos) 1 sóla columna principal
y_2 = i*B1; for m=1:1:num_lin_traf;
% y/2 en paralelo % Formación de los elementos de la diagonal
num_barr = principal
max(max(b_salida),max(b_llegada)); if barra_cc == b_salida(m) &&
%valor maximo de las barras del sistema= 34 ext_line == b_llegada(m);

7
YBpos(barra_cc,barra_cc) = end;
YBpos(barra_cc,barra_cc) - %para la matriz reducida de falla hasta
YBpos(barra_cc,ext_line) - (1/2)*y_2(m); %Se aqui el num_barr esta en menos 1
resta y en paralelo %----------------------------------------------
YBpos(ext_line,ext_line) = ------------------------------------------------
YBpos(ext_line,ext_line) - ------------------------------------------------
YBpos(barra_cc,ext_line) - (1/2)*y_2(m); ------------
%calculo de la potencia electrica, del E de
elseif barra_cc == b_llegada(m) && cada uno de los generadores
ext_line == b_salida(m);
YBpos(barra_cc,barra_cc) = datos=xlsread('datos_generadores_flujo.xlsx');
YBpos(barra_cc,barra_cc) - datos3=datos;
YBpos(barra_cc,ext_line) - (1/2)*y_2(m); % HH=datos(:,1);
sólo se afecta a los elementos de la diagonal Pmm=datos(:,2);
que iniciden el c.c. n=num_gen; H=HH'; Pm=Pmm'; Pm1=Pmm';
YBpos(ext_line,ext_line) = format long
YBpos(ext_line,ext_line) - datos3(:,1:3)=[];
YBpos(barra_cc,ext_line) - (1/2)*y_2(m); TVPQ=datos3;
end; Xd=datos(:,3);
end;
YBpos; for h=1:1:num_gen;
%--------------------------------------------- % depende del NUMERO DE GEN
------------------------------------------------
------------------------------------------------ E(h)=TVPQ(h,2)*(cos(TVPQ(h,1)*(pi/180))+i*sin(TV
------------- PQ(h,1)*(pi/180)))+i*Xd(h)*((TVPQ(h,3)-
%Reduccion de matrices YB reducidas i*TVPQ(h,4))/(TVPQ(h,2)*(cos(TVPQ(h,1)*(pi/180))
for k=1:1:3; +i*sin(-TVPQ(h,1)*(pi/180)))));
if k==1;
YBpre11=YBpre; [delt(h),Ei(h)]=cart2pol(real(E(h)),imag(E(h)));
%condiciones iniciales
elseif k==2; end;
YBpre11=YBpos; delta=delt*(180/pi);
Ei;
Ei_ini=Ei;
else
%Condición inicial de Ei
num_barr=num_barr-1;
YBpre11=YBfa;
end; Gij=real(YBpre_red);
%Demostración: Pe prefalla = Pm prefalla
Bij=imag(YBpre_red);
YB_nn=YBpre11;
YB_nn(:,num_gen+1:num_barr)=[];
YB_nn(num_gen+1:num_barr,:)=[]; for h=1:1:num_gen;
cte1=0;
for k=1:1:num_gen;
YB_nr=YBpre11;
Pe(h)=cte1+(Gij(h,k)*cos(delt(h)-
YB_nr(:,1:num_gen)=[];
delt(k))+ Bij(h,k)*sin(delt(h)-delt(k)))*Ei(k);
YB_nr(num_gen+1:num_barr,:)=[];
cte1=Pe(h);
end;
YB_rn=YBpre11; Pei(h)=Pe(h)*Ei(h);
YB_rn(:,num_gen+1:num_barr)=[]; end;
YB_rn(1:num_gen,:)=[];
%--------------------------------------------
YB_rr=YBpre11; ------------------------------------------------
YB_rr(:,1:num_gen)=[]; ------------------------------------------------
YB_rr(1:num_gen,:)=[]; ------------
tiempo_analizar = time/dt;
if k==1; %obtengo el NUM. de veces q repetirá Rungge
YBpre_red=YB_nn - Kutta
YB_nr*inv(YB_rr)*YB_rn; tpre = time_pre/dt;
%matriz reducida de prefalla for w=1:1:num_gen;
%condiciones iniciales de velocidad sincronica=
elseif k==2; 377
YBpos_red=YB_nn - wsinc(w)=120*pi;
YB_nr*inv(YB_rr)*YB_rn; end;
%matriz reducida de posfalla wref=120*pi;
%wref=377
else
YBfa_red=YB_nn - %--------------------------------------------
YB_nr*inv(YB_rr)*YB_rn ; ------------------------------------------------
%matriz reducida de falla ------------------------------------------------
------------
%condicion inicial para reg de voltaje
end;
V=TVPQ(:,2);
Vi=V';

8
teta=TVPQ(:,1); for h=1:1:n;
tetai=teta'; w_pm1(h)=wsinc(h) +
%---------------------------------------------- mm1_w(h)*(dt/2);
------------------------------------------------ d_pm1(h)=delt(h)+
------------------------------------------------ mm1_d(h)*(dt/2);
------------ deltaPm_pm1(h)= deltaPm(h) +
%Condiciones iniciales para el reg de mm1_deltaPm(h)*(dt/2);
velocidad deltaE_pm1(h)= deltaE(h) +
for w=1:1:num_gen; mm1_deltaE(h)*(dt/2);
deltaPm(w)=0;
deltaE(w)=0; %----------------------------------------------
%condicion inicial para reg de voltaje ------------------------------------------------
Vref(w)= Vi(w); ------------------------------------------------
end; -------
km=4; Tm=0.15;
ke=0.1; Te=0.01;
if reg_volt == 0 ;
%---------------------------------------------
Ei(h)=Ei_ini(h);
------------------------------------------------
------------------------------------------------
------------ %condicion regulador de velocidad
%metodo de runge kutta 4to orden elseif reg_volt == 1 && t>tpre;
Ei(h)=Ei(h) +
deltaE_pm1(h);
for t=1:1:tiempo_analizar;
%Rungge Kutta
format long for h=1:1:n;
if t<=tpre; cte1=0;
%condiciones de prefalla for k=1:1:n;
Gij=real(YBpre_red);
Bij=imag(YBpre_red); Pe(h)=cte1+((Gij(h,k))*cos(d_pm1(h)-
elseif (t>tpre && t<=tdespeje/dt); d_pm1(k))+(Bij(h,k))*sin(d_pm1(h)-
%condiciones de falla d_pm1(k)))*Ei(k);
Gij=real(YBfa_red); cte1=Pe(h);
Bij=imag(YBfa_red); end;
end; Pelect(h)= Pe(h)*Ei(h);
if treconexion==0;
%no hay reconexion condiciones de posfalla for k=1:1:n;
if (t>tdespeje/dt &&
tdespeje/dt~=0) ; Qe(h)=cte1+((Gij(h,k))*sin(d_pm1(h)-d_pm1(k))-
Gij=real(YBpos_red); (Bij(h,k))*cos(d_pm1(h)-d_pm1(k)))*Ei(k);
Bij=imag(YBpos_red); cte1=Qe(h);
end; end;
else Qelect(h)= Qe(h)*Ei(h);
% hay reconexion
if (t>tdespeje/dt && Vii(h)= Ei(h)*(cos(d_pm1(h)-
t<=treconexion/dt) ; %posfalla d_pm1(k))+i*sin(d_pm1(h)-d_pm1(k))) -
Gij=real(YBpos_red); i*Xd(h)*(Pelect(h)-
Bij=imag(YBpos_red); i*Qelect(h))/(Vi(h)*(cos(tetai(h))+i*sin(tetai(h
elseif t>treconexion/dt; ))));
%prefalla
Gij=real(YBpre_red); [tet(h),Vi(h)]=cart2pol(real(Vii(h)),imag(Vii(h)
Bij=imag(YBpre_red); ));
end; end;
end; end;
%potencia electrica condiciones iniciales Ei(h);
for h=1:1:n; end
cte1=0;
for k=1:1:n;

Pe(h)=cte1+((Gij(h,k))*cos(delt(h)- %----------------------------------------------
delt(k))+(Bij(h,k))*sin(delt(h)-delt(k)))*Ei(k); ---------------------------
cte1=Pe(h);
end; %Primer grupo de pendientes en el punto medio m2
%pendientes m1 for h=1:1:n;
mm1_w(h)=(Pm(h)- cte1=0;
Pe(h)*Ei(h))*(120*pi/(2*H(h))); % a t=0 for k=1:1:n;
mm1_d(h)=wsinc(h)-120*pi;
mm1_deltaPm(h)= - Pe(h)=cte1+((Gij(h,k))*cos(d_pm1(h)-
(deltaPm(h)/Tm)+(km/Tm)*(wref-wsinc(h)); d_pm1(k))+(Bij(h,k))*sin(d_pm1(h)-
mm1_deltaE(h)= - d_pm1(k)))*Ei(k);
(deltaE(h)/Te)+(ke/Te)*(Vref(h)-Vi(h)); cte1=Pe(h);
end; end;
%Primera prediccion de y en la mitad del
intervalo t=dt/2

9
mm2_w(h)=(Pm(h)-
Pe(h)*Ei(h))*(120*pi/(2*H(h))); %-----------------------------------------------
mm2_d(h)=w_pm1(h)-120*pi; ------------------------------------------------
mm2_deltaPm(h)= - ------------------------------------------------
(deltaPm_pm1(h)/Tm)+(km/Tm)*(wref-w_pm1(h)); ----
mm2_deltaE(h)= -
(deltaE_pm1(h)/Te)+(ke/Te)*(Vref(h)-Vi(h));
end;
%Segundo grupo de pendientes en el punto medio
m3
%segunda prediccion de y en el punto medio
t=dt/2
for h=1:1:n; for h=1:1:n;
w_pm2(h)=wsinc(h) +
mm2_w(h)*(dt/2);
d_pm2(h)=delt(h)+
mm2_d(h)*(dt/2);
cte1=0;
deltaPm_pm2(h)= deltaPm(h) +
for k=1:1:n;
mm2_deltaPm(h)*(dt/2);
deltaE_pm2(h)= deltaE(h) +
Pe(h)=cte1+((Gij(h,k))*cos(d_pm2(h)-
mm2_deltaE(h)*(dt/2);
d_pm2(k))+(Bij(h,k))*sin(d_pm2(h)-
d_pm2(k)))*Ei(k);
cte1=Pe(h);
%------------------------------------------- end;
------------------------------------------------ mm3_w(h)=(Pm(h)-
--------------------------- Pe(h)*Ei(h))*(120*pi/(2*H(h)));
if reg_volt == 0 ; mm3_d(h)=w_pm2(h)-120*pi;
Ei(h)=Ei_ini(h); mm3_deltaPm(h)= -
(deltaPm_pm2(h)/Tm)+(km/Tm)*(wref-w_pm2(h));
%condicion regulador de velocidad mm3_deltaE(h)= -
elseif reg_volt == 1 && t>tpre; (deltaE_pm2(h)/Te)+(ke/Te)*(Vref(h)-Vi(h));
Ei(h)=Ei(h) + end;
deltaE_pm2(h);
%prediccion al final del intervalo dt
for h=1:1:n; for h=1:1:n;
cte1=0; w_final(h)=wsinc(h)+
for k=1:1:n; mm3_w(h)*dt;
d_final(h)=delt(h)+ mm3_d(h)*dt;
Pe(h)=cte1+((Gij(h,k))*cos( deltaE_pm2(h)- deltaPm_pm3(h)= deltaPm(h) +
deltaE_pm2(k))+(Bij(h,k))*sin( deltaE_pm2(h)- mm3_deltaPm(h)*(dt);
deltaE_pm2(k)))*Ei(k); deltaE_pm3(h)= deltaE(h) +
cte1=Pe(h); mm3_deltaE(h)*(dt/2);
end;
Pelect(h)= Pe(h)*Ei(h); %--------------------------------------------
------------------------------------------------
for k=1:1:n; ------------------------------

Qe(h)=cte1+((Gij(h,k))*sin( deltaE_pm2(h)- if reg_volt == 0 ;


deltaE_pm2(k))-(Bij(h,k))*cos( deltaE_pm2(h)- Ei(h)=Ei_ini(h);
deltaE_pm2(k)))*Ei(k);
cte1=Qe(h); %condicion regulador de velocidad
end; elseif reg_volt == 1 && t>tpre;
Qelect(h)= Qe(h)*Ei(h); Ei(h)=Ei(h) +
deltaE_pm3(h);
Vii(h)= Ei(h)*(cos(
deltaE_pm2(h)- deltaE_pm2(k))+i*sin( for h=1:1:n;
deltaE_pm2(h)- deltaE_pm2(k))) - cte1=0;
i*Xd(h)*(Pelect(h)- for k=1:1:n;
i*Qelect(h))/(Vi(h)*(cos(tetai(h))+i*sin(tetai(h
)))); Pe(h)=cte1+((Gij(h,k))*cos( deltaE_pm3(h)-
deltaE_pm3(k))+(Bij(h,k))*sin( deltaE_pm3(h)-
[tet(h),Vi(h)]=cart2pol(real(Vii(h)),imag(Vii(h) deltaE_pm3(k)))*Ei(k);
)); cte1=Pe(h);
end; end;
end; Pelect(h)= Pe(h)*Ei(h);
Ei(h);
end
for k=1:1:n;

Qe(h)=cte1+((Gij(h,k))*sin( deltaE_pm3(h)-
deltaE_pm3(k))-(Bij(h,k))*cos( deltaE_pm3(h)-
deltaE_pm3(k)))*Ei(k);
cte1=Qe(h);
end;

10
Qelect(h)= Qe(h)*Ei(h); delt(h)=di(h);

Vii(h)= Ei(h)*(cos( %condicion regulador de velocidad


deltaE_pm3(h)- deltaE_pm3(k))+i*sin( if reg_velo == 0;
deltaE_pm3(h)- deltaE_pm3(k))) - Pm(h)=Pm1(h);
i*Xd(h)*(Pelect(h)- %no hay variacion de pm
i*Qelect(h))/(Vi(h)*(cos(tetai(h))+i*sin(tetai(h
)))); elseif reg_velo ==1;
Pm(h)= Pm(h)+ deltaPmi(h);
[tet(h),Vi(h)]=cart2pol(real(Vii(h)),imag(Vii(h) %Se suma la variacion de pm
)); end;
end;
end;
if reg_volt == 0 ;
Ei(h);
Ei(h)=Ei_ini(h);

elseif reg_volt == 1 && t>tpre;


Ei(h)=Ei(h) + deltaEi(h);
end;
for h=1:1:n;
%-------------------------------------------- cte1=0;
------------------------------------------------ for k=1:1:n;
---------------------------------
Pe(h)=cte1+((Gij(h,k))*cos(delt(h)-
delt(k))+(Bij(h,k))*sin(delt(h)-delt(k)))*Ei(k);
cte1=Pe(h);
%Prediccion al final del intervalo m4
end;
for h=1:1:n;
Pelect(h)= Pe(h)*Ei(h);
cte1=0;
for k=1:1:n;
for k=1:1:n;
Pe(h)=cte1+((Gij(h,k))*cos(d_final(h)-
d_final(k))+(Bij(h,k))*sin(d_final(h)- Qe(h)=cte1+((Gij(h,k))*sin(delt(h)-delt(k))-
d_final(k)))*Ei(k); (Bij(h,k))*cos(delt(h)-delt(k)))*Ei(k);
cte1=Pe(h); cte1=Qe(h);
end; end;
mm4_w(h)=(Pm(h)- Qelect(h)= Qe(h)*Ei(h);
Pe(h)*Ei(h))*(120*pi/(2*H(h))); % a t=0.5
mm4_d(h)=w_final(h)-120*pi; Vii(h)= Ei(h)*(cos(delt(h)-
mm4_deltaPm(h)= - delt(k))+i*sin(delt(h)-delt(k))) -
(deltaPm_pm3(h)/Tm)+(km/Tm)*(wref-w_final(h)); i*Xd(h)*(Pelect(h)-
mm4_deltaE(h)= - i*Qelect(h))/(Vi(h)*(cos(tetai(h))+i*sin(tetai(h
(deltaE_pm3(h)/Te)+(ke/Te)*(Vref(h)-Vi(h)); ))));
end;
%promedio de m1,m2,m3,m4 [tet(h),Vi(h)]=cart2pol(real(Vii(h)),imag(Vii(h)
for h=1:1:n; ));
end;
end;
mw_prom(h)=(1/6)*(mm1_w(h)+2*mm2_w(h)+2*mm3_w(h) Ei(h);
+ mm4_w(h));
end;
md_prom(h)=(1/6)*(mm1_d(h)+2*mm2_d(h)+2*mm3_d(h)
+ mm4_d(h)); for r=1:1:n;
cte1=0;
mdeltaPm_prom(h)=(1/6)*(mm1_deltaPm(h)+2*mm2_del for s=1:1:n;
taPm(h)+2*mm3_deltaPm(h)+ mm4_deltaPm(h));
Pe(r)=cte1+((Gij(r,s))*cos(delt(r)-
mdeltaE_prom(h)=(1/6)*(mm1_deltaE(h)+2*mm2_delta delt(s))+(Bij(r,s))*sin(delt(r)-delt(s)))*Ei(s);
E(h)+2*mm3_deltaE(h)+ mm4_deltaE(h)); cte1=Pe(r);
end;
wi(h)=wsinc(h) + mw_prom(h)*dt; P_dib(r)= Pe(r)*Ei(r);
% solucion ec. diferencial para W end
di(h)=delt(h)+ md_prom(h)*dt;
% solucion ec. diferencial para delta for p=1:1:n;
deltaPmi(h)= deltaPm(h) + di_gen(t,p)=di(p);
mdeltaPm_prom(h)*dt; % solucion wi_gen(t,p)=wi(p);
ec. diferencial para deltapm Ei_gen(t,p)=Ei(p);
deltaEi(h)= deltaE(h) + Pm_gen(t,p)=Pm(p);
mdeltaE_prom(h)*dt; % Pe(t,p)=P_dib(p);
solucion ec. diferencial para deltaE1 Pa(t,p)=Pm_gen(t,p)-Pe(t,p);
end;
wsinc(h)=wi(h);
%actualizacion de resultados

11
end;

%-----------------------------------------------
------------------------------------------------ plot(ti,Pm_1_1,'b',ti,Pm_1_2,'r',ti,Pm_1_3,'g');
------------------------------------------------ title('Potencia Mecanica De Los
---------- Generadores')
ti=(dt:dt:time); %GRÁFICOS grid on;
%grafia de los angulos de los generadores hleg2=legend('Pm1','Pm2','Pm3');
figure(1) xlabel('Tiempo [s]');
d_gen_1=(di_gen(:,1)*(180/pi)); ylabel('Potencia Mecanica [p.u.]');
d_gen_1_1=d_gen_1';
d_gen_2=(di_gen(:,2)*(180/pi));
%grafica de la potencia electrica
d_gen_2_2=d_gen_2';
figure(5)
d_gen_3=(di_gen(:,3)*(180/pi));
Pe_1=Pe(:,1); P1=Pe_1';
d_gen_3_3=d_gen_3';
Pe_2=Pe(:,2); P2=Pe_2';
Pe_3=Pe(:,3); P3=Pe_3';

plot(ti,P1,'b',ti,P2,'r',ti,P3,'g');
plot(ti,d_gen_1_1,'b',ti,d_gen_2_2,'r',ti,d_gen_ title('Potencia Electrica De Los
3_3,'g'); Generadores')
grid on;
title('Angulos De Los Generadores') hleg2=legend('Pe1','Pe2','Pe3');
grid on; xlabel('Tiempo [s]');
hleg1=legend('delta1','delta2','delta3' ); ylabel('Potencia Electrica [p.u.]');
xlabel('\nTiempo [s]');
ylabel('\nÁngulos delta de los %grafica de la potencia de aceleracion
generadores [grados]'); figure(6)
%grafica de la velocidad de los genradores Pa_1=Pa(:,1); Pa1=Pa_1';
figure(2) Pa_2=Pa(:,2); Pa2=Pa_2';
w_gen_1=(wi_gen(:,1)); Pa_3=Pa(:,3); Pa3=Pa_3';
w_gen_1_1=w_gen_1';
w_gen_2=(wi_gen(:,2));
w_gen_2_2=w_gen_2';
w_gen_3=(wi_gen(:,3));
w_gen_3_3=w_gen_3'; plot(ti,Pa1,'b',ti,Pa2,'r',ti,Pa3,'g');
title('Potencia Acelerante De Los
Generadores')
grid on;
hleg2=legend('Pa1','Pa2','Pa3');
plot(ti,w_gen_1_1,'b',ti,w_gen_2_2,'r',ti,w_gen_ xlabel('Tiempo [s]');
3_3,'g'); ylabel('Potencia Acelerante [p.u.]');
title('Velocidad De Los
Generadores')
%grafica de la diferencia angular
grid on;
figure(7)
hleg2=legend('W1','W2','W3');
xlabel('Tiempo [s]');
ylabel('Velocidad de Generadores d_gen_21=(di_gen(:,2)*(180/pi))-
[rad/s]'); (di_gen(:,1)*(180/pi)); d_gen_1_1=d_gen_21';
d_gen_31=(di_gen(:,3)*(180/pi))-
(di_gen(:,1)*(180/pi)); d_gen_3_3=d_gen_31';
%grafica de voltaje
figure(3)
plot(ti,d_gen_1_1,'b',ti,d_gen_3_3,'g');
Ei_1=Ei_gen(:,1); Ei_1_1=Ei_1';
title('Diferencia angular')
Ei_2=Ei_gen(:,2); Ei_1_2=Ei_2';
grid on;
Ei_3=Ei_gen(:,3); Ei_1_3=Ei_3';
hleg1=legend('delta21','delta31' );
xlabel('Tiempo [s]');
ylabel('Ángulos delta de los
plot(ti,Ei_1_1,'b',ti,Ei_1_2,'r',ti,Ei_1_3,'g'); generadores [grados]');
title('Voltajes Internos De Los
Generadores')
grid on;
hleg2=legend('E1','E2','E3');
xlabel('Tiempo [s]');
ylabel('Voltaje de Generadores
[p.u.]');
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a
%grafica de la potencia mecanica future version of MATLAB
figure(4) % handles structure with handles and user
Pm_1=Pm_gen(:,1); Pm_1_1=Pm_1'; data (see GUIDATA)
Pm_2=Pm_gen(:,2); Pm_1_2=Pm_2';
Pm_3=Pm_gen(:,3); Pm_1_3=Pm_3';
% --- Executes on button press in pushbutton6.

12
function pushbutton6_Callback(hObject,
eventdata, handles)
[x,map]=imread('TRAFO2.jpg','jpg');
%Representamos imagen en figura, con su mapa de
colores
image(x),colormap(map),axis off,hold off
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a
future version of MATLAB
% handles structure with handles and user
data (see GUIDATA)

% --- Executes during object creation, after


setting all properties.
function axes9_CreateFcn(hObject, eventdata,
handles)
[x,map]=imread('Datos_del_proyecto.jpg','jpg');
%Representamos imagen en figura, con su mapa de
colores
image(x),colormap(map),axis off,hold off
% hObject handle to axes9 (see GCBO)
% eventdata reserved - to be defined in a
future version of MATLAB
% handles empty - handles not created until
after all CreateFcns called

% Hint: place code in OpeningFcn to populate


axes9

% --- Executes on button press in pushbutton9.


function pushbutton9_Callback(hObject,
eventdata, handles)
[x,map]=imread('Datos_del_proyecto.jpg','jpg');
%Representamos imagen en figura, con su mapa de
colores
image(x),colormap(map),axis off,hold off

% hObject handle to pushbutton9 (see GCBO)


% eventdata reserved - to be defined in a
future version of MATLAB
% handles structure with handles and user
data (see GUIDATA)

%Representamos imagen en figura, con su mapa de colores


image(x),colormap(map),axis off,hold off

% hObject handle to pushbutton9 (see GCBO)


% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)

%Representamos imagen en figura, con su mapa de colores


image(x),colormap(map),axis off,hold off

% hObject handle to pushbutton9 (see GCBO)


% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)

13

Вам также может понравиться