Documentos de Académico
Documentos de Profesional
Documentos de Cultura
2 OBJETIVOS
2.1 GENERAL
2.2 ESPECIFICOS
3 INTRODUCCIN
4 DESARROLLO
Circuito en Serie
clc
clear
a=0
printf('\t\t\t UNIVERSIDAD DE LAS FUERZAS ARMADAS-ESPE\n\n')
printf('\t\t\t DEPARTAMENTO DE ENERGIA Y MECANICA \n')
printf('\t\t\t
INGENIERIA MECATRONICA\n')
printf('\t\t\t
Mtodos Numericos\n\n')
printf(' Autores: Guevera Bryan---Rubio Rodrigo\n')
printf(' Pograma de regresiones \n\n')
printf(' A continaion trabajaremos con un programa que simula un circuito electrico\n')
printf(' Donde usted ingresara los valores de voltaje medidos con el multimetro y el\n')
printf(' Tiempo en que estos valores fueron medidos, como respuesta el programa devolvera\n')
printf(' Ecuaciones que representaran las curvas de voltaje en funcion del tiempo\n')
printf(' Usando metodos de regresiones\n\n\n')
//ingreso de los datos observados
X=[0.0001;1;2;3;4;5;6;7;8;9]
Y=[2.64;2.3;1.72;1.64;1.56;1.47;1.43;1.36;1.33;1.3]
p=size(X)
n=p(1,1)
//disp(X)
//disp(Y)
opc=2
while opc <> 6
printf('\n\n Elija una opcion por la cual usted desea que se realice la regresion\n\n')
printf(' 1) Regresion Lineal\n')
printf(' 2) Regresion Logaritmica\n')
printf(' 3) Regresion Exponencial\n')
printf(' 4) Regresion Polinomial\n')
printf(' 5) Todos los metodos\n')
printf(' 6) Fin\n\n')
opc=input("Opcion= ")
select opc
case 1
clc
printf('REGRESION lINEAL \n')
//p=size(X)
//n=p(1,1)
X2=X.*X
Y2=X.*Y
XY=X.*Y
sumx= sum(X)
sumy=sum(Y)
sumx2=sum(X2)
sumy2=sum(Y2)
sumxy=sum(XY)
a1=((n*sumxy)-(sumx*sumy))/((n*sumx2)-(sumx*sumx))
a0=(sumy/n)-(a1*(sumx/n))
//printf('\n a1= %3.5f',a1)
//printf('\n a0= %3.5f',a0)
printf('la ecuacion de la recta de regresion es:\n\n')
printf(' y = %3.5f',a1)
printf('x + ')
printf('%3.5f\n\n',a0)
for j=1:n
x(j)=X(j,1)
y(j)=Y(j,1)
plot(x,y,'bo') //
xgrid(7)
end
x1 = [0 : 0.001 : X(n,1)+1]
y1 = a0+a1*x1
xlabel("Tiempo"); ylabel("Voltaje"); title("Regresiones")
plot(x1, y1,'g')
case 2
//Regresion Logaritmica
clc
printf('REGRESION lOGARITMICA \n')
LNX=log(X)
LNY=log(Y)
LNX_Y=LNX.*Y
X_LNY=X.*LNY
LNX2=LNX.*LNX
sumlnx_y=sum(LNX_Y)
sumx_lny=sum(X_LNY)
sumlnx=sum(LNX)
sumlnx2=sum(LNX2)
sumlny=sum(LNY)
b1=((n*sumlnx_y)-(sumlnx*sumy))/((n*sumlnx2)-(sumlnx*sumlnx))
b0=(sumy/n)-(b1*(sumlnx/n))
x2 = [0.1 : 0.001 : X(n,1)+1]
y2 = b0+b1*log(x2)
xlabel("Tiempo"); ylabel("Voltaje"); title("Regresiones")
plot(x2, y2,'r')
for j=1:n
x(j)=X(j,1)
y(j)=Y(j,1)
plot(x,y,'bo') //
xgrid(7)
end
printf('la ecuacion de la curva de regresion es:\n\n')
//printf('\n b1= %3.5f',b1)
//printf('\n b0= %3.5f',b0)
printf(' y = %3.5f',b1)
printf('log(x) + ')
printf('%3.5f\n\n',b0)
case 3
// Regresion exponencial
clc
printf('REGRESION EXPONENCIAL \n')
c1=((n*sumx_lny)-(sumx*sumlny))/((n*sumx2)-(sumx*sumx))
c0_=(sumlny/n)-(c1*(sumx/n))
c0=(%e)^(c0_)
x3 = [0 : 0.001 : X(n,1)+1]
y3 = c0*(%e)^(c1*x3)
plot(x3, y3,'m')
xlabel("Tiempo"); ylabel("Voltaje"); title("Regresiones")
//printf('\n c1= %3.5f',c1)
//printf('\n c0= %3.5f',c0)
for j=1:n
x(j)=X(j,1)
y(j)=Y(j,1)
plot(x,y,'bo') //
xgrid(7)
end
case 4
//regresion polinomial
clc
printf('REGRESION POLINOMIAL \n')
for j=1:n
for i=1:n
k2=n-i+1
M(j,k2)=(X(j,1))^(i-1)
end
end
//disp(X)
//disp(Y)
//disp(M)
R=inv(M)*Y
// disp(R)
printf('la ecuacion de la curva de regresion es:\n\n')
printf(' y = ')
for l=1:n-1
s=n-l
z=R(l,1)
printf('%f',z)
printf('x^')
printf('%d',s)
printf(' + ')
end
z1=R(n,1)
printf('%f\n\n',z1)
for j=1:n
x(j)=X(j,1)
y(j)=Y(j,1)
plot(x,y,'bo') //
xgrid(7)
end
y4=0
x4 = [0 : 0.001 : X(n,1)+1]
for i4=1:n
abc=R(i4,1)
y4=y4+abc*x4^(n-i4)
end
xlabel("Tiempo"); ylabel("Voltaje"); title("Regresiones")
plot(x4, y4,'g')
//p=size(X)
//n=p(1,1)
X2=X.*X
Y2=X.*Y
XY=X.*Y
sumx= sum(X)
sumy=sum(Y)
sumx2=sum(X2)
sumy2=sum(Y2)
sumxy=sum(XY)
a1=((n*sumxy)-(sumx*sumy))/((n*sumx2)-(sumx*sumx))
a0=(sumy/n)-(a1*(sumx/n))
//printf('\n a1= %3.5f',a1)
//printf('\n a0= %3.5f',a0)
printf('la ecuacion de la recta de regresion es:\n\n')
printf(' y = %3.5f',a1)
printf('x + ')
printf('%3.5f\n\n',a0)
for j=1:n
x(j)=X(j,1)
y(j)=Y(j,1)
plot(x,y,'bo') //
xgrid(7)
end
x1 = [0 : 0.001 : X(n,1)+1]
y1 = a0+a1*x1
for i4=1:n
abc=R(i4,1)
y4=y4+abc*x4^(n-i4)
end
xlabel("Tiempo"); ylabel("Voltaje"); title("Regresiones")
plot(x4, y4,'b')
//fin
case 6
clc
clear
printf('
end
end
5 MATERIALES
Dispositivos
Computador personal
Software:
7 ANALISIS DE RESULTADOS
Voltaje simulado del capacitor
8 CONCLUCIONES
No es posible medir la respuesta transitoria del voltaje del capasitor debido a que el
cambio del voltaje ocurre casi instantneamente, esta tarea se lo debe realizar con un
osciscopio y un DAQ.
9 RECOMENDACIONES
Realizar con anticipacin la tarea debido a que toma tiempo realizarlo y poder terminarlo
satisfactoriamente.
10 BIBLIOGRAFIA
TABLA DE CONTENIDOS
Contenido
1 TEMA: ............................................................................................................................................... 1
2 OBJETIVOS ........................................................................................................................................ 1
2.1 GENERAL.................................................................................................................................... 1
3 INTRODUCCIN ................................................................................................................................ 1
4 DESARROLLO .................................................................................................................................... 1
4.1 Diseo del circuito ..................................................................................................................... 1
4.2 Desarrollo del programa en Scilab ............................................................................................ 1
5 MATERIALES ..................................................................................................................................... 9
7 ANALISIS DE RESULTADOS ................................................................................................................ 9
............................................................................................................................................................. 9
8 CONCLUCIONES .............................................................................................................................. 12
9 RECOMENDACIONES ...................................................................................................................... 12
10 BIBLIOGRAFIA ............................................................................................................................... 12