科学计算科学计算 (52).pdf
《科学计算科学计算 (52).pdf》由会员分享,可在线阅读,更多相关《科学计算科学计算 (52).pdf(21页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、9.29.2 Creation and Mask of SubsystemCreation and Mask of SubsystemThe creation of subsystemsThe mask of subsystemsThe conditional execute of subsystems1 1The The C Creation of reation of S SubsystemsubsystemsCreate a subsystem through the subsystem blocksConvert the existing blocks into a subsystem
2、The difference between the two is that the former creates a subsystem first and then adds function blocks;the latter selects blocks first and then creates the subsystem.Lets take the creation of y=kx+b subsystem as an example.(1)Create a subsystem through the subsystem blocksDouble-click the subsyst
3、em block to open the subsystem editing window.In the window,An interconnected input block and an output block have been added automatically.They respectively represent the input port and the output port of the subsystem.Insert the block to be grouped between the input block and the output block.Two
4、constant blocks,k and b,are needed here.A product block and an SUM block.Group these blocks and a subsystem is created.Check the Scope curve after starting the simulation.The blue curve is a sine curve.The yellow curve is y=kx+b.Here,in the Command Window,assign 3 to k and 2 to b.That is to say,the
5、yellow curve represents y=3sint+2 (2)Convert the existing blocks into a subsystemThe system model created is shown in the figure.Select all the blocks in the system model,then select related commands in the Diagram menu in the Simulink Editor.Or press Ctrl+G to create a subsystem.The selected blocks
6、 will be replaced by a subsystem block.If you want to view the internal structure of the subsystem,you can double-click the subsystem block.2 2The The MMask of ask of S SubsystemubsystemSelect the subsystem to be masked,then in the Simulation Editor select Create Mask command in Diagram MenuItem,or
7、press Ctrl+M key combination.The Mask Editor dialog box will appear.The first tabbed pane is used to create blockmask icons.The second tabbed pane is used to designmask dialog boxes.The third tabbed pane is used to set theinitialization command.The fourth tabbed pane is used to define thetype,descri
8、ption and help text for of theblock mask.This tabbed pane consists of 3 parts On the left is the Controls.The middle area shows the dialog controls in the dialog box.The right area is used to display and modify properties of controls.Next,lets take y=kx+b subsystem as an example to illustrate the me
9、thod of setting Parameters&Dialog.On the left control toolbar of the second tabbed pane,double-click the Edit button to prepare input positions for the 2 variables of the subsystem.Enter the Prompt and Name of the control in the middle area,and finally click the OK button to confirm the settings.Aft
10、er setting the subsystem Parameters&dialog,double-click the subsystem icon to display its parameters dialog box.For example,double-click the icon of subsystem y=kx+b in the simulation model,the parameters dialog box as shown in the figure will pop up,which allows users to enter values for the parame
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 科学计算科学计算 52 科学 计算 52
限制150内