Finding the ramp response to a transfer function

231 次查看(过去 30 天)
If T is the transfer function defined below, how do you find the ramp response?
G = tf(poly([-2 -3]),poly([0 -1])); T=feedback(G,1)

采纳的回答

Mathieu NOE
Mathieu NOE 2021-3-17
You can use lsim function for any input
t=0:0.01:10
slope = 2;
ramp=slope*t; % Your input signal
G = tf(poly([-2 -3]),poly([0 -1])); T=feedback(G,1); % Your transfer function
[y,t]=lsim(G,ramp,t);
plot(t,y)
  2 个评论
Aleem Andrew
Aleem Andrew 2021-3-17
Thank you for your answer. Can you use lsim for a step input? I get an error message when I do so.
t=0:0.01:10;
slope = 2;
ramp=1; % Your input signal
G = tf(poly([-2 -3]),poly([0 -1])); T=feedback(G,1); % Your transfer function
[y,t]=lsim(G,ramp,t);
plot(t,y)
Mathieu NOE
Mathieu NOE 2021-3-18
hello
sure, but whatever the type of input signal, its dimensions must be the same as time vector (t)
I also changed the name of the input to avoid any confusion (it's not a ramp anymore)
so this is the correct code :
t=0:0.01:10;
mystep=1*ones(size(t)); % Your input signal
G = tf(poly([-2 -3]),poly([0 -1])); T=feedback(G,1); % Your transfer function
[y,t]=lsim(G,mystep,t);
plot(t,y)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by