メインコンテンツ

カスタム コンポーネント

カスタム コンポーネントを表す Simscape™ ファイルの作成

Simscape 言語では、パラメーター化、物理的接続、基となる方程式のすべて備わったテキスト ファイルとしてカスタム コンポーネントを定義できます。このページの各トピックでは、コンポーネントのパラメーター、変数、および接続の宣言に関する詳細情報を提供しています。カスタム コンポーネントの定義に関する他の側面については、方程式離散イベントおよびモード チャート、および合成コンポーネントを参照してください。

カスタム コンポーネントの作成を始めるには、カスタム コンポーネントの作成を参照してください。ここでは、一般的なワークフローの概要を説明しています。このページ下部の「参照アプリケーション コンポーネント」の下にあるトピックでは、完全なコンポーネント例を提供し、それぞれの例で使用されている手法を詳細に説明しています。

言語構文

annotationsControl appearance of Simscape block based on the component
branchesコンポーネントのスルー変数とノード間の関係を確立する
componentComponent model class definition
FaultsFaults interface annotation for custom component (R2024b 以降)
inputsDefine component inputs, that is, physical signal input ports of block
nodesDefine component nodes, that is, conserving ports of block
outputsDefine component outputs, that is, physical signal output ports of block
parametersドメインまたはコンポーネントのパラメーターを宣言する
variablesDeclare domain or component variables

トピック

基本的な手法

宣言と分岐

コンポーネント バリアント

高度な手法

  • Enumerations
    Specify a discrete set of acceptable values for parameters and event variables.
  • Subclassing and Inheritance
    Subclassing allows you to build component models based on other component models by extension.
  • Fault Annotations
    Use the annotations section of a component file to model faults in a custom component.

参照アプリケーション コンポーネント