Function File: y= lsim (sys, u, t)
Parámetros
- sys: Sistema invariante en el tiempo (LTI).
- u: Vector de señal de entrada. Debe ser del mismo largo de filas que el vector de tiempos y el mismo largo que entradas de columnas.
- t: Vector de tiempos espaciado uniformemente.
Salida
y: Vector de respuesta de salida. Tiene tantas filas como el largo de t y tantas columnas como salidas.
Proceso:
Creamos un vector con los digitos del numerador, y un vector con los digitos del denominador y creamos un sistema con ellos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num = [0 0 10 10]; | |
den = [1 4 0 0]; | |
sys = tf(num, den); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = 0:0.1:5; | |
r = 0.5*t.^2; |
Ahora podemos utilizar la función lsim para obtener la salida del sistema, dando como parametros el sistema, el vector de tiempos y vector de entrada.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y = lsim(sys, r, t); |
Después graficamos los resultados:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plot(t, r, "-",t, y, "o"); | |
grid; | |
title('Respuesta a la Aceleracion unitaria del sistema'); | |
xlabel('t segundos'); | |
ylabel('Aceleracion Unitaria'); | |
text(0.7, 4.5, 'Curva de Respuesta'); |
Resultado:
Fine by me; 15 pts.
ResponderEliminar