このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
方程式
コンポーネント ファイルの equations セクションの目的は、コンポーネントの変数、パラメーター、入力、出力、およびシミュレーション時間とそれらの各エンティティの時間微分の間の数学的な関係を確立することです。
同様に、ドメイン ファイルの equations セクションには、ドメインのアクロス変数、パラメーター、および中間値の間の数学的な関係を確立する役割があります。ドメインの方程式は対応するドメイン タイプのノードに伝播します。
コンポーネントとドメインの方程式の構文は同じです。Defining Component Equationsでは、Simscape™ 言語での方程式の記述に関する一般的な情報を提供しています。Domain Equationsでは、ドメインの方程式に固有の情報を提供しています。
言語構文
assert | Program customized run-time errors and warnings |
delay | Return past value of operand |
der | Return time derivative of operand |
equations | Define component or domain equations |
function | Reuse expressions in component equations and in member declarations of domains and components |
if | Specify conditional equations, assignments, annotations, and conditional sections in component files |
.if | Perform element-wise conditional operations with array-type predicates (R2023b 以降) |
integ | Perform time integration of expression |
intermediates | Define intermediate terms for use in equations |
scatteredlookup | Return value based on interpolating unstructured set of data points (R2023a 以降) |
tablelookup | Return value based on interpolating set of data points |
time | グローバルなシミュレーション時間へのアクセス |
value | Convert variable or parameter to unitless value with specified unit conversion |
トピック
- Defining Component Equations
The purpose of the
equationssection in a component file is to establish the mathematical relationships between the variables, parameters, inputs, and outputs of the component, the simulation time, and the time derivatives of each of these entities. - 単純な代数システム
この例では、単純な代数システムの実装を示します。
- 方程式でのシミュレーション時間の使用
この例では、equation セクションからグローバルなシミュレーション時間にアクセスする方法を示します。
- 方程式での条件式の使用
ifステートメントおよび.ifステートメントを使用して、方程式の条件式や中間値への条件付き代入を指定できます。 - Using Intermediate Terms in Equations
Textbooks often define certain equation terms in separate equations, and then substitute these intermediate equations into the main one.
- Using Lookup Tables in Equations
You can use the
tablelookupfunction in theequationssection of the Simscape file to interpolate input values based on a set of data points in a one-dimensional, two-dimensional, three-dimensional, or four-dimensional table. - Programming Run-Time Errors and Warnings
Use the
assertconstruct to implement run-time error and warning messages for a custom block. - Initial Equations
Specify additional equations to be executed during model initialization only.
- Simscape Functions
Use Simscape functions to reuse expressions in equations and member declarations of multiple components.
- Import Symbolic Math Toolbox Equations
Example of using Symbolic Math Toolbox™ software to solve the physical equations, generate code in the format appropriate for the Simscape language equation section, and incorporate the generated code into the equation section of a component file.
- Domain Equations
Specify additional equations to propagate to all the components that have nodes of the corresponding domain type.