传递函数-微分方程-差分方程-Matlab阶跃响应曲线
Transfer function:
\[\frac{1}{Ts+1}
\]
写成微分方程:
\[Ty'(t)+y(t)=u(t)
\]
向前差分:
\[y'(t) = \frac{y(t+1)-y(t)}{\Delta T} \\
y(t+1)=y(t)+\frac{\Delta T}{T}(u(t)-y(t))
\]
T:Sample time
向后差分:
\[y'(t) = \frac{y(t)-y(t-1)}{\Delta T} \\
y(t)=\frac{T}{T+\Delta T}y(t-1)+\frac{\Delta T}{T+\Delta T}u(t) \\
y(t)=y(t-1)+\frac{\Delta T}{T+\Delta T}(u(t)-y(t-1))
\]
中心差分:
\[y'(t)=\frac{y(t+1)-y(t-1)}{2\Delta T}\\
y(t+1)=y(t-1)+\frac{2\Delta T}{T}(u(t)-y(t))
\]
Matlab阶跃响应:
G1=tf([1],[5 1]);
step(G1) %连续传递函数阶跃响应曲线
hold on
G2=c2d(G1,0.1,'zoh');
step(G2) %离散传递函数阶跃响应曲线
hold on
T=0.1;
G3=tf([T],[5 T-5],T); %向前差分函数阶跃响应曲线
step(G3)
hold on
G4=tf([T],[5+T -5],T)
step(G4) %向后差分函数阶跃响应曲线