当前位置:文档之家› 控制系统与CAD

控制系统与CAD

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
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
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
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.
Example6-6
u
xBiblioteka BxA
—K
Example6_6_sim.mdl
Exercise
Simulate the following system with SIMULINK.
2u (t ) y (t ) 8u (t ) t 30 t 30
External function

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
plot(tsim,ysim); Example8_4_sim.m
练习三、运用SIMULINK对系统仿真
生成系统结构图,改变输入信号电平从1~6,其系 统饱和环节的上下限为-1~1,对这6种情况分别进 行仿真并计算其超调量,将其绘制在同一张图中 进行比较
练习三、运用SIMULINK对系统仿真
打开SIMULINK,搭建系统结构框图,并保存为 ***.mdl 在MATLAB的Editor/Debugger窗口来编辑M文件, 运用sim命令,对模型进行外部的仿真 把源程序以文件形式保存到MATLAB的Work子目 录下 运行源程序,打印源程序清单,并保存图形
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
In Model-based Design, a system model is at the center of the development process, from requirements development, through design, implementation, and testing.
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
[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);
Math Operations (数学运算模块库)
8-1 Introduction to SIMULINK
Ports & Subsystems (端口和子系统模块库)
8-1 Introduction to SIMULINK
Signal Routing (信号路由模块库)
8-1 Introduction to 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
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-6
Example8_6.mdl
Example8-7
Example8_7.mdl
Exercise
某一单位负反馈控制系统,给它输入阶跃量为 2的阶跃信号,试使用Simulink构造其闭环仿 真模型,并且绘制其响应曲线;然后将已经建 立的闭环控制系统建立成一个子系统。
1 s ( s 1)
相关主题