Está en la página 1de 18

UNIVERSIDAD NACIONAL DE SAN AGUSTIN AREQUIPA

FACULTAD DE INGENIERIA DE PRODUCCIN Y SERVICIOS


ESCUELA PROFESIONAL DE INGENIERA ELECTRNICA

CURSO

: Teora de Control Automtico I

TEMA

: Simulacin Numrica

ALUMNOS

: Chambi Mamani Pedro Omar


Dueas Guardia Victor

2009

1.

Ecuaciones diferenciales (repetir la siguiente actividad).


Determine la ecuacin diferencial

y =

[ 1 y ( t ) ]
2

usando el mtodo de Euler.

Plotear el grafico de y (t) , en funcin de t , y el grafico de la solucin


exacta y e (t) en funcin de t .
Instante inicial: t=0 , Instante final: t f =10
Solucin exacta de la ecuacin diferencial:
-

y e ( t )=1e

t
(1 )
2

Definimos d1.m

function[ydot]=edo1(y)
ydot=(1-y)/2
t(1)=0;
tf=10;
y(1)=0;
ye(1)=0;
h=0.5;
n=round(tf/h);
for i=1:n
t(i+1)=t(i)+h;
ydot(i)=edo1(y(i));
y(i+1)=y(i)+h*ydot(i);
ye(i+1)=1-exp(-t(i+1)/2);
end
ydot(n+1)=edo1(y(n+1));
plot(t,y,t,ye,'r:');
legend('Solucin Exacta','Solucin Numerica-Euler')
title('Comparacin entre la Solucin Exacta y la Solucin Numerica')
xlabel('tiempo');ylabel('amplitud')

Grfica

Comparacin entre la Solucin Exacta y la Solucin Numerica

Solucin Exacta
Solucin Numerica-Euler

0.9
0.8
0.7

amplitud

0.6
0.5
0.4
0.3
0.2
0.1
0

5
tiempo

10

2.

Repita las instrucciones:

F.T. H(s)=1/(s+1)
h=tf(1,[1 1])
g=ss([0 1;-5 -2],[0;3],[0 1],0)
[num,den]=ss2tf([0 1;-5 -2],[0;3],[0 1],0)
g=tf(16,[1 9 16])
subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(224)
nyquist(g)

Bode Diagram

0
-50
-100
0
-90
-180

0.5
0
-0.5
-1
-8

10

Pole-Zero Map

1
Imaginary Axis

Phase (deg)Magnitude (dB)

Transfer Function
16
2
s + 9 s+16

10

-6

-4

Step Response

Imaginary Axis

Amplitude

0.5

0.5

1.5

Time (sec)

Real Axis

Frequency (rad/sec)
1

-2

2.5

Nyquist Diagram

0.5
0
-0.5
-1
-1

-0.5

0
Real Axis

0.5

3.

Ejercicio: Realice la simulacin numrica de la ecuacin diferencial


descrita en el item1; Esta vez implemente el algoritmo RK4, en vez del
mtodo Euler. Haga una comparacin entre las soluciones: exacta, Euler
y RK4.

function[f]=rk(x,y);
f=(1-y)/2;
x(1)=0;
tf=10
y(1)=0;
ye(1)=0;
h=0.5;
n=round(tf/h);
for

i=1:n;

k1=f(x(i),y(i));
k2=f(x(i)+h/2,y(i)+h/2*k1);
k3=f(x(i)+h/2,y(i)+h/2*k2);
k4=f(x(i)+h,y(i)+h*k3);
y(i+1)=y(i)+h/6*(k1+2*k2+2*k3+k4);
x(i+1)=x(i)+h;
ye(i+1)=1-exp(-t(i+1)/2);
end
ydot(n+1)=rk(y(n+1));
plot(x,y,x,ye,'r:');
legend('solucin exacta','solucin numerica-Euler');
title('Comparacion entre la solucin exacta y la solucin numerica')
xlabel('Tiempo(s)')
ylabel('Amplitud( )')

comparacion entre la solucion exacta y la solucion numerica

solucion exacta
solucion numerica-euler

0.9
0.8

amplitud()

0.7
0.6
0.5
0.4
0.3
0.2
0.1
0

4.

5
tiempo(s)

10

Ejercicio: Repetir uno , usando la ecuacin diferencial (no lineal)


siguiente:
y=2.5[y(1-y)]
final :

y(0)=0.9 Condicin inicial h=0.85 paso tf=600s instante

function[ydot]=edo1(y)
ydot=2.5*y*(1-y)
t(1)=0;
tf=600;
y(1)=0.9;
ye(1)=0.9;
h=0.85;
n=round(tf/h);
for i=1:n
t(i+1)=t(i)+h;
ydot(i)=edo1(y(i));
y(i+1)=y(i)+h*ydot(i);
ye(i+1)=1-exp(-t(i+1)/2);
end
ydot(n+1)=edo1(y(n+1));
plot(t,y,t,ye,'r:');
legend('solucin exacta','solucin numerica-euler')
title('comparacion entre la solucin exacta y la solucin numerica')
xlabel('tiempo(s)');ylabel('amplitud()')

comparacion entre la solucion exacta y la solucion numerica

1.3

solucion exacta
solucion numerica-euler

1.2
1.1

amplitud()

1
0.9
0.8
0.7
0.6
0.5
0.4
0

5.

100

200

300
400
tiempo(s)

500

600

700

Ejercicio: reducir el diagrama de bloques de la figura 2 y expresar la F.T. entre C y


R en funcin de ( G1,G2 y H ).
G1

+
R

G2

Solucin:

C
C

R
R

G2
1+G2*H

G1+G2
1+G2*H

1+G1
G2

