Documentos de Académico
Documentos de Profesional
Documentos de Cultura
ELABORADO POR:
CAMILO ANDRES BELTRA MALAGOON
JUAN CAMILO VANEGAS CONTRERAS
CRISTIAN DAVID FADO VILLAMIL
UNIVERSIDAD ECCI
JUNIO 07 DE 2017
BOGOTA, D.C.
1
INDICE
INTRODUCCION Pag. 3.
INICIO INTERFAZ GRAFICA DE CALCULO DE POTENCIA Pag. 3-8.
CODIGO MATLAB. Pag 8-15.
BIBLIOGRAFIA.. Pag. 15.
2
INTRODUCCION
GUIDE es un entorno de programacin visual disponible en MATLAB, este
entorno fue utilizado para crear la interfaz grfica INTERFAZ DE
CALCULO DE POTENCIA. Se cre haciendo uso de las diferentes
herramientas que este entorno nos ofrece y que se explican en este
manual.
Ilustracin 1
3
Despus de acceder dando click en el icono, se abrir una nueva ventana
(ilustracin 2) , all seleccionamos la opcin Blank GUI para iniciar nuestra
GUI desde ceros.
Ilustracin 2
Ilustracin 3
4
En esta ventana a su parte izquierda y en la parte superior se encontraran
las herramientas que nos permitirn construir nuestra GUI.
Para entender mejor el funcionamiento de las herramientas, ejecutamos la
siguiente ruta File-pesferentes-show name in component palette. Para
luego obtener:
Ilustracin 4
5
Ilustracin 5
STATIC TEXT: Una de las funciones que tiene la gui es el texto estatico el
cual consiste en introducir mensajes e incluso valores numricos de una
GUI y puede colocarse en un lugar deseado.(1 El cual tiene la siguiente
forma y estos son los siguientes cuadros de texto en nuestra interfaz
grfica.
Ilustracin 6
6
Con esta herramientas comenzamos la construccin de la GUI INTERFAZ
DE CALCULO DE PORTENCIA
Ilustracin 7
7
analizados previamente de acuerdo a la funcin ingresada por el usuario,
teniendo estos coeficientes se suman para obtener el voltaje, luego
hallamos la corriente primero resolviendo el paralelo entre la bobina y el
condensador para luego hallar la corriente que circula por esta malla.
Teniendo los valores de voltaje y corriente que circular por el circuito
procedemos a calcular la potencia que recae sobre cada uno de los
componentes los cuales se observan en el recuadro al que llamamos
Resultados
CODIGO EN MATLAB
Se muestra el programa de funcionamiento de la interfaz de clculo de
potencia
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Juangui_OpeningFcn, ...
'gui_OutputFcn', @Juangui_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
8
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = Juangui_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
if modo == 1
%senal triangular (A * 1/F)
%A = 1;
%w = 10*pi;
%rho = 0.5;
w=F*2*pi;
t = 0:0.0001:(25/w);
tr = (A/2)*sawtooth(t*w) + (A/2);
plot(t,tr);
axes(handles.axes1)
handles.axes1=imread('Circuito.jpg');
imagesc(handles.axes1)
axis off
end
if modo == 2
9
%senal cuadrada
w=F*2*pi;
t = 0:0.0001:(25/w);
sq = A*square(w*t);
plot(t,sq);
axes(handles.axes1)
handles.axes1=imread('Circuito.jpg');
imagesc(handles.axes1)
axis off
end
if modo == 3
%senal triangular
w=F*2*pi;
t = 0:0.0001:(12.5/w);
tr = (A)*sawtooth(t*w+(pi/2), 0.5);
plot(t,tr);
axes(handles.axes1)
handles.axes1=imread('Circuito.jpg');
imagesc(handles.axes1)
axis off
end
10
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
11
% 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
12
% OldValue: handle of the previously selected object or empty if none was
selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
global modo
if hObject == handles.radiobutton7
modo = 1
end
if hObject == handles.radiobutton8
modo = 2
end
if hObject == handles.radiobutton9
modo = 3
end
if modo == 1
syms t n;
Wo=2*pi*F;
T=1/F;
tr = A*t;
a0= (1/T)*int(tr,0,T)
pretty (a0)
aN= (2/T)*int((tr*cos(n*Wo*t)),t,0,T)
13
pretty (aN)
bN= (2/T)*int((tr*sin(n*Wo*t)),t,0,T)
pretty (bN)
vt=0;
for n=1:3
vt=vt+((aN*cos(Wo*n*t))+(bN*sin(Wo*n*t)));
end
Vt = (a0/2) + vt;
pretty (Vt)
end
if modo == 2
%senal cuadrada
syms t n;
Wo=2*pi*F;
T=1/F;
tr = A*square(w*t);
a0= (1/T)*int(tr,0,T)
pretty (a0)
aN= (2/T)*int((tr*cos(n*Wo*t)),t,0,T)
pretty (aN)
bN= (2/T)*int((tr*sin(n*Wo*t)),t,0,T)
pretty (bN)
vt=0;
for n=1:3
vt=vt+((aN*cos(Wo*n*t))+(bN*sin(Wo*n*t)));
end
Vt = a0 + vt;
pretty (Vt)
end
if modo == 3
%senal triangular
end
14
Bibliografa
http://webpersonal.uma.es/de/gfdc/docencia/GuiSection.pdf
http://catarina.udlap.mx/u_dl_a/tales/documentos/lep/garcia_b_s/ca
pitulo3.pdf
http://interfazgraficamatlab.blogspot.com.co/
http://bibing.us.es/proyectos/abreproy/11986/fichero/CAP
%C3%8DTULO+3%252FCAP%C3%8DTULO+3.pdf
15