控制系统与CAD
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
8-1 Introduction to SIMULINK
Getting started
8-1 Introduction to SIMULINK
SIMULINK includes a comprehensive block library of sinks, sources, linear and nonlinear components, and connectors. If these blocks do not meet your needs, however, you can also create your own blocks. The interactive graphical programming environment simplifies the modeling process of systems.
Example8-1
Scope
Example8_1.mdl
Example8-1 (continued)
plot(y1(:,1),y1(:,2))
Example8-2
Out1
plot(t,y) Example8_2.mdl
Example8-3
To Workspace
plot(t3,y3) Example8_3.mdl
Example6-6
u
x
B
x
A
—K
Example6_6_sim.mdl
Exercise
Simulate the following system with SIMULINK.
2u (t ) y (t ) 8u (t ) t 30 t 30
External function
Six steps to modeling a system Defining the system Identifying system components Modeling the system with equations Building the SIMULINK block diagram Running the simulation Validating the simulation results
8-3 Create and Mask Subsystems
Ports & Subsystems Subsystem
8-3 Create and Mask Subsystems
Edit Create subsystem
8-3 Create and Mask Subsystems
Mask editor
Model with SIMULINK
Getting started: File New Model
Operation to block
Drag the block icon into the model window Double-click on the block Block Parameters
Chapter 8 Simulation with SIMULINK
Outline
8-1 Introduction to SIMULINK 8-2 Simulation to Dynamic Systems with SIMULINK 8-3 Create and Mask Subsystems
8-1 Introduction to SIMULINK
Math Operations (数学运算模块库)
8-1 Introduction to SIMULINK
Ports & Subsystems (端口和子系统模块库)
8-1 Introduction to SIMULINK
Signal Routing (信号路由模块库)
8-1 Introduction to SIMULINK
plot(tsim,ysim); Example8_4_sim.m
wenku.baidu.com
练习三、运用SIMULINK对系统仿真
生成系统结构图,改变输入信号电平从1~6,其系 统饱和环节的上下限为-1~1,对这6种情况分别进 行仿真并计算其超调量,将其绘制在同一张图中 进行比较
练习三、运用SIMULINK对系统仿真
打开SIMULINK,搭建系统结构框图,并保存为 ***.mdl 在MATLAB的Editor/Debugger窗口来编辑M文件, 运用sim命令,对模型进行外部的仿真 把源程序以文件形式保存到MATLAB的Work子目 录下 运行源程序,打印源程序清单,并保存图形
[t,x,y]=sim(‘model’,[to tf],options,ut) 第一个参数必须,其它可缺省
In1
Out1
% Example8_4_sim.m t=(0:0.02:5)'; u=ones(size(t)); ut=[t,u]
[tsim,x,ysim]=sim('Example8_4',5,[ ],ut);
Example8-6
Example8_6.mdl
Example8-7
Example8_7.mdl
Exercise
某一单位负反馈控制系统,给它输入阶跃量为 2的阶跃信号,试使用Simulink构造其闭环仿 真模型,并且绘制其响应曲线;然后将已经建 立的闭环控制系统建立成一个子系统。
1 s ( s 1)
Sinks (接收器模块库)
8-1 Introduction to SIMULINK
Sources (输入源模块库)
8-1 Introduction to SIMULINK
User-Defined Functions (用户定义模块库)
Model-based Design
8-2 Simulation to Dynamic Systems with SIMULINK
8-1 Introduction to SIMULINK
Continuous (连续模块库)
8-1 Introduction to SIMULINK
Discrete (离散模块库)
8-1 Introduction to SIMULINK
Look-Up Tables (查询表模块库)
8-1 Introduction to SIMULINK
In Model-based Design, a system model is at the center of the development process, from requirements development, through design, implementation, and testing.
SIMULINK is a MATLAB accessory that models, simulates, and analyzes dynamic systems. SIMULINK provides a graphical user interface (GUI) for building models as block diagrams, allowing you to draw models as you would with pencil and paper. With SIMULINK, you can easily build models from scratch, or modify existing models to meet your needs. SIMULINK supports linear and nonlinear systems, modeled in continuous time, sampled time, or a hybrid of the two. SIMULINK turns your computer into a laboratory for modeling and analyzing systems that would not be possible or practical otherwise.