版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Control System Simulation and CAD(Matlab language)Suzhen Wang课程介绍课程介绍双语教学目标: (1)掌握控制系统仿真的基本方法。 (2)掌握计算机仿真语言MATLAB的使用及程序设计方法,并能将其与相关专业课程相结合,进行系统建模、仿真和科学研究等。 (3) 培养与提高学习英文专业课程的能力。Matlab 编程语言的特点: 可以不必具备其它语言的基础,语法简单,上手容易,但函数繁多。课程安排课程安排J学时: 32学时J安排:授课20学时,上机12学时。J考核方式:平时成绩占10%,实验成绩占20%,期末成绩占70%。J期末考试形式待定
2、。教材教材 CONTROL SYSTEM SIMULATION AND CAD Thanks to OUYANG Xinyu and XU Shaochuan要求打印教材与实验指导书参考教材参考教材1.MATLAB Programming(Fourth Edition), Stephen J.Chapman著 , 科学出版社2.控制系统仿真与计算机辅助设计(第二版),薛定宇 著,机械工业出版社3.自动控制原理(第五版),胡寿松 主编,科学出版社4.Modern Control Systems (Eleven Edition), Richard C. Dorf & Robert H. B
3、ishop 著,电子工业出版社(中英文版均有,建议读英文版)5.MATLAB 帮助文档帮助文档6.Control System ToolboxGetting Started Guide -R2013a(电子版)(电子版)http:/ 中文论坛学习方法学习方法J温故而知新J实践出真知J扩展知识面J举一而反三前言前言 控制系统仿真基本概念控制系统仿真基本概念 控制系统的计算机仿真控制系统的计算机仿真是一门涉及到控制理论、计算数是一门涉及到控制理论、计算数学与计算机技术的综合性新型学科。学与计算机技术的综合性新型学科。 这门学科的产生及发展差不多是与计算机的发明及发展这门学科的产生及发展差不多是与计
4、算机的发明及发展同步进行的。同步进行的。 它包含控制系统分析、综合、设计、检验等多方面的计它包含控制系统分析、综合、设计、检验等多方面的计算机处理。算机处理。 计算机仿真基于计算机的高速而精确的运算,以实现各计算机仿真基于计算机的高速而精确的运算,以实现各种功能。种功能。 系统仿真系统仿真中的基本中的基本概念概念 系统系统:系统是物质世界中相互制约又相互联系着的、以期实现某:系统是物质世界中相互制约又相互联系着的、以期实现某种目的的一个运动整体,这个整体叫做系统。种目的的一个运动整体,这个整体叫做系统。 “ “系统系统”是一个很大的概念,通常研究的系统有工程系统和非工是一个很大的概念,通常研究
5、的系统有工程系统和非工程系统。程系统。 工程系统有:电力拖动自动控制系统、机械系统、水力、冶金、工程系统有:电力拖动自动控制系统、机械系统、水力、冶金、化工、热力学系统等。化工、热力学系统等。 非工程系统:宇宙、自然界、人类社会、经济系统、交通系统、非工程系统:宇宙、自然界、人类社会、经济系统、交通系统、管理系统、生态系统、人口系统等。管理系统、生态系统、人口系统等。 模型模型:模型是对所要研究的系统在某些特定方面的抽象。通过模:模型是对所要研究的系统在某些特定方面的抽象。通过模型对原型系统进行研究,将具有更深刻、更集中的特点型对原型系统进行研究,将具有更深刻、更集中的特点。 系系统仿真统仿真
6、:就是以系统数学模型为基础,以计算机为工:就是以系统数学模型为基础,以计算机为工具对系统进行实验研究的一种方法具对系统进行实验研究的一种方法。 要对系统进行研究,首先要建立系统的数学模型。对于一个简单的要对系统进行研究,首先要建立系统的数学模型。对于一个简单的数学模型,可以采用分析法或数学解析法进行研究,但对于复杂的系统,数学模型,可以采用分析法或数学解析法进行研究,但对于复杂的系统,则需要借助于仿真的方法来研究。则需要借助于仿真的方法来研究。 计计算机仿真三要素算机仿真三要素:系统、模型与计算机。它们之间的关系:系统、模型与计算机。它们之间的关系如下:如下: 仿真实验仿真实验数学模型建立数学
7、模型建立仿真模型建立仿真模型建立系统系统模型模型计算机计算机 数学模型建立数学模型建立:实际上是一个模型辩识的过程。所建模型常常是忽略:实际上是一个模型辩识的过程。所建模型常常是忽略了一些次要因素的简化模型。了一些次要因素的简化模型。 仿真模型建立仿真模型建立:即是设计一种算法,以使系统模型能被计算机接受并:即是设计一种算法,以使系统模型能被计算机接受并能在计算机上运行。显然,由于在算法设计上存在着误差,所以仿真模型能在计算机上运行。显然,由于在算法设计上存在着误差,所以仿真模型对于实际系统将是一个二次简化模型对于实际系统将是一个二次简化模型。(传递函数(传递函数Z Z变换,微分方程前向后向离
8、散化等)变换,微分方程前向后向离散化等) 仿真实验仿真实验:即是对模型的运算。需要设计一个合理的、服务于系统研:即是对模型的运算。需要设计一个合理的、服务于系统研究的仿真软件。究的仿真软件。 系统仿真技术实质上就是建立仿真模型并进行仿真实验的技术。系统仿真技术实质上就是建立仿真模型并进行仿真实验的技术。 系统仿真的基本过程:系统仿真的基本过程: (1 1)建立系统的数学模型;)建立系统的数学模型; (2 2)转换成仿真模型;)转换成仿真模型; (3 3)编写仿真程序;)编写仿真程序; (4 4)对仿真模型进行修改校验,看与实际系统是否一致,)对仿真模型进行修改校验,看与实际系统是否一致, 确认
9、模型的正确性;确认模型的正确性; (5 5)运行仿真程序,在不同的初始条件和参数下,对系统)运行仿真程序,在不同的初始条件和参数下,对系统 进行反复分析和研究。进行反复分析和研究。 控制控制系系统仿真的基本过程:统仿真的基本过程:1.1. 建立被控对象的建立被控对象的数学模型数学模型;( (传递函数,微分方程,状态空间表达式等)传递函数,微分方程,状态空间表达式等)2.2. 转转换成仿真模型换成仿真模型;3.3. 编编写仿真程序;写仿真程序;4.4. 对被控对象模对被控对象模型进行修改校验,看与实际系统是否一致型进行修改校验,看与实际系统是否一致, 确确认模型的正确性认模型的正确性;5.5.
10、在计算机辅助下,设计控制器在计算机辅助下,设计控制器(比如(比如PIDPID控制器等,校正,带有观测控制器等,校正,带有观测器的状态反馈控制器,自适应控制,智能控制等,可看做是串联在被控对象之前的一器的状态反馈控制器,自适应控制,智能控制等,可看做是串联在被控对象之前的一个数学模型)个数学模型);6.6. 运行控制系统仿运行控制系统仿真程序,在不同的初始条真程序,在不同的初始条件、参数、不件、参数、不同外界输入作用或者扰动下同外界输入作用或者扰动下,对系,对系统进统进行反复分析和研行反复分析和研究究(跟踪参考输入如阶跃响应,(跟踪参考输入如阶跃响应,BODEBODE图,根轨迹图等等,以考察控制
11、器的性能)图,根轨迹图等等,以考察控制器的性能);7.7. 将调试好的控制器应用到实际系统中。将调试好的控制器应用到实际系统中。Matlab作为美国 MathWorks公司开发的用于概念设计,算法开发,建模仿真,实时实现的理想的集成环境。是目前最好的科学计算类软件。作为和Mathematica、Maple并列的三大数学软件。其强项就是其强大的矩阵计算以及仿真能力。要知道Matlab的由来就是Matrix + Laboratory = Matlab,所以这个软件在国内也被称作矩阵实验室。每次MathWorks发布Matlab的同时也会发布仿真工具Simulink。在欧美很多大公司在将产品投入实际
12、使用之前都会进行仿真试验,他们所主要使用的仿真软件就是Simulink。Matlab提供了自己的编译器:全面兼容C以及Fortran两大语言。所以所以Matlab是工程师,科研工作者手上最好的语言,最好的工具和环境。是工程师,科研工作者手上最好的语言,最好的工具和环境。MATLAB简介实验六 控制系统PID 校正器设计法 Simulink 根轨迹与bode图Contents of this bookChapter 1 Introduction to MATLABChapter 2 Basic MATLAB CommandsChapter 3 Programming in MATLABChapt
13、er 4 Basic Plotting FunctionChapter 5 Application of MATLAB in Control System SimulationChapter 6 Simulink-Interactive and Integration EnvironmentChapter 7 Application of Automation Control System SimulationExperimentsChapter1 Introduction to MATLAB The Main Contents:The MATLAB Characteristics The M
14、ATLAB Environment Summary 1.1 The MATLAB Characteristics 1. The Advantages of MATLAB for Technical Programming MATLAB has many advantages compared to conventional computer languages for technical problem solving. Among them are: (1) Ease of Use (2) Platform Independence (3) Predefined Functions (预定义
15、函数) (4) Device-Independent Plotting (5) Graphical User Interface (图形用户界面) (6) MATLAB Compiler (1) Ease of UseMATLAB is an interpreted language, like many versions of Basic. Like Basic, it is very easy to use. Programs may be easily written, modified and debugged. Many program development tools are p
16、rovided to make the program easy to use.(2) Platform Independence MATLAB is supported on many different computer systems (Windows9x/NT/2000/XP/ UNIX), providing a large measure of platform independence.(3) Predefined Functions (预定义函数)MATLAB comes complete with an extensive library of predefined func
17、tions that provide tested and prepackaged solutions to many basic technical tasks.In addition to the large library of functions built into the basic MATLAB language, many specific-purpose toolboxes are available to help solve complex problems in specific areas.(4) Device-Independent Plotting Unlike
18、other computer languages, MATLAB has many integral plotting and imaging commands. The plots and images can be displayed on any graphical output device supported by the computer on which MATLAB is running. This capability makes MATLAB an outstanding tool for visualizing technical data.(5) Graphical U
19、ser Interface (图形用户界面)MATLAB includes tools that allow a programmer to interactively construct a graphical user interface (GUI) for his or her program. With this capability, the programmer can design sophisticated data analysis programs that can be operated by relatively inexperienced users.(6) MATL
20、AB Compiler A separate MATLAB compiler is available. This compiler can compile a MATLAB program into a true executable program that runs faster than the interpreted code. It is a great way to convert a prototype MATLAB program into an executable program suitable for sale and distribution to users.2.
21、 Disadvantages of MATLAB MATLAB is an interpreted(解释) language, and therefore can execute more slowly than compiled(编译) languages. This problem can be mitigated(解决) by properly structuring the MATLAB program and by the use of the MATLAB compiler to compile the final MATLAB program before distributio
22、n(发行) and general use. Expensive!编译后的文件扩展名为mex,它可以在计算机中直接执行,速度比M文件快。计算机不能直接理解高级语言,只能直接理解机器语言,所以必须要把高级语言翻译成机器语言,计算机才能执行高级语言编写的程序.翻译的方式有两种:一个是编译,一个是解释。编译型语言写的程序执行之前,需要一个专门的编译过程,把程序编译成为机器语言的文件,以后要运行的话就不用重复翻译了,直接使用编译的结果就行了。程序执行效率高,依赖编译器,跨平台性差些。如C、C+、Delphi等。解释型语言在运行程序的时候才翻译,专门有一个解释器去进行翻译,每个语句都是执行的时候才翻译。
23、效率比较低,依赖解释器,跨平台性好,如Basic。1.2 The MATLAB Environment The MATLAB development environment is a set of tools to help you use MATLAB functions and files. The three most important types of windows are Command Windows, Figure Windows and Edit/Debug Windows. In addition, MATLAB can display other windows tha
24、t provide help and that allow the user to examine the values of variables defined in memory.The MATLAB development environment is a set of tools to help you use MATLAB functions and files. Many of these tools are graphical user interfaces. The fundamental unit of data in any MATLAB program is the ar
25、ray. An array is a collection of data values organized into rows and columns, and known by single name.Individual data values within an array may be accessed by including the name of thearray followed by subscripts in parentheses that identify the row and column of theparticular value. Even scalars
26、are treated as arrays by MATLAB, they are simply arrays with only one row and one column. We will learn how to create and manipulate MATLAB arrays in Chapter 2.扩展1. The MATLAB Desktop The first time MATLAB starts, the desktop appears as shown in the following illustration(插图). Start Button and Launc
27、h Pad(启动平台) Run tools and access documentation for all of your MathWorks products. Command Window (命令窗口)Run MATLAB functions. Command History Window (命令历史窗口)View a log(日志) of the functions you entered in the Command Window, copy them, and execute them. Help Browser(帮助浏览器) View and search the documen
28、tation for the full family of MATLAB products. Current Directory Browser(当前路径窗口) View MATLAB files and related files, perform file operations such as open, and find content. Workspace Browser(工作空间浏览器) View and make changes to the contents of the workspace. Array Editor(阵列编辑器) View array contents in
29、a table format(表格格式) and edit the values. Editor/Debugger(编辑器/调试器) Create, edit, and debug M-files (files containing MATLAB functions).2. The Command Window The right hand side of the MATLAB desktop contains the Command Window. Users can enter interactive(交互式) commands at the command prompt (提示) in
30、the Command Window, and they will be executed on the spot(当场).Scratch pad 演草纸有时称为数学演算纸,即时可看到结果。(1) The Format Command The format(格式) command controls the numeric format of the values displayed by MATLAB. The command affects only how numbers are displayed, not how MATLAB computes or saves them. x = 4
31、/3 1.2345e-6 format short x=1.3333 0.0000 format short e x=1.3333e+000 1.2345e-006 format long x=1.33333333333333 0.00000123450000 format long e x=1.333333333333333e+000 1.234500000000000e-006 x = 4/3 1.2345e-6x = 1.3333 0.0000 format short xx = 1.3333 0.0000 format short e xx = 1.3333e+000 1.2345e-
32、006 format long xx = 1.33333333333333 0.00000123450000(2) Suppressing(禁止)(禁止) Output If you simply type a statement(语句) and press Return or Enter, MATLAB automatically displays the results on screen. However, if you end the line with a semicolon(;), MATLAB performs the computation but does not displ
33、ay any output. For example, a=magic(4); b=magic(3) ans = 8.00 1.00 6.00 3.00 5.00 7.00 4.00 9.00 2.00 加分号和不加分号时语句都执行了,只是是否显示结果的区别。 (3) Command Line Editing Various arrow(箭头) and control keys(控制键) on your keyboard allow you to recall(回顾), edit, and reuse commands you have typed earlier. The list of a
34、vailable command line editing keys is different on different computers. Experiment to see which of the following keys is available on your machine. 3. The Command History Window (1) Viewing Statements in the Command History Window ; (2) Deleting Entries(条目) in the Command History Window. 4. The Edit
35、/Debug Window An Edit/Debug Window is used to create M-files(M文件), or to modify existing ones. An Edit/Debug Window is created automatically when you create a new M-file or open an existing one. You can create a new M-file with the “File/New/M-file” selection from the desktop menu, or by clicking th
36、e Toolbar icon. You can open an existing M-file with the “File/Open” selection from the desktop menu or by clicking the Toolbar icon(工具栏图标). Instead of typing commands directly in the Command Window, a series of commands may be placed into a file, and the entire file may be executed by typing its na
37、me in the Command Window. Such files are called script files. Script files (and functions, which we will see later) are also known as M-files because the have a file extension of “.m”.5. Figure Windows(图形窗口)(图形窗口) MATLAB directs graphics output to a window that is separate from the Command Window. I
38、n MATLAB, this window is referred to as a figure. Graphics(制图) functions automatically create new figure windows if none currently exist. If a figure window already exists, MATLAB uses that window. If multiple figure windows exist, one is designated(指定) as the current figure and is used by MATLAB (t
39、his is generally the last figure used or the last figure you clicked the mouse in). The figure function creates figure windows. For example, t = 0:pi/100:2*pi; y = sin(t); plot(t,y) After creating a plot, you can make changes to it and annotate(注释) it with the Plot Editor, which is an easy-to-use gr
40、aphical interface. t = 0:pi/50:10*pi;plot3(sin(t),cos(t),t)axis square; grid on6. The MATLAB Workspace(工作空间)(工作空间) The MATLAB workspace contains a set of variables (named arrays) that you can manipulate(操作) from the MATLAB command line. You can use the who and whos commands to see what is currently
41、in the workspace. The who command gives a short list, while the whos command also gives size and data type information. Here is the output produced by whos on a workspace containing three variables of different data types. whos Name Size Bytes Class A 2x4 64 double array B 2x4 64 double array C 2x4
42、64 double array Grand total is 24 elements using 192 bytes (1) Opening the Workspace Browser To open the Workspace browser, select Workspace from the View menu in the MATLAB desktop, or type workspace at the Command Window prompt. The Workspace browser opens. (2) Viewing the Current Workspace The Wo
43、rkspace browser shows the name of each variable, its array size, its size in bytes, and the class. (3) Loading and Saving the Workspace MATLABs save(保存) and load (加载)commands let you save the contents of the MATLAB workspace at any time during a session and then reload the data back into MATLAB duri
44、ng that session or a later one. Load and save can also import and export text data files. For example, save june10 saves the entire workspace contents in the file june10.mat. If desired, you can save only certain variables by specifying the variable names after the filename. For example, save june10
45、 x y z saves only variables x, y, and z. load june10 x y7. Getting Help You can get help in MATLAB in three ways. The preferred method is to use the help Browser. You can start the Help Browser by selecting the Help icon from the desktop toolbar, or by typing helpdesk or helpwin in the Command Windo
46、w. There are also two command-line oriented ways to get help. The first way is to type help or help followed by a function name in the Command Window. lookfor(查找有类似单词的) 8. A Few Important Commands If you are new to MATLAB, a few demonstrations(示范或演示) may help to give you a feel for(摸索) its capabilit
47、ies(性能). To run MATLABs built-in (内置)demonstrations, type demo in the command Window.9. The MATLAB Path Manager (1) Purpose of the Search Path MATLAB uses a search path to find M-files and other MATLAB related files, which are organized in directories(目录) on your file system. Any file you want to ru
48、n in MATLAB must reside in a directory that is on the search path or in the current directory. By default, the files supplied with MATLAB and MathWorks toolboxes are included in the search path. If you create any MATLAB related files, add the directories containing the files to the MATLAB search pat
49、h.(2) Viewing and Setting the Search Path(设置搜索路径)(设置搜索路径) Use the Set Path dialog box to view and modify the MATLAB search path and see files in directories that are on the path. Select Set Path from the File menu, or type pathtool at the Command Window prompt. The Set Path dialog box opens. 搜索路径是一系列文件路径的组合。当程序和命令执行搜索路径是一系列文件路径的组合。当程序和命令执行时,时,MATLABMATLAB在搜索路径中查找程序或命令运行所需的函数在搜索路径中查找程序或命令运行所需的函数文件。文件。MATLABMATLAB在执行搜索时按照规定的顺序。如:在命令在执行搜索时按照规定的顺序。如:在命令窗口中输入窗口中输入exampleexample,MATLABMATLAB将按下面的将按下面的步骤步骤来处理:来处理:
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 家政服务人员合作合同协议2026
- 2026河南平顶山第五人民医院招聘2人备考题库含答案详解(轻巧夺冠)
- 曲麻莱县退役军人事务局2026年公益性岗位公开招聘备考题库及参考答案详解一套
- 2026年福建泉州石狮市行政服务中心管理委员会公开招聘工作人员备考题库附答案详解(达标题)
- 2026年度哈尔滨(春季) 通河县乡镇卫生院招聘医学毕业生5人备考题库完整答案详解
- 2026新疆第一师十三团医院人才招聘4人备考题库及完整答案详解
- 2026年牡丹江穆棱市特聘农技员招募8人备考题库及参考答案详解1套
- 2026湖北省长江新材有限公司社会招聘9人备考题库及答案详解(有一套)
- 2026年黄山市歙县消防救援大队公开招聘6名政府专职消防员备考题库及答案详解(夺冠系列)
- 2026江苏宿迁泗阳县招聘公办学校教师及紧缺急需教练员62人备考题库附答案详解(基础题)
- DB35T 1585-2021 电梯使用管理单位安全管理规则
- 体育与健康如何设计与开展跨学科主题学习活动以“我的运动画像为例”P义务教育课程方案和课程标准国家级示范培训课件
- 三十六计完整版本
- 电力服务收费标准附表
- 中药黄芪课件
- 深远海智能养殖装备平台
- 骨折病人的院前急救
- svw cpc验收srb311电气movifit sc操作手册
- 中大国际九号
- GB/T 14413-1993船用舷窗
- GB/T 14048.7-2016低压开关设备和控制设备第7-1部分:辅助器件铜导体的接线端子排
评论
0/150
提交评论