Ejercicio: el propsito de estos ejercicios es familiarizarse con las funciones de


transferencia, su representacin y respuesta. Ud. Podr explorar la relacin entre la
localizacin de polos y zeros, la respuesta temporal y la respuesta frecuencial.Por tanto,
para las siguientes funciones de transferencia grafique (i)el diagrama de polos y zeros
(ii)el diagrama de bode y (iii)la respuesta escaln unitario.
a)Transfer function:
1
----s+1

Bode Diagram

Imaginary Ax is

Phas e (deg)
Magnitude (dB)

g=tf([1],[1 1])
subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-20
-40
0
-45
-90
-2
10

0.5
0
-0.5
-1
-1

10

Pole-Zero Map

10

-0.5

Step Response

Imaginary Ax is

0.5

2
Time (sec)

Real Axis

Frequency (rad/sec)

Am plitude

6.

Nyquist Diagram

0.5
0
-0.5
-1
-1

-0.5

0
Real Axis

0.5

b)
Transfer function:
2
---------------s^2 + 3 s + 2

Bode Diagram

-50

Imaginary Axis

Phase (deg)Magnitude (dB)

g=tf([2],[1 3 2])
subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-100
0
-90
-180
-2
10

0.5
0
-0.5
-1
-2

10

10

Pole-Zero Map

-1.5

Step Response

Imaginary Axis

Amplitude

0.5

2
Time (sec)

-0.5

Real Axis

Frequency (rad/sec)
1

-1

Nyquist Diagram

0.5
0
-0.5
-1
-1

-0.5

0
Real Axis

0.5

c1)
Transfer function:
s-2
------2s+1

Bode Diagram

10

Imaginary Axis

Phase (deg)Magnitude (dB)

g=tf([1 -2],[2 1])


subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-10
180
90
0
-2
10

0.5
0
-0.5
-1
-1

10

Pole-Zero Map

10

Step Response

Imaginary Axis

Amplitude

0
-1
-2

5
Time (sec)

10

Real Axis

Frequency (rad/sec)
1

Nyquist Diagram

1
0
-1
-2
-2

-1

0
Real Axis

c2)
Transfer function:
s+2
------2s+1

Bode Diagram

10

Imaginary Axis

Phase (deg)Magnitude (dB)

g=tf([1 2],[2 1])


subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-10
0
-20
-40
-2
10

0.5
0
-0.5
-1
-2

10

10

Pole-Zero Map

-1.5

-1

Frequency (rad/sec)
Step Response

1
Imaginary Axis

Amplitude

2
1.5
1
0.5

5
Time (sec)

10

-0.5

Real Axis
Nyquist Diagram

0.5
0
-0.5
-1
-1

1
Real Axis

d)
Transfer function:
25
-------------s^2 + 2 s + 25

Bode Diagram

100
0
-100
0
-90
-180
-1
10

10

10

Pole-Zero Map

5
Imaginary Axis

Phase (deg) Magnitude (dB)

g=tf([25],[1 2 25])
subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-5
-1

10

-0.5

Frequency (rad/sec)
Step Response

Imaginary Axis

Amplitude

1
0.5
0

2
Time (sec)

Nyquist Diagram

1.5

Real Axis

2
0
-2
-4
-2

-1

0
Real Axis

e)
Transfer function:
25 s
-------------s^2 + 2 s + 25

Bode Diagram

50
0
-50
90
0
-90
-1
10

10

10

Pole-Zero Map

5
Imaginary Axis

Phase (deg)Magnitude (dB)

g=tf([25 0],[1 2 25])


subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-5
-1

10

-0.5
Real Axis

Frequency (rad/sec)
Step Response

2
0
-2

2
Time (sec)

Nyquist Diagram

10
Imaginary Axis

Amplitude

5
0
-5
-10
-5

5
Real Axis

10

15

f)
Transfer function:
5 s + 25
-------------s^2 + 2 s + 25

Bode Diagram

50

Imaginary Axis

Phase (deg)

Magnitude (dB)

g=tf([5 25],[1 2 25])


subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-50
180
0

-180
-1
10

10

10

-5
-6

10

Pole-Zero Map

-4

Step Response

4
Imaginary Axis

Amplitude

1.5
1
0.5
0

2
Time (sec)

Real Axis

Frequency (rad/sec)
2

-2

Nyquist Diagram

2
0
-2
-4
-2

2
Real Axis

g1)
Transfer function:
25
----------------------s^3 + 3 s^2 + 27 s + 25

Bode Diagram

-50

Imaginary Axis

Phase (deg)Magnitude (dB)

g=tf([25],[1 3 27 25])
subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-100
0
-180
-360
-2
10

-5
-1.5

10

10

Pole-Zero Map

-1

Step Response

Imaginary Axis

Amplitude

0.5

2
Time (sec)

Real Axis

Frequency (rad/sec)
1

-0.5

Nyquist Diagram

0.5
0
-0.5
-1
-1

-0.5

0
Real Axis

0.5

g2)
Transfer function:
125
-----------------------s^3 + 7 s^2 + 30 s + 125

Bode Diagram

200

Imaginary Axis

Phase (deg)Magnitude (dB)

g=tf([125],[1 7 30 125])
subplot(2,2,1)
bode(g)
subplot(2,2,2)
pzmap(g)
subplot(2,2,3)
step(g)
subplot(2,2,4)
nyquist(g)

-200
0
-180
-360

-5
-6

10

10

Pole-Zero Map

-4

Step Response

Imaginary Axis

Amplitude

1
0.5
0

4
Time (sec)

Real Axis

Frequency (rad/sec)
1.5

-2

Nyquist Diagram

2
0
-2
-4
-4

-2

0
Real Axis

También podría gustarte