Simulation of Discrete time transfer function

Given a transfer function like 1 / (1-z^(-1)), and a ExperimentInput.mat file where the values are in step size 1ms. How do I run a simulation similar to lsim for a s-domain transfer function?

 Respuesta aceptada

Raj
Raj el 12 de Abr. de 2019

0 votos

Correct me if I am wrong but i think "lsim" works for both continuous (S Domain) and discrete (Z Domain) transfer functions.
"The command lsim(sys,U,T,X0) plots the time response of a linear time-invariant system. This system can be continuous or discrete. For a continuous-time system, the differential equation is integrated from time T(0) to T(length(T)), starting at the initial condition X0 and using the input U. The input vector must have the same number of entries as the time vector. If the initial conditions are all zero, X0 may be omitted.
For a discrete-time system, U should be sampled at the same rate as the system (T is then redundant and may be omitted or set to the empty matrix, i.e. [ ])."

3 comentarios

Bernie Ngoh
Bernie Ngoh el 12 de Abr. de 2019
@Raj
So my code:
lsim(sys,SpecialExperimentOutput_num(:,1),TimeVector_num);
with sys being a discrete time transfer function,
SpecialExperimentOutput_num being a 4600x1 array sampled at 1ms and
TimeVector_num = (0:0.001:4.599);
will run properly?
Raj
Raj el 12 de Abr. de 2019
Editada: Raj el 12 de Abr. de 2019
Just use
lsim(sys,SpecialExperimentOutput_num,TimeVector_num)
your input SpecialExperimentOutput_num should be 1x4600 i.e. take a transpose of your original data because TimeVector_num = (0:0.001:4.599); will give you a 1x4600 matrix. OR you can take transpose of your time matrix and keep input as it is.
works perfectly!
Bernie Ngoh
Bernie Ngoh el 12 de Abr. de 2019
Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Productos

Versión

R2018b

Preguntada:

el 12 de Abr. de 2019

Editada:

Raj
el 12 de Abr. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by