ImageVerifierCode 换一换
格式:DOCX , 页数:71 ,大小:318.23KB ,
资源ID:6903704      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6903704.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(计算机仿真讲义080301.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

计算机仿真讲义080301.docx

1、计算机仿真讲义080301计算机仿真教案主讲教师:欧阳鑫玉电子与信息工程学院二零一零年八月二十八日课程介绍: 定位:专业基础选修课(双语教学) 目标:掌握计算机仿真语言MATLAB的使用及程序设计方法,并能将其与相关专业课程相结合,进行系统建模、仿真和科学研究等。参考教材:1.CONTROL SYSTEM SIMULATION AND CAD(自编英文教材, 下载地址:2.系统仿真分析与设计MATLAB语言工程应用,黄文梅等,国防科技大学出版社;3.MATLAB6.1使用指南(上册),苏金明等,电子工业出版社。讲义:自编特点:可以不必具备其它语言的基础,语法简单,上手容易,但函数繁多。课程安排

2、:学时: 32学时安排:授课20学时(10周),上机12学时(6周)。要求:不得缺勤;上课遵守纪律;实验报告必须齐备;按时交作业。答疑:双周周二下午1:30-3:30;或网上答疑.考核方式:平时成绩占10%,实验成绩占20%,期末成绩占70%。期末考试为闭卷上机考试。授课计划:周别课 堂 教 学课外作业星期时数教 学 内 容教学方式布置作业题数复习及作业所需时间112Chapter 1 Introduction to MATLAB讲授、CAI12212Chapter 2 Basic Matlab Commands讲授、CAI223122.4 Colon Operator and Submatr

3、ices2.5 ExpressionsChapter 3 Programming in Matlab讲授、CAI32412实验一、MATLAB环境的熟悉与基本运算讲授、操作15123.3 Matlab Scripts (M-files)3.4 Matlab Function3.5 Debugging a Matlab M-file3.6 Programming Tips讲授、CAI22612实验二、MATLAB语言的程序设计设计、操作1712Chapter 4 Basic Plotting Function讲授、CAI228124.2 Basic Plotting Commands4.3 La

4、beling Graphs4.4 Printing Graphics Chapter 5 Aplication of Matlab in Control System Simulation讲授、CAI22912实验三、MATLAB的图形绘制设计、操作110125.4 Model Conversion5.5 System Interconnections讲授、CAI3211125.6 State-Space Realizations5.7 Time and Frequency Response5.8 Root Locus DesignChapter 6 SimulinkInteractive a

5、nd Integration Environment讲授、CAI221212实验四、控制系统的频域和时域分析设计、操作113126.5 Creating and Masked Subsystem讲授、CAI221412实验五、采用SIMULINK的系统仿真设计、操作11512Chapter7 PID Control讲授、CAI221612实验六、控制系统PID校正器设计法设计、操作1目 录目录 3前言 计算机仿真基本概念 5Chapter1 Introduction to MATLAB 71.1 The MATLAB Characteristics 71.2 The MATLAB Enviro

6、nment 71.3 Summary 14Exercise: 15Chapter 2 Basic Matlab Commands 162.1 How to run Matlab 162.2 Matrices(矩阵) 162.3 Scalar, Vector and Matrix Functions 192.4 Colon Operator and Submatrices 202.5 Expressions 21Exercise: 23Chapter 3 Programming in Matlab 243.1 Relational and Logical Operators 243.2 Flow

7、 Control 253.3. Matlab Scripts (M-files) 283.4. Matlab Function 283.5. Debugging a Matlab M-file 293.6 Programming Tips (self-study) 30Exercise: 30Chapter4 Basic Plotting Function 324.1 Figure Windows and Axes 324.2 Basic Plotting Commands 334.3 Labeling Graphs 404.4 Printing Graphics 42Exercise: 42

8、Chapter 5 Aplication of Matlab in Control System Simulation 435.1 LTI Models Introduction 435.2 Creating LTI Models 455.3 LTI Properties 505.4 Model Conversion 515.5 System Interconnections 515.6 State-Space Realizations 525.7 Time and Frequency Response 535.8 Root Locus Design 55Exercise: 56Chapter

9、 6 Simulink-Interactive and Integration Environment 586.1 Introduce 586.2 Building a Simple Model 586.3 Basic Operation and General Knowledge 616.4 Introduce to Library and Its Function 616.5 Creating and Masked Subsystem 62Exercise: 64Chapter7 PID Control 657.1 Proportional-Integral-Derivative Cont

10、rol 657.2 Automatic tuning 66Exercise: 68前言 计算机仿真基本概念 控制系统的计算机仿真是一门涉及到控制理论、计算数学与计算机技术的综合性新型学科。这门学科的产生及发展差不多是与计算机的发明及发展同步进行的。它包含控制系统分析、综合、设计、检验等多方面的计算机处理。计算机仿真基于计算机的高速而精确的运算,以实现各种功能。基本概念系统:系统是物质世界中相互制约又相互联系着的、以期实现某种目的的一个运动整体,这个整体叫做系统。 “系统”是一个很大的概念,通常研究的系统有工程系统和非工程系统。 工程系统有:电力拖动自动控制系统、机械系统、水力、冶金、化工、热力

11、学系统等。 非工程系统:宇宙、自然界、人类社会、经济系统、交通系统、管理系统、生态系统、人口系统等。 模型:模型是对所要研究的系统在某些特定方面的抽象。通过模型对原型系统进行研究,将具有更深刻、更集中的特点。 模型分为物理模型和数学模型两种。数学模型可分为机理模型、统计模型与混合模型。 系统仿真:就是以系统数学模型为基础,以计算机为工具对系统进行实验研究的一种方法。 要对系统进行研究,首先要建立系统的数学模型。对于一个简单的数学模型,可以采用分析法或数学解析法进行研究,但对于复杂的系统,则需要借助于仿真的方法来研究。 仿真就是模仿真实的事物,也就是用一个模型(包括物理模型和数学模型)来模仿真实

12、的系统,对其进行实验研究。用物理模型来进行仿真一般称为物理仿真,它主要是应用几何相似及环境条件相似来进行。而由数学模型在计算机上进行实验研究的仿真一般则称为数字仿真。我们这里讲的是后一种仿真。 数字仿真是指把系统的数学模型转化为仿真模型,并编成程序在计算机上投入运行、实验的全过程。通常把在计算机上进行的仿真实验称为数字仿真,又称计算机仿真。 计算机仿真三要素:系统、模型与计算机。它们之间的关系如下: 数学模型建立:实际上是一个模型辩识的过程。所建模型常常是忽略了一些次要因素的简化模型。 仿真模型建立:即是设计一种算法,以使系统模型能被计算机接受并能在计算机上运行。显然,由于在算法设计上存在着误

13、差,所以仿真模型对于实际系统将是一个二次简化模型。 仿真实验:即是对模型的运算。需要设计一个合理的、服务于系统研究的仿真软件。系统仿真技术实质上就是建立仿真模型并进行仿真实验的技术。 系统仿真的基本过程: (1)建立系统的数学模型; (2)转换成仿真模型; (3)编写仿真程序; (4)对仿真模型进行修改校验,看与实际系统是否一致,确认模型的正确性; (5)运行仿真程序,在不同的初始条件和参数下,对系统进行反复分析和研究。 Chapter1 Introduction to MATLAB The Main Contents: The MATLAB Characteristics The MATLA

14、B Environment Summary 1.1 The MATLAB Characteristics 1. 1.1 The Advantages of MATLAB for Technical ProgrammingMATLAB 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 . 1.1 MATLAB编程技术的优势MATLAB具有许多优势相比传统的计算机语言技术解决问题。其中包括:(1)易用性(2)平台独立性(3)预定义函数(预定函数)(4)与设备无关的策划(5)图形用户界面(图形用户界面)(6)MATLAB编译器 1.1.2 Disadvantages of MATLAB MATLAB is an interpreted(解释) language, and therefore ca

16、n 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 distribution(发行) and general use. MATLAB是一种解释(解释)语言,因此可以执行更慢比编译(编译)的语言。可以减轻这一问题(解决)妥善安排MATL

17、AB程序,通过使用MATLAB编译器编译最后的MATLAB程序之前分布(发行)和一般使用1.2 The MATLAB EnvironmentThe MATLAB development environment is a set of tools to help you use MATLAB functions and files. Many of these tools are graphical user interfaces (GUI). The fundamental unit of data in any MATLAB program is the array(数组/阵列). An a

18、rray 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 the array followed by subscripts(写在下方的) in parentheses(圆括号) that identify the row and column of the particula

19、r value, for example: A(2,5)=3. Even scalars(数) are treated as arrays by MATLAB, they are simply arrays with only one row and one column.MATLAB开发环境是一组工具,以帮助您使用MATLAB函数和文件。这些工具是图形用户界面(GUI)。数据在任何MATLAB程序的基本单位是数组(数组/阵列)。数组是一组数据值组织成行(行)和列(列) 辽宁科技大学计算机仿真教案8以单一名称(唯一名字)。数组中的单个数据值可能被访问(访问),包括数组下标紧随其后的名称(写在下

20、方的)括号内(圆括号),识别特定值的行和列,例如:(2、5)= 3。即使是标量(数)被当作数组通过MATLAB,他们只是数组只有一行和一列。 1.2.1 The MATLAB Desktop The first time MATLAB starts, the desktop appears as shown in the following illustration(插图).MATLAB第一次启动时,桌面出现下图所示Start Button and Launch Pad(启动平台) Run tools and access documentation for all of your MathW

21、orks 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 documentation for the full family of MATLAB products.Current Directory Browser

22、(当前路径窗口) 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 a table format(表格格式) and edit the values.Editor/Debugger(编辑器/调试器) Create,

23、edit, and debug M-files (files containing MATLAB functions).Profiler(编译器) Assess(评估) the performance(性能) of your M-files using this graphical interface. 开始按钮和发射台(启动平台)为你所有的工具和访问文档MathWorks产品。命令窗口(命令窗口)MATLAB函数。命令历史记录窗口(命令历史窗口)视图日志(日志)在命令窗口输入的函数,拷贝,并执行。帮助浏览器(帮助浏览器)视图和搜索的文档MATLAB的家庭产品。当前目录浏览器(当前路径窗口)视

24、图MATLAB文件和相关文件、执行文件操作,如打开,找到内容。工作空间浏览器(工作空间浏览器)的观点和对工作空间的内容进行更改。数组编辑器(阵列编辑器)查看数组的内容以表格格式1.2.2 The Command WindowThe right hand side of the MATLAB desktop contains the Command Window. Users can enter interactive(交互式) commands at the command prompt (提示) in the Command Window, and they will be executed

25、 on the spot(当场).1.2.2命令窗口右边的MATLAB桌面包含命令窗口。用户可以输入互动(交互式)命令在命令提示符 (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. format short/ sho

26、rt e: 5为有效数字format long/ long e: 15为有效数字format bank:钱币表示格式格式(格式)命令控制数字(数字)格式的值(价值观)显示(显示的)由MATLAB。只影响该命令显示数字,而不是如何MATLAB计算或者保存它们。格式短/短e:5为有效数字格式长/ e:15为有效数字格式银行:钱币表示格式 For example: format_demo(2) Suppressing(禁止) Output !不可加分号,否则不执行!If you simply type a statement(语句) and press Return or Enter, MATLAB

27、 automatically displays the results on screen. However, if you end the line with a semicolon(;), MATLAB performs the computation but does not display any output.如果你只需输入一个语句(语句),按Return键或输入MATLAB自动在屏幕上显示结果。然而,如果你结束与分号(;),MATLAB进行计算,但不显示任何输出。For example,a=magic(4);b=magic(3) ans = 8.00 1.00 6.00 3.00

28、5.00 7.00 4.00 9.00 2.00 !不可加分号,否则不执行! (3) Long Command Lines -用three periods(省略号. )长命令行If a statement does not fit on one line, use three periods(省略号. ), followed by Return or Enter to indicate that the statement continues on the next line. For example,如果不适合在一行上的一份声明中,使用三个时期(省略号),随后返回或输入表明声明继续下一行。例

29、如s = 1 -1/2 + 1/3 -1/4 + 1/5 - 1/6 + 1/7-. 1/8 + 1/9 - 1/10 + 1/11 - 1/12; (4) 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 available command line editing keys is different on diffe

30、rent computers. Experiment to see which of the following keys is available on your machine. 各种箭头(箭头)和控制键(控制键)在你的键盘让你记得,编辑、输入和重用命令。可用命令行编辑键的列表是不同的在不同的电脑。实验看到下列哪个键可在您的机器上。Demo: semicolon_demo1.2.3 The Command History Window 命令历史窗口 (1) Viewing Statements in the Command History Window ;(2) Deleting Entries(条目) in the Command History Window.(1)命令历史记录窗口中查看语句(2)删除条目(条目)的命令历史记录窗口。Demo: Historywindow_demo 1.2.4 The Edit/Debug Window 编辑/调试窗口 An Edit/Debug Window is used to create M-files(M文件), or to modify existing ones. An Edit/Debug Window is created

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1