2-21    已知某单位负反馈的开环传递函数为:

试在MATLAB环境下,分别求系统的单位脉冲响应和单位阶跃响应。

解:    因为系统的开环传递函数为G(s),反馈函数为H(s),所以系统的传递函数应为:

MATLAB代码如下:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Exercise 2-21 of the <principle of automatic control>, SCUT, Page 68    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%clear                                                                      % remove all varialbes from the workspaces
clc                                                                        % clear command windownum = [ 0, 0, 1, 2 ];                                                      % numerator of G(s)
den = [ 1, 5, 2, 1 ];                                                      % denominator of G(s)
sys_num = num;                                                             % numerator of system
sys_den = num + den;                                                       % denominator of system: Gf(s)=G(s)/[1+G(s)H(s)],H(s)=1%%%------------METHOD 1-----------------------------------------------------------------------------------------------------------------------------------%%%
figure(1);                                                                 % create a figure whose handle is 1
step( sys_num, sys_den );                                                  % the step response of system, then graph on figure(1)
hold on;                                                                   % hold on the graph
impulse( sys_num, sys_den );                                               % the impulse response of system, then graph on figure(1)
hold on;                                                                   % hold on againtitle( 'the Step Response and Impulse Response' );                         % title of the figure(1)
text( 20, 0.70,  'Step Response'  );                                       % show text 'Step Response' on [20,0.70]
text( 20, 0.03,  'Impulse Response'  );                                    % show text 'Impulse Response' on [20, 0.03]
grid on;                                                                   % show the grid point%%%------------METHOD 2-----------------------------------------------------------------------------------------------------------------------------------%%%
figure(2);                                                                 % create a figure whose handle is 2
t = 0:0.1:30;                                                              % create a arithmetic progression(time) from 0 to 30, common difference is 0.1
y1 = step( sys_num, sys_den, t );                                          % work out the step response of system then assign to vector y1
y2 = impulse( sys_num, sys_den, t );                                       % work out the impulse response of system then assign to vector y2
plot( t, y1, '--r', t, y2, '-b' );                                         % plot the vector y1 versus t(dashed, red), and vector y2 versus t(full, bule)axis([ 0, 30, -0.5, 1.5 ]);                                                % x axis from 0 to 30, y axis from -0.5 to 1.5
legend( 'Step Response', 'Impulse Response' );                             % place a legend on various types of graphs
title( 'Page 68, Exercise 2-21' );                                         % title of figure(2)
xlabel( 't/s' );                                                           % show the x axis lable
ylabel( 'ampitude' );                                                      % show the y axis lable
grid on;                                                                   % show the grid point%%%------------METHOD 3-----------------------------------------------------------------------------------------------------------------------------------%%%
figure(3);                                                                 % create a figure whose handle is 3
Gs = tf( num, den );                                                       % open-loop transfer function
Hs = 1;                                                                    % feedback transfer function
Gf = feedback( Gs, Hs, -1 );                                               % system transfer function, negative feedback: Gf(s)=G(s)/[1+H(s)G(s)]
step(Gf);                                                                  % the step response of system, then graph on figure(3)
hold on;                                                                   % hold on the graph
impulse(Gf);                                                               % the impulse response of system ,then graph on figure(3)
hold on;                                                                   % hold on again%%-----the following is the same as METHOD 1-----%%
title( 'the Step Response and Impulse Response' );                         % title of the figure(3)
text( 20, 0.70,  'Step Response'  );                                       % show text 'Step Response' on [20,0.70]
text( 20, 0.03,  'Impulse Response'  );                                    % show text 'Impulse Response' on [20, 0.03]
grid on;                                                                   % show the grid point

PS:

本人使用的是 MATLAB R2010a。当设置代码语言为中文时,发现注释很难对齐(可能中文字体下每个汉字或英文字母的宽度不一样);当设置代码语言为英文时,注释就可以像 VS 或 Keil 一样变得很工整,但中文注释变成乱码显示。百度之,发现鱼和熊掌不可兼得,狠心之下全用了英文注释。

后来发现,原来是设置字体的问题。本人比较偏爱的 Consolas 字体就无法显示中文注释以及 Current Folder 的中文路径,而一些中文字体比如宋体等就能够显示中文注释及中文路径,但存在上述对齐的问题。而某些字体比如 Microsoft JhengHei 就能够显示出中文的注释,而且不存在对齐的问题。

后来发现,对齐的问题还是存在的。。。

算了,以后都是用英文注释好了,反正 MATLAB 里头 Function Browser 都是英文的。当作能力的锻炼吧。

