Talleres Matlab

Post on 22-Jan-2016

113 views 0 download

description

Circuitos 4 aplicado a MATLAB

Transcript of Talleres Matlab

INFORME TALLERES EN MATLAB

RICARDO E. TRONCOZOCIRCUITOS IV

INGENIERIA ELECTRÓNICA

UNIVERSIDAD DE IBAGUÉIBAGUÉ-TOLIMA

3 DE SEPTIEMBRE DE 2015

KELLY DANIELA MORALES C. CÓD. 2420122017

Modelos matemáticos de circuitos RLC en forma de ecuación diferencial y g(s) y cálculo de la respuesta del

sistema.

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

OBJETIVOS

Implementar el conocimiento teórico previamente adquirido sobre funciones de transferencia de un sistema.

Aplicar análisis a sistemas para hallar sus respectivos modelos matemáticos en forma de Ecuación diferencial.

Transformar dicha EDL en función de (s), aplicando la transformada de Laplace.

Implementar dichas ecuaciones y análisis en la elaboración de códigos y diagramas de bloques con sus respectivas respuestas paso, escalón y rampa.

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

1. En base a un circuito RLC como lo muestra la figura 1. Hallar el modelo matemático en forma de EDL y G(s), y calcular la respuesta del sistema si la entrada Vi(t) está definida de la siguiente forma.

1, para t≥0

Vi(t)=

0, para t<0

Figura 1. Circuito RLC

MODELO MATEMATICO EN FORMA DE EDL.

V R(t )=R i (t ) Ecu .1 V l (t )=Ldi(t)

dtEcu .2 V C (t )=

1c

∫ i ( t )dtEcu .3

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

Vi(t)=RCdVo (t)

dt+CL

d2Vo(t )

dt+Vo(t) Ecu .4

o Puesto que según el circuito se Vc(t) = Vo(t) entonces

V o (t)=1c

∫ i ( t ) dtEcu. 5

CdV o(t )

dt=i ( t )dtEcu .6

Vi(t)=CLd2Vo(t )

dt+RC

dVo(t )dt

+Vo(t) Ecu .7

d2Vo(t )

dt=1

cdi(t)

dtEcu.8

CLVo ' '(t )+ RC Vo' (t )+Vo(t)=Vi(t )Ecu . 9

CALCULO DE LA EDL USANDO LA TRANSFORMADA DE LAPLACE Y SU INVERSA.

o Dividiendo miembro a miembro CL obtenemos la Ecu.10 a la cual aplicaremos Laplace

Vo ' '(t)+RL

Vo '(t )+1

CLVo(t )=

1CL

V i(t )Ecu . 10

l {V o' '(t ) }+{R

Ll V o'

(t )}+ 1CL

l{Vo(t )}=1

CLl {Vi(t)}Ecu . 11

V o (S) S2+ RL

V o (S)S+ 1CL

V o(S )=1

CLV i(S) Ecu .12

o Procedemos a despejar la Ecu.12 y paso siguiente hallar la G(s)

V o ( S )(S2+ RL

S+ 1CL )= 1

CLV i (S) Ecu. 13

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

CALCULO DE G(s)

1CL

1

(S2+ RL

S+ 1CL )

=V o ( S)

V i (S )Ecu . 14

G(s)=

1CL

(S2+RL

S+1

CL )Ecu . 15

APLICACIÓN DE RESULTADOS EN MATLAB

o CÓDIGO

%PRIMER EJEMPLO DE UNA ECUACIÓN DIFERENCIAL clc,clear all,close all; %DECLARAMOS O ASIGNAMOS VALORES A LAS A VARIABLES O ELEMENTOS R,L,C R=2;L=3;C=1; open('RLC_1')%abre el modelosim('RLC_1')%simula el modelo

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

o DIAGRAMA DE BLOQUES

Figura 2. Diagrama de bloques del modelo de un sistema RLC con tres entradas, paso, rampa e impulso.

Figura 2.1 Subsistema del DIA.BLO. Para una respuesta paso

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

Figura 2.2 Subsistema del DIA.BLO. Para una respuesta Rampa

Figura 2.3 Subsistema del DIA.BLO. Para una respuesta paso

o GRAFICAS DE LA RESPUESTA DEL SISTEMA

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

Figura 3. Graficas de una respuesta Paso, Rampa y Escalón respectivamente.

2. En base a un circuito RLC como lo muestra la figura 1. Del punto anterior Hallar el modelo matemático en forma de EDL y G(s), y calcular la respuesta del sistema si la entrada Vi(t) está definida de la siguiente forma.

1, para t≥0

Vi(t)=

0, para t<0

RL

=3 Ecu.

1LC

