(2)在simulink中建立如下模型:
编写M文件如下:
%计算闭环系统的传递函数: num=[10]; den=[1 5 10];
[numc,denc]=cloop[num,den]
[y,t,x]=step(numc,denc) %求系统的阶跃响应 执行结果: numc =
0 0 10 denc =
1 5 20
%即闭环系统的传递函数为:S=y = 0 0.0023 0.0090
10s2+5s+20
0.0196 0.0334 0.0502 0.0693 0.0904 0.1130 0.1369 0.1616 0.1869 0.2124 0.2379 0.2632 0.2880 0.3121 0.3355 0.3579 0.3794 0.3996 0.4187 0.4366 0.4531 0.4684
0.4824 0.4950 0.5064 0.5165 0.5255 0.5332 0.5399 0.5454 0.5500 0.5536 0.5564 0.5584 0.5596 0.5601 0.5600 0.5594 0.5583 0.5568 0.5549 0.5527 0.5502 0.5475
0.5447 0.5418 0.5388 0.5357 0.5326 0.5296 0.5266 0.5236 0.5208 0.5180 0.5154 0.5129 0.5106 0.5084 0.5063 0.5044 0.5027 0.5011 0.4997 0.4984 0.4973 0.4963
0.4955 0.4948 0.4942 0.4937 0.4933 0.4931 0.4929 0.4928 0.4928 0.4928 0.4929 0.4931 0.4933 0.4936 0.4939 0.4942 0.4945 0.4948 0.4952 0.4956 0.4959 0.4963