28
function varargout = flujodecarga2(varargin) % FLUJODECARGA2 MATLAB code for flujodecarga2.fig % FLUJODECARGA2, by itself, creates a new FLUJODECARGA2 or raises the existing % singleton*. % % H = FLUJODECARGA2 returns the handle to a new FLUJODECARGA2 or the handle to % the existing singleton*. % % FLUJODECARGA2('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in FLUJODECARGA2.M with the given input arguments. % % FLUJODECARGA2('Property','Value',...) creates a new FLUJODECARGA2 or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before flujodecarga2_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to flujodecarga2_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help flujodecarga2 % Last Modified by GUIDE v2.5 29-Nov-2014 01:23:40 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @flujodecarga2_OpeningFcn, ... 'gui_OutputFcn', @flujodecarga2_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end

codigo.m

Embed Size (px)

DESCRIPTION

sd

Citation preview

function varargout = flujodecarga2(varargin)% FLUJODECARGA2 MATLAB code for flujodecarga2.fig% FLUJODECARGA2, by itself, creates a new FLUJODECARGA2 or raises the existing% singleton*.%% H = FLUJODECARGA2 returns the handle to a new FLUJODECARGA2 or the handle to% the existing singleton*.%% FLUJODECARGA2('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in FLUJODECARGA2.M with the given input arguments.%% FLUJODECARGA2('Property','Value',...) creates a new FLUJODECARGA2 or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before flujodecarga2_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to flujodecarga2_OpeningFcn via varargin.%% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one% instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help flujodecarga2 % Last Modified by GUIDE v2.5 29-Nov-2014 01:23:40 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @flujodecarga2_OpeningFcn, ... 'gui_OutputFcn', @flujodecarga2_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT % --- Executes just before flujodecarga2 is made visible.

function flujodecarga2_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to flujodecarga2 (see VARARGIN)clc% Choose default command line output for flujodecarga2handles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes flujodecarga2 wait for user response (see UIRESUME)% uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.function varargout = flujodecarga2_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout{1} = handles.output; % --- Executes on button press in tension.function tension_Callback(hObject, eventdata, handles)t1=handles.t1;t2=handles.t2;t3=handles.t3;t4=handles.t4;pd2=handles.pd2;pd3=handles.pd3;pq2=handles.pq2;pq3=handles.pq3;pg=handles.pg;sbase=handles.sbase;%100 MVAubase=handles.ubase;%tensión base 220 kVimpe1=handles.impe1;adm1=handles.adm1;impe2=handles.impe2;adm2=handles.adm2;impe3=handles.impe3;impe3=impe3/3;adm3=handles.adm3;impe4=handles.impe4;impe4=impe4/3;adm4=handles.adm4;Y=[1/impe1+1/impe2+adm1/2+adm2/2,-1/impe1,-1/impe2,0;-1/impe1,1/impe1+1/impe3+adm1/2+adm3/2,0,-1/impe3;-1/impe2,0,1/impe2+1/impe4+adm4/2+adm2/2,-1/impe4;0,-1/impe3,-1/impe4,1/impe3+1/impe4+adm3/2+adm4/2]U=[t1;t2;t3;t4];%valores iniciales en pu de Ubases2=-(pd2/sbase)-((pq2/sbase)*i);%en pu de Sbases3=-(pd3/sbase)-((pq3/sbase)*i);%p4=pg/sbase;%en pu de Sbase PG MW

error=1;k=1;while error>1e-6 & k <50k=k+1;U(1,k)=U(1,k-1);U(2,k)=(conj(s2/U(2,k-1))-Y(2,1)*U(1,k)-Y(2,3)*U(3,k-1)-Y(2,4)*U(4,k-1))/Y(2,2);U(3,k)=(conj(s3/U(3,k-1))-Y(3,1)*U(1,k)-Y(3,2)*U(2,k)-Y(3,4)*U(4,k-1))/Y(3,3);q4=-imag(conj(U(4,k-1))*(Y(2,4)*U(2,k)+Y(4,3)*U(3,k)+Y(4,4)*U(4,k-1)));s4=p4+j*q4;U(4,k)=(conj(s4/U(4,k-1))-Y(4,2)*U(2,k)-Y(4,3)*U(3,k))/Y(4,4);U(4,k)=U(4,1)*exp(j*angle(U(4,k)));error=max(abs([U(2,k-1)-U(2,k);U(3,k-1)-U(3,k);U(4,k-1)-U(4,k)]));endU_barras=U(:,k)I_b=Y*U_barras;%intensidades inyectadas a las barrasS_barras=U_barras.*conj(I_b);%potencia inyectada a las barrasperdidas=sum(S_barras);error_global=S_barras(1,1)+S_barras(4,1)+s2+s3-perdidas; set(handles.tension1,'String',num2str(U_barras))% hObject handle to tension (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % --- Executes on button press in capacitancia.function capacitancia_Callback(hObject, eventdata, handles)u1=handles.t1;u2=handles.t2;u3=handles.t3;u4=handles.t4;ppd2=handles.pd2;ppd3=handles.pd3;ppq2=handles.pq2;ppq3=handles.pq3;ppg=handles.pg;sbas=handles.sbase;%100 MVAubas=handles.ubase;%tensión base 220 kVz12=handles.impe1;y12=handles.adm1;z13=handles.impe2;y13=handles.adm2;z24=handles.impe3;z24=z24/3;y24=handles.adm3;z34=handles.impe4;z34=z34/3;y34=handles.adm4;Y=[1/z12+1/z13+y12/2+y13/2,-1/z12,-1/z13,0;-1/z12,1/z12+1/z24+y12/2+y24/2,0,-1/z24;-1/z13,0,1/z13+1/z34+y34/2+y13/2,-1/z34;0,-1/z24,-1/z34,1/z24+1/z34+y24/2+y34/2];U=[u1;u2;u3;u4];%valores iniciales en pu de Ubases2=-(ppd2/sbas)-((ppq2/sbas)*1i);%en pu de Sbases3=-(ppd3/sbas)-((ppq3/sbas)*1i);%p4=ppg/sbas;%en pu de Sbase PG MWerror=1;k=1;while error>1e-6 & k <50

k=k+1;U(1,k)=U(1,k-1);U(2,k)=(conj(s2/U(2,k-1))-Y(2,1)*U(1,k)-Y(2,3)*U(3,k-1)-Y(2,4)*U(4,k-1))/Y(2,2);U(3,k)=(conj(s3/U(3,k-1))-Y(3,1)*U(1,k)-Y(3,2)*U(2,k)-Y(3,4)*U(4,k-1))/Y(3,3);q4=-imag(conj(U(4,k-1))*(Y(2,4)*U(2,k)+Y(4,3)*U(3,k)+Y(4,4)*U(4,k-1)));s4=p4+j*q4;U(4,k)=(conj(s4/U(4,k-1))-Y(4,2)*U(2,k)-Y(4,3)*U(3,k))/Y(4,4);U(4,k)=U(4,1)*exp(j*angle(U(4,k)));error=max(abs([U(2,k-1)-U(2,k);U(3,k-1)-U(3,k);U(4,k-1)-U(4,k)]));endU_barras=U(:,k);I_b=Y*U_barras;%intensidades inyectadas a las barrasS_barras=U_barras.*conj(I_b);%potencia inyectada a las barrasperdidas=sum(S_barras);error_global=S_barras(1,1)+S_barras(4,1)+s2+s3-perdidas;fprintf('Las pérdidas = %0.3f MW -j*%0.3f MVAr\n',real(perdidas)*100,abs(imag(perdidas))*100);Cap_n_2= -(y12+y24)/2*abs(U_barras(2))^2Cap_n_1= -(y12+y13)/2*abs(U_barras(1))^2Cap_n_3= -(y34+y13)/2*abs(U_barras(3))^2Cap_n_4= -(y34+y24)/2*abs(U_barras(4))^2Cap_nudos=Cap_n_2+Cap_n_1+Cap_n_3+Cap_n_4%reactiva capacitivaset(handles.cap1,'String',num2str(Cap_n_2))set(handles.cap2,'String',num2str(Cap_n_1))set(handles.cap3,'String',num2str(Cap_n_3))set(handles.cap4,'String',num2str(Cap_n_4))set(handles.captotal,'String',num2str(Cap_nudos))% hObject handle to capacitancia (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % --- Executes on button press in impedancia.function impedancia_Callback(hObject, eventdata, handles)u1=handles.t1;u2=handles.t2;u3=handles.t3;u4=handles.t4;ppd2=handles.pd2;ppd3=handles.pd3;ppq2=handles.pq2;ppq3=handles.pq3;ppg=handles.pg;sbas=handles.sbase;%100 MVAubas=handles.ubase;%tensión base 220 kVz12=handles.impe1;y12=handles.adm1;z13=handles.impe2;y13=handles.adm2;z24=handles.impe3;z24=z24/3;y24=handles.adm3;z34=handles.impe4;z34=z34/3;y34=handles.adm4;Y=[1/z12+1/z13+y12/2+y13/2,-1/z12,-1/z13,0;-1/z12,1/z12+1/z24+y12/2+y24/2,0,-1/z24;

-1/z13,0,1/z13+1/z34+y34/2+y13/2,-1/z34;0,-1/z24,-1/z34,1/z24+1/z34+y24/2+y34/2];U=[u1;u2;u3;u4];%valores iniciales en pu de Ubases2=-(ppd2/sbas)-((ppq2/sbas)*1i);%en pu de Sbases3=-(ppd3/sbas)-((ppq3/sbas)*1i);%p4=ppg/sbas;%en pu de Sbase PG MWerror=1;k=1;while error>1e-6 & k <50k=k+1;U(1,k)=U(1,k-1);U(2,k)=(conj(s2/U(2,k-1))-Y(2,1)*U(1,k)-Y(2,3)*U(3,k-1)-Y(2,4)*U(4,k-1))/Y(2,2);U(3,k)=(conj(s3/U(3,k-1))-Y(3,1)*U(1,k)-Y(3,2)*U(2,k)-Y(3,4)*U(4,k-1))/Y(3,3);q4=-imag(conj(U(4,k-1))*(Y(2,4)*U(2,k)+Y(4,3)*U(3,k)+Y(4,4)*U(4,k-1)));s4=p4+j*q4;U(4,k)=(conj(s4/U(4,k-1))-Y(4,2)*U(2,k)-Y(4,3)*U(3,k))/Y(4,4);U(4,k)=U(4,1)*exp(j*angle(U(4,k)));error=max(abs([U(2,k-1)-U(2,k);U(3,k-1)-U(3,k);U(4,k-1)-U(4,k)]));endU_barras=U(:,k);I_b=Y*U_barras;%intensidades inyectadas a las barrasS_barras=U_barras.*conj(I_b);%potencia inyectada a las barrasperdidas=sum(S_barras);error_global=S_barras(1,1)+S_barras(4,1)+s2+s3-perdidas;fprintf('Las pérdidas = %0.3f MW -j*%0.3f MVAr\n',real(perdidas)*100,abs(imag(perdidas))*100);Per_lin_12=abs(-Y(1,2)*(U_barras(1)-U_barras(2)))^2*z12Per_lin_13= abs(-Y(1,3)*(U_barras(1)-U_barras(3)))^2*z13Per_lin_24= abs(-Y(2,4)*(U_barras(4)-U_barras(2)))^2*z24Per_lin_34= abs(-Y(4,3)*(U_barras(4)-U_barras(3)))^2*z34Cap_n_2= -(y12+y24)/2*abs(U_barras(2))^2;Cap_n_1= -(y12+y13)/2*abs(U_barras(1))^2;Cap_n_3= -(y34+y13)/2*abs(U_barras(3))^2;Cap_n_4= -(y34+y24)/2*abs(U_barras(4))^2;Cap_nudos=Cap_n_2+Cap_n_1+Cap_n_3+Cap_n_4;%reactiva capacitivaPer_lin=Per_lin_12+Per_lin_13+Per_lin_24+Per_lin_34%reales más reactiva inductivaerror_global_f=perdidas-(Cap_nudos+Per_lin);E=error_global_f-error_globalfprintf('Error entre los dos métodos %0.2f VA/',abs(E)*sbas)set(handles.imp1,'String',num2str(Per_lin_12))set(handles.imp2,'String',num2str(Per_lin_13))set(handles.imp3,'String',num2str(Per_lin_24))set(handles.imp4,'String',num2str(Per_lin_34))set(handles.imptotal,'String',num2str(Per_lin))% hObject handle to impedancia (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % --- Executes on button press in potencia.function potencia_Callback(hObject, eventdata, handles)u1=handles.t1;u2=handles.t2;u3=handles.t3;u4=handles.t4;

ppd2=handles.pd2;ppd3=handles.pd3;ppq2=handles.pq2;ppq3=handles.pq3;ppg=handles.pg;sbas=handles.sbase;%100 MVAubas=handles.ubase;%tensión base 220 kVz12=handles.impe1;y12=handles.adm1;z13=handles.impe2;y13=handles.adm2;z24=handles.impe3;z24=z24/3;y24=handles.adm3;z34=handles.impe4;z34=z34/3;y34=handles.adm4;Y=[1/z12+1/z13+y12/2+y13/2,-1/z12,-1/z13,0;-1/z12,1/z12+1/z24+y12/2+y24/2,0,-1/z24;-1/z13,0,1/z13+1/z34+y34/2+y13/2,-1/z34;0,-1/z24,-1/z34,1/z24+1/z34+y24/2+y34/2];U=[u1;u2;u3;u4];%valores iniciales en pu de Ubases2=-(ppd2/sbas)-((ppq2/sbas)*1i);%en pu de Sbases3=-(ppd3/sbas)-((ppq3/sbas)*1i);%p4=ppg/sbas;%en pu de Sbase PG MWerror=1;k=1;while error>1e-6 & k <50k=k+1;U(1,k)=U(1,k-1);U(2,k)=(conj(s2/U(2,k-1))-Y(2,1)*U(1,k)-Y(2,3)*U(3,k-1)-Y(2,4)*U(4,k-1))/Y(2,2);U(3,k)=(conj(s3/U(3,k-1))-Y(3,1)*U(1,k)-Y(3,2)*U(2,k)-Y(3,4)*U(4,k-1))/Y(3,3);q4=-imag(conj(U(4,k-1))*(Y(2,4)*U(2,k)+Y(4,3)*U(3,k)+Y(4,4)*U(4,k-1)));s4=p4+j*q4;U(4,k)=(conj(s4/U(4,k-1))-Y(4,2)*U(2,k)-Y(4,3)*U(3,k))/Y(4,4);U(4,k)=U(4,1)*exp(j*angle(U(4,k)));error=max(abs([U(2,k-1)-U(2,k);U(3,k-1)-U(3,k);U(4,k-1)-U(4,k)]));endU_barras=U(:,k);I_b=Y*U_barras;%intensidades inyectadas a las barrasS_barras=U_barras.*conj(I_b)%potencia inyectada a las barrasperdidas=sum(S_barras)error_global=S_barras(1,1)+S_barras(4,1)+s2+s3-perdidasset(handles.perdida,'String',num2str(perdidas))set(handles.PBARRAS,'String',num2str(S_barras))% hObject handle to potencia (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) function tension1_Callback(hObject, eventdata, handles)% hObject handle to tension1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of tension1 as text

% str2double(get(hObject,'String')) returns contents of tension1 as a double % --- Executes during object creation, after setting all properties.function tension1_CreateFcn(hObject, eventdata, handles)% hObject handle to tension1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function cap1_Callback(hObject, eventdata, handles)% hObject handle to cap1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of cap1 as text% str2double(get(hObject,'String')) returns contents of cap1 as a double % --- Executes during object creation, after setting all properties.function cap1_CreateFcn(hObject, eventdata, handles)% hObject handle to cap1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function cap2_Callback(hObject, eventdata, handles)% hObject handle to cap2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of cap2 as text% str2double(get(hObject,'String')) returns contents of cap2 as a double % --- Executes during object creation, after setting all properties.

function cap2_CreateFcn(hObject, eventdata, handles)% hObject handle to cap2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function cap3_Callback(hObject, eventdata, handles)% hObject handle to cap3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of cap3 as text% str2double(get(hObject,'String')) returns contents of cap3 as a double % --- Executes during object creation, after setting all properties.function cap3_CreateFcn(hObject, eventdata, handles)% hObject handle to cap3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function cap4_Callback(hObject, eventdata, handles)% hObject handle to cap4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of cap4 as text% str2double(get(hObject,'String')) returns contents of cap4 as a double % --- Executes during object creation, after setting all properties.function cap4_CreateFcn(hObject, eventdata, handles)% hObject handle to cap4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function imp4_Callback(hObject, eventdata, handles)% hObject handle to imp4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of imp4 as text% str2double(get(hObject,'String')) returns contents of imp4 as a double % --- Executes during object creation, after setting all properties.function imp4_CreateFcn(hObject, eventdata, handles)% hObject handle to imp4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function imp3_Callback(hObject, eventdata, handles)% hObject handle to imp3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of imp3 as text% str2double(get(hObject,'String')) returns contents of imp3 as a double % --- Executes during object creation, after setting all properties.function imp3_CreateFcn(hObject, eventdata, handles)% hObject handle to imp3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');end function imp2_Callback(hObject, eventdata, handles)% hObject handle to imp2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of imp2 as text% str2double(get(hObject,'String')) returns contents of imp2 as a double % --- Executes during object creation, after setting all properties.function imp2_CreateFcn(hObject, eventdata, handles)% hObject handle to imp2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function imp1_Callback(hObject, eventdata, handles)% hObject handle to imp1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of imp1 as text% str2double(get(hObject,'String')) returns contents of imp1 as a double % --- Executes during object creation, after setting all properties.function imp1_CreateFcn(hObject, eventdata, handles)% hObject handle to imp1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end

function perdida_Callback(hObject, eventdata, handles)% hObject handle to perdida (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of perdida as text% str2double(get(hObject,'String')) returns contents of perdida as a double % --- Executes during object creation, after setting all properties.function perdida_CreateFcn(hObject, eventdata, handles)% hObject handle to perdida (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function imptotal_Callback(hObject, eventdata, handles)% hObject handle to imptotal (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of imptotal as text% str2double(get(hObject,'String')) returns contents of imptotal as a double % --- Executes during object creation, after setting all properties.function imptotal_CreateFcn(hObject, eventdata, handles)% hObject handle to imptotal (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function captotal_Callback(hObject, eventdata, handles)% hObject handle to captotal (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of captotal as text% str2double(get(hObject,'String')) returns contents of captotal as a double % --- Executes during object creation, after setting all properties.function captotal_CreateFcn(hObject, eventdata, handles)% hObject handle to captotal (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end % --- Executes during object creation, after setting all properties.function axes1_CreateFcn(hObject, eventdata, handles)% hObject handle to axes1 (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 axes1 % --- Executes on button press in RED.function RED_Callback(hObject, eventdata, handles)axes(handles.axes1);imshow(imread('sistema.jpg'));a='FLUJO DE CARGA';set(handles.text1,'string',a); % hObject handle to RED (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) function impe1_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.impe1=newvalt;guidata(hObject,handles);% hObject handle to impe1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of impe1 as text% str2double(get(hObject,'String')) returns contents of impe1 as a double

% --- Executes during object creation, after setting all properties.function impe1_CreateFcn(hObject, eventdata, handles)% hObject handle to impe1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function impe3_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.impe3=newvalt;guidata(hObject,handles);% hObject handle to impe3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of impe3 as text% str2double(get(hObject,'String')) returns contents of impe3 as a double % --- Executes during object creation, after setting all properties.function impe3_CreateFcn(hObject, eventdata, handles)% hObject handle to impe3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function impe2_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.impe2=newvalt;guidata(hObject,handles);% hObject handle to impe2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of impe2 as text

% str2double(get(hObject,'String')) returns contents of impe2 as a double % --- Executes during object creation, after setting all properties.function impe2_CreateFcn(hObject, eventdata, handles)% hObject handle to impe2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function impe4_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.impe4=newvalt;guidata(hObject,handles);% hObject handle to impe4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of impe4 as text% str2double(get(hObject,'String')) returns contents of impe4 as a double % --- Executes during object creation, after setting all properties.function impe4_CreateFcn(hObject, eventdata, handles)% hObject handle to impe4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function adm1_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.adm1=newvalt;guidata(hObject,handles);% hObject handle to adm1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of adm1 as text% str2double(get(hObject,'String')) returns contents of adm1 as a double % --- Executes during object creation, after setting all properties.function adm1_CreateFcn(hObject, eventdata, handles)% hObject handle to adm1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function adm3_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.adm3=newvalt;guidata(hObject,handles);% hObject handle to adm3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of adm3 as text% str2double(get(hObject,'String')) returns contents of adm3 as a double % --- Executes during object creation, after setting all properties.function adm3_CreateFcn(hObject, eventdata, handles)% hObject handle to adm3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function adm2_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.adm2=newvalt;

guidata(hObject,handles);% hObject handle to adm2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of adm2 as text% str2double(get(hObject,'String')) returns contents of adm2 as a double % --- Executes during object creation, after setting all properties.function adm2_CreateFcn(hObject, eventdata, handles)% hObject handle to adm2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function adm4_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.adm4=newvalt;guidata(hObject,handles);% hObject handle to adm4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of adm4 as text% str2double(get(hObject,'String')) returns contents of adm4 as a double % --- Executes during object creation, after setting all properties.function adm4_CreateFcn(hObject, eventdata, handles)% hObject handle to adm4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function sbase_Callback(hObject, eventdata, handles)

Valt=get(hObject,'String');newvalt=str2double(Valt);handles.sbase=newvalt;guidata(hObject,handles);% hObject handle to sbase (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of sbase as text% str2double(get(hObject,'String')) returns contents of sbase as a double % --- Executes during object creation, after setting all properties.function sbase_CreateFcn(hObject, eventdata, handles) % hObject handle to sbase (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function ubase_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.ubase=newvalt;guidata(hObject,handles);% hObject handle to ubase (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of ubase as text% str2double(get(hObject,'String')) returns contents of ubase as a double % --- Executes during object creation, after setting all properties.function ubase_CreateFcn(hObject, eventdata, handles)% hObject handle to ubase (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');end function pq3_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.pq3=newvalt;guidata(hObject,handles);% hObject handle to pq3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of pq3 as text% str2double(get(hObject,'String')) returns contents of pq3 as a double % --- Executes during object creation, after setting all properties.function pq3_CreateFcn(hObject, eventdata, handles)% hObject handle to pq3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function pq2_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.pq2=newvalt;guidata(hObject,handles);% hObject handle to pq2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of pq2 as text% str2double(get(hObject,'String')) returns contents of pq2 as a double % --- Executes during object creation, after setting all properties.function pq2_CreateFcn(hObject, eventdata, handles)% hObject handle to pq2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.

% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function pd2_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.pd2=newvalt;guidata(hObject,handles);% hObject handle to pd2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of pd2 as text% str2double(get(hObject,'String')) returns contents of pd2 as a double % --- Executes during object creation, after setting all properties.function pd2_CreateFcn(hObject, eventdata, handles)% hObject handle to pd2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function pd3_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.pd3=newvalt;guidata(hObject,handles);% hObject handle to pd3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of pd3 as text% str2double(get(hObject,'String')) returns contents of pd3 as a double % --- Executes during object creation, after setting all properties.function pd3_CreateFcn(hObject, eventdata, handles)% hObject handle to pd3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB

% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function pg_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.pg=newvalt;guidata(hObject,handles);% hObject handle to pg (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of pg as text% str2double(get(hObject,'String')) returns contents of pg as a double % --- Executes during object creation, after setting all properties.function pg_CreateFcn(hObject, eventdata, handles)% hObject handle to pg (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function t1_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.t1=newvalt;guidata(hObject,handles);% hObject handle to t1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of t1 as text% str2double(get(hObject,'String')) returns contents of t1 as a double % --- Executes during object creation, after setting all properties.

function t1_CreateFcn(hObject, eventdata, handles)% hObject handle to t1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function t2_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.t2=newvalt;guidata(hObject,handles);% hObject handle to t2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of t2 as text% str2double(get(hObject,'String')) returns contents of t2 as a double % --- Executes during object creation, after setting all properties.function t2_CreateFcn(hObject, eventdata, handles)% hObject handle to t2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function t3_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.t3=newvalt;guidata(hObject,handles);% hObject handle to t3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of t3 as text% str2double(get(hObject,'String')) returns contents of t3 as a double

% --- Executes during object creation, after setting all properties.function t3_CreateFcn(hObject, eventdata, handles)% hObject handle to t3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function t4_Callback(hObject, eventdata, handles)Valt=get(hObject,'String');newvalt=str2double(Valt);handles.t4=newvalt;guidata(hObject,handles);% hObject handle to t4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of t4 as text% str2double(get(hObject,'String')) returns contents of t4 as a double % --- Executes during object creation, after setting all properties.function t4_CreateFcn(hObject, eventdata, handles)% hObject handle to t4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function PBARRAS_Callback(hObject, eventdata, handles)% hObject handle to PBARRAS (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of PBARRAS as text% str2double(get(hObject,'String')) returns contents of PBARRAS as a double

% --- Executes during object creation, after setting all properties.function PBARRAS_CreateFcn(hObject, eventdata, handles)% hObject handle to PBARRAS (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end