SYSGEN记录4

声明:只是笔记

采样周期 sample period 

•Theunits of the sample period can be thought of as arbitrary, but a lot of Simulink source blocks do have an essenceof time
–Forexample, a sample period of 1/44100 means that the function of the block willbe executed every 1/44100 of a sec
•RememberNyquist’s theorem (Fs ³ 2fmax) when setting sample periods
•Thesample period of a block directlyrelatesto how that block will be clocked in the actual hardware.  More on this later
至于什么是尼奎斯特理论
•Problems can occur when you aresimulating a Simulink design if you do not fully understand the sample periodsused in a design and how they can affect your simulation results.
•For example, if you create a sinewave with a sample period of 1 (which is 1sec) and the frequency of the sinewave is 10 Hz (Period = 0.1 s), you will see a meaningless number on the outputbecause your signal has gone through 10 oscillations before one sample of thesignal has even occurred.
在simulink中
•Eachblock in a Simulink design has a “sample period,” andit corresponds to how often the function of that block is calculated and theresults outputted
•EverySystem Generator signal must be “sampled”; transitions occur at equidistantdiscrete points in time, called sample times
•Thissample period must be set explicitly for:
•GatewayIn
•Blockswithout inputs (Note: constants are idiosyncratic)
•Thesample period can be “derived” from the input sample times for other blocks

在gatewayin中设置

2. solvers


HINT:

•TheSimulink tool works by establishing adialog between the system (the block diagram) and the solver (i.e., simulator)
•Thesolver computes block outputs, then:
–Updatesdiscrete states (exact)
–Decideson the next time step
•TheSimulink tool carries necessaryinformation:
–Fromsystem to solver: parameters and equations
–Fromsolver to system: computed states, inputs, and time
•Setthe solver options as:
–Type: Fixed Step
–Solver: Discrete (No Continuous States)
–Taskingmod:Single Tasking
&&&

•The idea for the Simulink tooloriginated from sophisticated MATLAB simulation algorithms. These algorithmshave developed into the different solvers and ordinary differential equationsthat you see in the Solver pane.
•Although variable-step solvers canbe used, System Generator is associated with discrete sample periods, and youshould always use the fixed-step solver. The fixed-step size should be thesmallest sample period in your design—ensuring that no events are missed thatshould not be missed in your simulation. AUTOshould be used because the tools can determine the exact required step sizefrom the sample periods of your models.
•Single Tasking: This mode does notcheck for sample rate transitions among blocks. This mode is useful when youare modeling a single-tasking system. In such systems, task synchronization isnot an issue. System generator only supportsSingle Tasking.
•Multi Tasking: This mode issues anerror if it detects an illegal sample rate transition between blocks; that is,a direct connection between blocks operating at different sample rates. Inreal-time multitasking systems, illegal sample-rate transitions between taskscan result in the output of a task not being available when it is required byanother task. By checking for such transitions, the Multi Tasking mode helpsyou to create valid models of real-world multitasking systems, where sectionsof your model represent concurrent tasks.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值