Sei sulla pagina 1di 8

Problema 1

Programa 1

% PROBLEMA 1.
%incico a)
t=0:0.1:30;
x=5-5.*exp(-t)-5.*t.*exp(-t);
m=1;b=2;k=1;
n=1;d=[m b k];
g=tf(n,d);
step(5*g),hold on, plot(t,x,'g'),legend('Respuesta FT','respuesta
con expresion en el tiempo'),...
,xlabel('Tiempo [s]'),ylabel('Desplazamiento [m]'),grid,hold
off

inciso b)

x=0.1.*t.*exp(-t);
figure(2)
plot(t,x),xlabel('Tiempo [s]'),ylabel('Desplazamiento [m]'),grid

%inciso c)

x=-2+t+2.*exp(-t)+t.*exp(-t);
figure(3)
n=1; d=[m b k 0]

g=tf(n,d);
step(g),hold on, plot(t,x,'r'),axis([-inf 30 -inf 35]),xlabel('Tiempo
[s]'),...
,ylabel('Desplazamiento [m]'),grid

Figura del inciso A)

Figura del inciso b)


Figura del c)

Programa 2
% PROBLEMA 2.
clear all, close all, clc
syms m b k s
A=[0 1;0 -b/m];
B=[0;1/m];
C=[1 0];
D=0;
I=[s 0;0 s];
G1=C*(I-A)^(-1)*B+D
pretty(G1)
m=1;
b=3;

n=1;
d=[m b];
G2=tf(n,d);
F=5; %U(s)
figure(1)
step(F*G2), ,xlabel('Tiempo [s]'),ylabel('Desplazamiento [m]'),grid
figure (2)
m=1;
b=3;

A=[0 1;-0 -b/m];


B=[0;1/m];
C1=[1 0];
C2=[0 1];
G1=ss(A,B,C1,D)
G2=ss(A,B,C2,D)
step(s*G1),hold on, step(S*G2),legend('Posicion','Velocidad'),hold
off,...
,xlabel('Tiempo [s]'),grid
[num,den]=ss2tf(A,B,C1,D)
Problema 3
% PROBLEMA 2.
clear all, close all, clc
syms m b k s
A=[0 1;-k/m -b/m];
B=[0;1/m];
C=[1 0];
D=0;
I=[s 0;0 s];
G1=C*(I-A)^(-1)*B+D
pretty(G1)
m=1;
b=3;
k=10;
n=1;
d=[m b k];
G2=tf(n,d);
F=5; %U(s)
figure(1)
step(F*G2), ,xlabel('Tiempo [s]'),ylabel('Desplazamiento [m]'),grid
figure (2)
m=1;
b=3;
k=10;
A=[0 1;-k/m -b/m];
B=[0;1/m];
C1=[1 0];
C2=[0 1];
G1=ss(A,B,C1,D)
G2=ss(A,B,C2,D)
step(s*G1),hold on, step(S*G2),legend('Posicion','Velocidad'),hold
off,...
,xlabel('Tiempo [s]'),grid
[num,den]=ss2tf(A,B,C1,D)
Problema 3

Potrebbero piacerti anche