2010课程设计simulink_(MATLAB 基础)
- 格式:ppt
- 大小:588.50 KB
- 文档页数:77
Simulink仿真环境基础学习Simulink就是面向框图的仿真软件。
7、1演示一个Simulink的简单程序【例7、1】创建一个正弦信号的仿真模型。
步骤如下:(1) 在MATLAB的命令窗口运行simulink命令,或单击工具栏中的图标,就可以打开Simulink模块库浏览器(Simulink Library Browser) 窗口,如图7、1所示。
图7、1 Simulink界面(2) 单击工具栏上的图标或选择菜单“File”——“New”——“Model”,新建一个名为“untitled”的空白模型窗口。
(3) 在上图的右侧子模块窗口中,单击“Source”子模块库前的“+”(或双击Source),或者直接在左侧模块与工具箱栏单击Simulink下的Source子模块库,便可瞧到各种输入源模块。
(4) 用鼠标单击所需要的输入信号源模块“Sine Wave”(正弦信号),将其拖放到的空白模型窗口“untitled”,则“Sine Wave”模块就被添加到untitled窗口;也可以用鼠标选中“Sine Wave”模块,单击鼠标右键,在快捷菜单中选择“add to 'untitled'”命令,就可以将“Sine Wave”模块添加到untitled窗口,如图7、2所示。
图7、2 Simulink界面(5) 用同样的方法打开接收模块库“Sinks”,选择其中的“Scope”模块(示波器)拖放到“untitled”窗口中。
(6) 在“untitled”窗口中,用鼠标指向“Sine Wave”右侧的输出端,当光标变为十字符时,按住鼠标拖向“Scope”模块的输入端,松开鼠标按键,就完成了两个模块间的信号线连接,一个简单模型已经建成。
如图7、3所示。
(7) 开始仿真,单击“untitled”模型窗口中“开始仿真”图标,或者选择菜单“Simulink”——“Start”,则仿真开始。
双击“Scope”模块出现示波器显示屏,可以瞧到黄色的正弦波形。
第八章Simulink 基础Chapter 8: Introduction to Simulink一.Simulink 初步(Primer of Simulink)MATLAB Simulink是一个动态仿真系统,用于对动态系统进行仿真和分析,预先模拟实际系统的特性和响应,根据设计和使用要求,对系统进行修改和优化。
Simulink提供了图形化用户界面,只须点击鼠标就可以轻易的完成模型的创建、调试和仿真工作,用户不须专门掌握一种程序设计语言。
Simulink可将系统分为从高级到低级的几个层次,每层又可以细分为几个部分,每层系统构建完成后,将各层连接起来就可构成一个完整的系统。
模型创建完成后,可以启动系统的仿真功能分析系统的动态特性,其内置的分析工具包括各种仿真算法、系统线性化、寻求平衡点等。
仿真结果可以以图形方式在示波器窗口显示,也可将输出结果以变量形式保存起来,并输入到MATLAB中以完成进一步的分析。
Simulink可以仿真线性和非线性系统,并能创建连续时间、离散时间或二者混合的系统。
支持多采样频率系统。
SimulinkVersion 6.0 (R14) 05-May-2004Model analysis and construction functions.Simulationsim - Simulate a Simulink model.sldebug - Debug a Simulink model.simset - Define options to SIM Options structure.simget - Get SIM Options structureLinearization and trimming.linmod - Extract linear model from continuous-time system.linmod2 - Extract linear model, advanced method.dlinmod - Extract linear model from discrete-time system.trim - Find steady-state operating point.Model Construction.close_system - Close open model or block.new_system - Create new empty model window.open_system - Open existing model or block.load_system - Load existing model without making model visible.save_system - Save an open model.add_block - Add new block.add_line - Add new line.delete_block - Remove block.delete_line - Remove line.find_system - Search a model.hilite_system - Hilite objects within a model.replace_block - Replace existing blocks with a new block.set_param - Set parameter values for model or block.get_param - Get simulation parameter values from model.add_param - Add a user-defined string parameter to a model.delete_param - Delete a user-defined parameter from a model.bdclose - Close a Simulink window.bdroot - Root level model name.gcb - Get the name of the current block.gcbh - Get the handle of the current block.gcs - Get the name of the current system.getfullname - get the full path name of a blockslupdate - Update older 1.x models to 3.x.addterms - Add terminators to unconnected ports.boolean - Convert numeric array to boolean.slhelp - Simulink user's guide or block help.Masking.hasmask - Check for mask.hasmaskdlg - Check for mask dialog.hasmaskicon - Check for mask icon.iconedit - Design block icons using ginput function.maskpopups - Return and change masked block's popup menu items.movemask - Restructure masked built-in blocks as masked subsystems.Library.libinfo - Get library information for a system. Diagnostics.sllastdiagnostic - Last diagnostic array.sllasterror - Last error array.sllastwarning - Last warning array.sldiagnostics - Get block count and compile stats for a model. Hardcopy and printing.frameedit - Edit print frames for annotated model printouts.print - Print graph or Simulink system; or save graph to M-file.printopt - Printer defaults.orient - Set paper orientation.simulink is both a directory and a function.Copyright 1990-2004 The MathWorks, Inc.Simulink的三大步骤(procedure of Simulink):1、模型创建与定义、( Model creating and definition)2、模型的分析、(Model analyzing)3、模型的修正。