《自动控制原理》(胥布工版)习题2-21相关推荐

  1. 计算机控制系统顾树生课后答案,清华大学出版社-图书详情-《自动控制原理习题详解》...

    信息化时代的到来,为自动控制技术的应用开拓了更加广阔的空间.作为有关自动控制技术的基础理论--自动控制原理,已成为各高校许多学科和专业必修的技术基础课.深入理解和掌握<自动控制原理>中主要 ...

  2. 南航820自动控制原理高分分享

    本篇经验为转载. 随着社会的不断发展,各行业领域对于从业人员的学历要求越来越高,考取研究生也成为很多考生和家庭的刚需,因此近年来考研人数呈现爆炸性增长的态势,考研竞争越来越激烈!在这种形势下,独峰考研 ...

  3. 自动控制原理9.1---线性系统的状态空间描述(中下)

    参考书籍:<自动控制原理>(第七版).胡寿松主编. <自动控制原理PDF版下载> 1.线性系统的状态空间描述 1.4 线性定常连续系统状态方程的解 齐次状态方程的解 状态方程为 ...

  4. 自动控制原理7.7---离散系统的数字校正

    参考书籍:<自动控制原理>(第七版).胡寿松主编. <自动控制原理PDF版下载> 7.离散系统的数字校正 线性离散系统的设计方法:模拟化设计和离散化设计: 模拟化设计:把控制系 ...

  5. 【经典控制理论】| 自动控制原理知识点概要(上)

    参考资料 胡寿松<自动控制原理>第6版 刘豹<现代控制理论>第3版 斐润<自动控制原理> 哈工大控制学科803考研资料 前言 对于控制工程专业的我来说,经典控制理论 ...

  6. 自动控制原理7.5---离散系统的稳定性与稳态误差

    参考书籍:<自动控制原理>(第七版).胡寿松主编. <自动控制原理PDF版下载> 5.离散系统的稳定性与稳态误差 5.1 s s s域到 z z z域的映射 在 z z z变换 ...

  7. 自动控制原理9.1---线性系统的状态空间描述(中上)

    参考书籍:<自动控制原理>(第七版).胡寿松主编. <自动控制原理PDF版下载> 1.线性系统的状态空间描述 1.3 线性定常连续系统状态空间表达式的建立 建立状态空间表达式的 ...

  8. 2021南京航天航空大学820自动控制原理参考答案

    一.(来源自动控制原理学习辅导知识精粹习题详解考研真题--孙优贤)(式2-53中C2C_2C2​改为C1C_1C1​) 二. 1. 设PDPDPD控制器的传递函数 Gc(s)=Kp(1+τs)G_{c ...

  9. 自动控制原理2.2---控制系统的复数域数学模型

    参考书籍:<自动控制原理>(第七版).胡寿松主编. <自动控制原理PDF版下载> 1.传递函数定义及性质 控制系统的微分方程是在时间域描述系统动态性能的数学模型,在给定外作用及 ...

最新文章

  1. 如何将浮点型准确地转换成字符串
  2. python教学视频p_python接口自动化28requestshtml爬虫框架
  3. Boost:Bimap简单示例
  4. MyEclipse 10.5 安装SVN插件
  5. AKI-H8串口通信
  6. Java LocalDate类| 带示例的format()方法
  7. k8s创建Deployment报错:missing required field “selector“ in io.k8s.api.apps.v1.DeploymentSpec
  8. raspberry pi_Raspberry Pi项目旨在调节室温并改善睡眠
  9. Django讲课笔记09:使用QuerySet新增和更新数据
  10. 僵尸矩阵 · Zombie in Matrix
  11. Android Support Annotation Library使用详解
  12. 数据库用户管理(增删改查,即CRUD)
  13. 大师兄科研网_挑战杯经验分享会与你话科研
  14. 用VC2013编译了一个程序,在Windows 8、Windows 7(64位、32位)下都能正常运行。但在Win XP,Win2003下运行时,却报错不能运行
  15. python中的树数据结构
  16. MATLAB图像形状识别
  17. 感冒会引发腺样体肥大吗?
  18. PHP审计工具之 RIPS
  19. 计算机如何添加新用户,笔记本电脑怎么样快速添加新用户帐号
  20. 解决Windows缺少MSCOMCTL.OCX文件无法运行程序问题

热门文章

  1. c++ 单源最短路径-狄杰斯特拉算法
  2. M103: Basic Cluster Administration chapter 1 The Mongod学习记录
  3. M001: MongoDB Basics chapter 2 The MongoDB Query Language + Atlas学习记录
  4. 【JVM】LXF_深入理解JVM专题(1-4)
  5. HQ-610型超声波多普勒流量计
  6. 中值滤波、低通与高通滤波
  7. 华硕nas搭建网站服务器,NAS存储搭建网站服务器
  8. 荣耀note10鸿蒙系统刷机,华为鸿蒙系统首批升级机型名单
  9. 【离散数学】群论考核回顾
  10. 新版本WordPress快速收录推送插件(Fanly Submit)