このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
合成コンポーネント
複数のコンポーネントの接続によるカスタム コンポーネントの作成
合成コンポーネントは他のコンポーネントから作成されます。合成コンポーネントを作成するには、メンバー (構成要素) コンポーネントの名前をリストしてから、メンバー コンポーネントの端子を相互に接続する方法や合成コンポーネントの外部端子に接続する方法を指定する必要があります。合成コンポーネントのブロック ダイアログ ボックスで、メンバー コンポーネントのどのパラメーターを表示し、調整可能にするかも指定します。
言語構文
components | Declare member components included in composite component |
connect | Connect two or more component ports of the same type |
connections | Define connections for member component ports in composite component |
import | Import model classes |
関数
subsystem2ssc | Convert subsystem containing Simscape blocks into equivalent Simscape file or files |
トピック
合成コンポーネント作成の基本的な手法
- About Composite Components
A composite component is constructed out of other components. To create a composite component, you have to list the names of the member (constituent) components and then specify how the ports of the member components are connected to each other and to the external ports of the composite component. You also specify which parameters of the member components are to be visible, and therefore adjustable, in the block dialog box of the composite component. - Declaring Member Components
Acomponents
declaration block begins with acomponents
keyword and is terminated by anend
keyword. This block contains declarations for member components included in the composite component. Acomponents
declaration block must have itsExternalAccess
attribute value set toobserve
(for more information on member attributes, see Attribute Lists). - Parameterizing Composite Components
Composite component parameters let you adjust the desired parameters of the underlying member components from the top-level block dialog box when building and simulating a model. - Specifying Initial Target Values for Member Variables
Member components have to be declared withExternalAccess=observe
, and therefore their variables do not appear in the Initial Targets section of the top-level block dialog box. However, if a certain member component variable is important for initialization, you can tie its value to an initialization parameter in the top-levelparameters
declaration block. In this case, the block user will be able to adjust the initial target value of the member component variable from the top-level block dialog box when building and simulating a model. - Specifying Component Connections
The structure section of a Simscape™ file is executed once during compilation. This section contains information on how the constituent components’ ports are connected to one another, as well as to the external inputs, outputs, and nodes of the top-level component. - Composite Component — DC Motor
This example shows how to implement a DC motor model by means of a composite component. - Importing Domain and Component Classes
An import mechanism provides a convenient means to accessing classes defined in different scopes, or namespaces. - Composite Component Using import Statements
This example shows how you can useimport
statements to implement a DC motor model by means of a composite component. - Converting Subsystems into Composite Components
You can generate a composite component from a subsystem consisting entirely of Simscape blocks.
コンポーネント バリアント
- Defining Component Variants
Use conditional sections to define variants within component file. - Component Variants — Series RLC Branch
This example shows how to implement variants within a component file by using conditional sections.
コンポーネント配列
- Component Arrays
Use parametric-sized arrays of member components in composite components. - Segmented Pipeline Using Component Array
This example shows how you can model a segmented pipeline using an array of identical pipe segments, connected in series. The size of the array corresponds to the number of segments, and the block user can modify this parameter. - Segmented Pipeline with Different Pipe Lengths Using Component Array
This example shows how you can model a segmented pipeline with segments of different lengths, connected in series, using an array of components. The block user provides the lengths of individual pipe segments, and the model automatically determines the size of the array based on that data. - Case Study — Battery Pack with Fault Using Arrays
This case study shows how you can use component arrays to model a battery pack consisting of multiple series-connected cells. It also shows how you can introduce a fault into one of the cells to see the impact on battery performance and cell temperatures. The block user can modify both the number of cells and the position of the faulted cell as block parameters. - Arrays of Nodes
Use parametric-sized arrays of nodes to specify element-wise connections between arrays of components. - Using MATLAB Functions with Arrays of Components and Nodes
Use array manipulation and query functions on an object array.