Simulink指导手册笔记③--模型仿真

1.信号输出值观测

全选如下模型,

Add port value labels so you can see the signal values as you step through the simulation. Click an empty area in the upper left of the canvas and drag to select everything in the block diagram. Then,
on the Debug tab, in the Tools section, in the Port Values button group, click Show port value label on selected signal . The port value labels show no data yet until the first forward step in
simulation after you add the port value labels.
点击如下位置进行信号值观测,这样在仿真的时候不需要单独创建示波器或者display模块

 

When you want to run a simulation one step at a time from the beginning, you can start the
simulation by clicking Step Forward . In the Simulink Toolstrip, on the Simulation tab, click Step
Forward to start a simulation of the model vdp . The simulation starts and pauses just after
calculating the output values for the first simulation time and before stepping to the next simulation
time.

2.单步仿真

3.多步仿真

 Step Forward Multiple Time Steps at a Time

可以设置多步仿真,按如下图设置

可以把图中的步长1改为其他步长,这样再点击Step Forward时,将按照设定的多步进行仿真

如何把这个多步长设置为3,可以通过观测下方的状态看是否仿真时间为3个步长

4.退步仿真

首先需要打开退步仿真的功能,按照下图所示

打开之后,可以看到此时的Step Back按钮是灰色的无法被选定
是因为该功能无法倒退初始时刻,所以你必须仿真之后才能倒退
先多点击Step Forward,你会发现此时的Step Back这个按钮不再是灰色,可以倒退了
可以退步仿真了
退步仿真实际上并不是模型真的在仿真,而是在前进仿真的时候,把每时刻的仿真进行保存下来了,这样在退步仿真的时候实际上是在回放前进仿真。

5.断点仿真

使模型仿真时间到特定的时间

比如一开始就让仿真时间停留在2s处,按如下图

点击运行

而此时点击单步仿真或退步仿真都是可行的

6.条件断点

可以点击某个信号的输出线,点击Add Breakpoint选项

在弹出的对话框中选择条件,我们填小于0,他会仿真当条件满足时停止仿真

确认后,线上会显示一个透明的红色圆

点击运行仿真,会发现仿真停止的时候,已经满足了条件,红色圆上面多了个绿色箭头

退一步,发现箭头消失了,这时候刚好没达到条件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值