最新のリリースでは、このページがまだ翻訳されていません。 このページの最新版は英語でご覧になれます。

合成コンポーネント

複数のコンポーネントの接続によるカスタム コンポーネントの作成

言語構文

componentsDeclare member components included in composite component
connectConnect two or more component ports of the same type
connectionsDefine connections for member component ports in composite component
importImport model classes

関数

subsystem2sscConvert subsystem containing Simscape blocks into equivalent Simscape file or files

例および操作のヒント

Composite Component — DC Motor

This example shows how to implement a DC motor model by means of a composite component.

Composite Component Using import Statements

This example shows how you can use import statements to implement a DC motor model by means of a composite component.

Component Variants — Series RLC Branch

This example shows how to implement variants within a component file by using conditional sections.

概念

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

A components declaration block begins with a components keyword and is terminated by an end keyword. This block contains declarations for member components included in the composite component. A components declaration block must have its ExternalAccess attribute value set to observe (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 as hidden, and therefore their variables do not appear in the Variables tab 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-level parameters 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.

Importing Domain and Component Classes

An import mechanism provides a convenient means to accessing classes defined in different scopes, or namespaces.

Defining Component Variants

Use conditional sections to define variants within component file.

Converting Subsystems into Composite Components

You can generate a composite component from a subsystem consisting entirely of Simscape blocks.