MATLAB 系统仿真与建模(五)—— 瞬态响应分析-冲激响应

前置阅读:MATLAB 系统仿真与建模(四)—— 瞬态响应分析-阶跃响应

关于什么是冲激输入读者可以去了解自动控制原理与信号与系统

2 冲激响应

2.1 获取冲激响应的第一种方法

impulse(num,den)  % 在屏幕上绘制冲激响应    
% impulse(sys)   
impulse(A,B,C,D)  % 在屏幕上绘制状态空间方程系统的冲激响应
% 剩下的与上一篇关于阶跃响应是同一个道理
impulse(num,den,t)  % t 为仿真终止时间     
% impulse(sys,t)
y = impulse(num,den)     
% y = impulse(sys)
[y,t]   = impulse(num,den,t)    
% [y,t) = impulse(sys,t) 
[y,x,t) = impulse(num,den)
[y,x,t] = impulse(num,den,t)
[y,x,t] = impulse(A,B,C,D)
[y,x,t] = impulse(A,B,C,D,iu)
[y,x,t] = impulse(A,B,C,D,iu,t)

举个例子, 如下面这个系统
C ( s ) R ( s ) = G ( s ) = 1 s 2 + 0.2 s + 1 {\frac{C(s)}{R(s)}}=G(s)={\frac 1{s^2+0.2s+1}} R(s)C(s)=G(s)=s2+0.2s+11
则代码如下:

num = [1];
den = [1 0.2 1];
impulse(num,den); 
grid
title('Unit-lmpulse Response of G(s) = 1/(s^2 + 0.2s + 1)')

我们可以看到 MATLAB 输出为:

在这里插入图片描述

2.2 获取冲激响应的第二种方法

我们知道,当初始条件为 0 0 0 时, G ( s ) G( s ) G(s) 的单位冲激响应 与 s G ( s ) sG(s) sG(s) 的单位阶跃响应相同。

猜你喜欢

转载自blog.csdn.net/weixin_43229030/article/details/110817093