=2 Ecu .

Figura 3. Circuito RLC

MODELO MATEMATICO EN FORMA DE EDL.

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

Mediante el análisis de la figura anterior a la cual se le halló paso a paso las ecuaciones respectivas y se procede a hacer el siguiente análisis con los valores siguientes:

G(s)=

1CL

(S2+RL

S+1

CL )Ecu .15

MODELO MATEMATICO EN FORMA DE EDL.

En base al análisis matemático realizado en el punto anterior obtenemos:

Vo ' '(t)+RL

Vo '(t )+1

LCVo(t)=

1LC

Vi(t) Ecu .1

Vo ' '(t)+3 Vo '(t )+2Vo(t )=2Vi(t ) Ecu. 2

1. Calculamos la Función de transferencia G(s) con CI=0

CALCULO DE LA EDL USANDO LA TRANSFORMADA DE LAPLACEA

o Aplicamos Laplace a la Ecu.

l {Vo ' ' ( t )}+l {3V o'(t ) }+l {2 Vo( t )}=l {2 Vi(t ) }Ecu .3

l {Vo ' ' ( t )}+3 l {V o'(t ) }+2 l {Vo( t )}=2 l {Vi (t ) } Ecu . 4

(S¿¿2+3 S+2S0)Vo(s)=2Vi(s )Ecu . 5¿

o Despejamos Vo(s)

Vo(s)=2 Vi(s)

(S¿¿2+3 S+2S0) Ecu .6¿

CALCULO DE G(s)

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

o De igual forma para Vi(s)

G(s)=Vo(s)

Vi(s )

= 2(S¿¿2+3 S+2 S0)Ecu .7¿

o Despejamos Vo(s)

Vo(s)=G(s )Vi(s)

Vo( s )=2

(S¿¿2+3 S+2)∗1s

Ecu .8¿

Vo( s )=2

S(S¿¿2+3 S+2)=2

S (S+1)(S+2)Ecu .9¿

o Mediante el desarrollo de la ecuación anterior por el método de fracciones parciales

Vo( s )=2

S(S¿¿2+3 S+2)=2

S (S+1)(S+2)=

K 1S

+K 2

(S+1)+

K 3(S+2)

Ecu.10¿

S+0=0----S=0

S+1=0----S=-1

S+2=0----S=-2

K 1=S Vo( s) ¿S=0=S¿11

¿¿

¿¿

K 2=( S+1 ) Vo( s )¿S=−1=( S+1 )[ 2S (S+1 ) ( S+2 ) ]¿S=−1 Ecu .13

¿ [ 2S (S+2) ]¿S=−1=Ecu.14

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

¿ [ 2−1(−1+2) ]¿S=−1=−2Ecu .15

K 3=(S+2)Vo (s )¿S=−2=(S+2)[ 2S(S+2)(S+1) ]¿S=−2 Ecu . 16

¿ [ 2S (S+1) ]¿S=−2=Ecu.17

¿ [ 2−2 (−2+2 ) ]¿S=−2=1 Ecu . 18

o Ya con los valores calculados de K1, K2 y K3 procedemos a reemplazar en Vo(S)

Vo( S )=¿ 1

S− 2

( S+1)+ 1

( S+2)Ecu .19¿

APLICACIÓN DE LA INVERSA DE LAPLACE.

o Para hallar Vo(t) Aplicamos Laplace inversa a Vo(S)

l−1 {Vo( S )}=¿ l−1 {

1S}−l−1 {

2(S+1)

}+l−1{1

( S+2 )}Ecu .20 ¿

Vo ( t )=1.1 ( t )−2e−1 (t )+1 e−2( t )Ecu.21 Respuesta de ( salida ) paso del sistema electrico RLC

APLICACIÓN DE RESULTADOS EN MATLAB

o CÓDIGO

%CODIGO EN MATLAB PARA GRAFICAR ESTA RESPUESTA%CODIGO #1 clc,clear all,close all;

t=0:0.1:7;V_o=1-2*exp(-t)+exp(-2*t);figure(1);plot(t,V_o)grid on;title('RESPUESTA PASO');

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

xlabel('TIEMPO t');ylabel('Vo(t)'); %CODIGO EN MATLAB PARA GRAFICAR ESTA RESPUESTA%CODIGO #2, USANDO G(S) num=[2];den=[1 3 2];figure(2);step(num,den)title('RRESPUESTA PASO');xlabel('TIEMPO t');ylabel('Vo(t)');grid on;open('simu_respuesta_paso');sim('simu_respuesta_paso');

o DIAGRAMA DE BLOQUES

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACEFigura 5. Diagrama de bloques del modelo de un sistema RLC con entrada paso y para valores de

Ganancia RL

=3, 1

LC=2.

Figura 5.1 Subsistema del DIA.BLO. Para una respuesta paso

o GRAFICAS DE LA RESPUESTA DEL SISTEMA

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

Figura 6. Graficas de una respuesta Paso y función de transferencia del sistema

Figura 6.1. Grafica de la respuesta Paso [Tiempo(t) Vs Vo(t)],t=0:0.1:7;V_o=1-2*exp(-t)+exp(-2*t)

Figura 6.2. Grafica de la respuesta Paso [Tiempo(t) Vs Vo(t)], num=[2];den=[1 3 2];

3. Hallar la respuesta Impulso y paso unitario del sistema.

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACEEcuación Mecánica

Jd2

( t )

dt ❑+b

d❑(t )

L=Ki(t ) Ecu.1

Ecuación Eléctrica

Ldi ( t )

dt ❑+R i( t )=V (t )−K

d❑(t )

LEcu .2

J= 0,01 Kg.m2

S2 ; Momento de inercia del motor

b= 0,1Nms; coeficiente de fricción viscosa del motor

K=0,01 N . mAmp

; Constante de fuerza Elect.

R= 1; resistencia eléctrica L=0,5H; Inductancia eléctrica

Vo(t) es la entrada= Voltaje(t) es la salida= desplazamiento angular. El rotor y el brazo se suponen que son rígidos

MODELO MATEMATICO EN FORMA DE EDL.

o Aplicando la transformada de Laplace, con CI=0 a las ecuaciones 1 y 2

Ecu .1

l {Jd2

( t )

dt}❑+l {b d❑(t )

L }=l {Ki (t ) } Ecu .3

J l{d2

( t )

dt}❑+b l {d❑(t )

L }=K l {i (t ) } Ecu .4

J S2❑(S )+bS❑(S)=Ki(s)Ecu .5

o Ya teniendo la Ecuación a partir de la transformada de Laplace procedemos a

despejar a i(s)

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

J S2❑(S)+bS❑(S )

K=i(s) Ecu .6

Ecu .2

l {Ldi (t )

dt ❑}+l {R i (t ) }=l {V (t ) }−l{K

d❑( t )

L }Ecu .7

L l{di (t )

dt ❑}+R l {i (t ) }=l {V (t ) }−K l{d❑( t )

L }Ecu .8

i (S )(LS+R)=V (s )−KS❑( S) ECU .9

o Ya teniendo la Ecuación a partir de la transformada de Laplace procedemos a

despejar a i(s)

V (S )−KS(S)

LS+R=i(s) Ecu.10

o Igualando Ecu.6 y Ecu.10

J S2❑(S)+bS❑(S )

K=

V (S )−KS(S)

LS+REcu .11

(J S2❑(S )+bS❑( S ))∗(LS+R)=K(V (S)−KS(S ) ¿Ecu.12

JL S3❑( S )+JR S2❑(S )+bL S2❑( S )+bRS❑( S)+K2 S❑(S )=KV (s ) Ecu .13

❑(S ) [JL S3+JR S2+bL S2+bRS+ K2 S ]=KV ( s) Ecu .14

CALCULO DE G(s)

o Despejando ❑(s ) y V (s)

❑(S)

V (s )= K

JL S3+¿¿

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

o Por tanto teniendo ésta relación, podemos algebraicamente simplificar la Ecu.15

G(s)=

KJL

1S3+(JR+bL)

JLS2+

(bR+K2)JL

S

Ecu .16

APLICACIÓN DE RESULTADOS EN MATLAB

CÓDIGO

%ECUACIÓN MECANICA Y ELECTRICA

clc,clear all,close all;

%Declaramos o asignamos valores a las a variables

J=0,01;b=0,1;K=0,01;R=1;L=0,5;

open('EME_1')%abre el modelosim('EME_1')%simula el modelo

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

DIAGRAMA DE BLOQUES

Figura 7. Diagrama de bloques un motor DC

Figura7.1 Subsistema del DIA.BLO. Para una respuesta paso

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE

GRAFICAS DE LA RESPUESTA DEL SISTEMA

Figura 8. Graficas de una respuesta Paso para el motor DC analizado

BIBLIOGRAFIA

Ingeniería de control moderna, 5ta edición, Katsuhico Ogata Ingeniería de control moderna, 4ta edición, Katsuhico Ogata Ingeniería de control moderna, 3ra edición, Katsuhico Ogata Sistemas de control moderno, 10ma edición, Dorf, Richard Señales y sistemas, Oppenheim

1

MODELOS MATEMATICOS EN FORMA DE EDL Y TRANSFORMADA DE LAPLACE