Sei sulla pagina 1di 8

N=[2 5]

D=[1 7 0 4]

N =
2 5
D =
1 7 0 4
H=tf(N,D)

H =

2 s + 5
---------------
s^3 + 7 s^2 + 4

Continuous-time transfer function.


whos

Name Size Bytes Class Attributes

D 1x4 32 double
H 1x1 1081 tf
N 1x2 16 double
ss(H)

ans =

a =
x1 x2 x3
x1 -7 0 -2
x2 2 0 0
x3 0 1 0

b =
u1
x1 2
x2 0
x3 0

c =
x1 x2 x3
y1 0 0.5 1.25

d =
u1
y1 0

Continuous-time state-space model.


whos

Name Size Bytes Class Attributes

D 1x4 32 double
H 1x1 1081 tf
N 1x2 16 double
ans 1x1 914 ss

help lsim

lsim - Simulate time response of dynamic system to arbitrary inputs

This MATLAB function produces a plot of the time response of the


dynamic system
model sys to the input history, t,u.

lsim(sys,u,t)
lsim(sys,u,t,x0)
lsim(sys,u,t,x0,method)
lsim(sys1,...,sysn,u,t)
lsim(sys1,PlotStyle1,...,sysN,PlotStyleN,u,t)
y = lsim(___)
[y,t,x] = lsim(___)
lsim(sys)

See also gensig, impulse, initial, linearSystemAnalyzer, lsiminfo,


sim,
step

Other uses of lsim


ident/lsim

La simulacion en el matlab se puede hacer con el comando lsim

1. Declaro el sistema dinamico

N=[1 1];
D=[1 3 2];

H=tf(N,D)

H =

s + 1
-------------
s^2 + 3 s + 2

Continuous-time transfer function.


step(H)
-

help step

step - Step response plot of dynamic system

This MATLAB function plots the step response of an arbitrary dynamic


system
model sys.

step(sys)
step(sys,Tfinal)
step(sys,t)
step(sys1,sys2,...,sysN)
step(sys1,sys2,...,sysN,Tfinal)
step(sys1,sys2,...,sysN,t)
y = step(sys,t)
[y,t] = step(sys)
[y,t] = step(sys,Tfinal)
[y,t,x] = step(sys)
[y,t,x,ysd] = step(sys)
[y,...] = step(sys,...,options)

See also impulse, initial, linearSystemAnalyzer, lsim,


stepDataOptions

Other uses of step


ident/step, simulink/step, simevents/sedb.step
Solucion utilizando la traansformada de Laplace
1 1
y (t )= e2t
2 2
t=0: .05:10;
y=0.5-0.5*exp(-2*t);
subplot (121); plot(t,y)
subplot(122); step(H,10)
Otra forma de obtener la solucion utilizando el comando step

[y,t]=step(H,10);

plot(t,y,'*')

Prob Nro 02 : En el problema anterior determine la respuesta al impulso unitario


Solucion:

La funcion de transferencia dela problema anterior venia dado por:

H =

s + 1
-------------
s^2 + 3 s + 2

Continuous-time transfer function.

La respuesta al impulso unitario es impulse


impulse(H)
Esta respuesta puede ser obtenida utilizando tambien la tranformada de laplace

Problema Nro 03

Introduciendo las matrices

A=[1 3 2; 3 4 -3; 2 -3 5];


B=[1 2 -2]';
C=[1 -3 2];
D=3;

sist=ss(A,B,C,D)

sist =

a =
x1 x2 x3
x1 1 3 2
x2 3 4 -3
x3 2 -3 5

b =
u1
x1 1
x2 2
x3 -2

c =
x1 x2 x3
y1 1 -3 2

d =
u1
y1 3

Continuous-time state-space model.


whos sist

Name Size Bytes Class Attributes

sist 1x1 914 ss

step(sist)

PROB 04

A=[1 0 2; 0 4 -3; 2 -3 5];


B=[1 0 2]';
C=[0 -3 5];
D=3;

sist1=ss(A,B,C,D)

sist1 =

a =
x1 x2 x3
x1 1 0 2
x2 0 4 -3
x3 2 -3 5
b =
u1
x1 1
x2 0
x3 2

c =
x1 x2 x3
y1 0 -3 5

d =
u1
y1 3

Continuous-time state-space model.

impulse(sist1)

Potrebbero piacerti anche