xsort
説明
例
フィードバック ループのスパース 2 次モデル
この例では、スパース 2 次モデルを含む sparseSOSignal.mat
について考えます。アクチュエータ、センサー、コントローラーを定義して、それらをフィードバック ループでプラントに接続します。
スパース行列を読み込み、mechss
オブジェクトを作成します。
load sparseSOSignal.mat plant = mechss(M,C,K,B,F,[],[],'Name','Plant');
次に、伝達関数を使用してアクチュエータとセンサーを作成します。
act = tf(1,[1 0.5 3],'Name','Actuator'); sen = tf(1,[0.02 7],'Name','Sensor');
プラントの PID コントローラー オブジェクトを作成します。
con = pid(1,1,0.1,0.01,'Name','Controller');
feedback
コマンドを使用して、プラント、センサー、アクチュエータ、およびコントローラーをフィードバック ループ内で接続します。
sys = feedback(sen*plant*act*con,1)
Sparse continuous-time second-order model with 1 outputs, 1 inputs, and 7111 degrees of freedom. Model Properties Use "spy" and "showStateInfo" to inspect model structure. Type "help mechssOptions" for available solver options for this model.
mechss
オブジェクトがどのモデル オブジェクト タイプよりも優先されるため、結果のシステム sys
は mechss
オブジェクトになります。
showStateInfo
を使用してコンポーネントと信号グループを表示します。
showStateInfo(sys)
The state groups are: Type Name Size ------------------------------- Component Sensor 1 Component Plant 7102 Signal 1 Component Actuator 2 Signal 1 Component Controller 2 Signal 1 Signal 1
xsort
を使用してコンポーネントと信号を並べ替えてから、コンポーネントと信号グループを表示します。
sysSort = xsort(sys); showStateInfo(sysSort)
The state groups are: Type Name Size ------------------------------- Component Sensor 1 Component Plant 7102 Component Actuator 2 Component Controller 2 Signal 4
コンポーネントが信号区分の前に順序付けされていることを確認します。信号は並べ替えられて、単一の区分にグループ化されます。
spy
を使用して結果のシステムのスパース パターンを可視化することもできます。
spy(sysSort)
スパース 2 次モデルのコンポーネント間の物理的接続
この例では、下の図に示すように、各頂点の支柱に連結されている 2 枚の四角形のプレートで構成される構造モデルを考えます。下のプレートは地面にしっかり取り付けられ、支柱は四角形のプレートの各頂点にしっかり取り付けられています。
platePillarModel.mat
に含まれている有限要素モデル行列を読み込み、上記システムを表すスパース 2 次モデルを作成します。
load('platePillarModel.mat') model = ... mechss(M1,[],K1,B1,F1,'Name','Plate1') + ... mechss(M2,[],K2,B2,F2,'Name','Plate2') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar3') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar4') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar5') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar6'); sys = model;
mechss
モデル オブジェクトのコンポーネントを確認するには showStateInfo
を使用します。
showStateInfo(sys)
The state groups are: Type Name Size ---------------------------- Component Plate1 2646 Component Plate2 2646 Component Pillar3 132 Component Pillar4 132 Component Pillar5 132 Component Pillar6 132
次に、相互作用する自由度 (DOF) インデックス データを dofData.mat
から読み込み、interface
を使用して 2 枚のプレートと 4 本の支柱間の物理的接続を作成します。dofs
は、最初の 2 行に 1 枚目と 2 枚目のプレートの DOF インデックス データを含み、他の 4 行に 4 本の支柱のインデックス データを含む 6x7
の cell 配列です。関数は既定で、物理結合のデュアルアセンブリ メソッドを使用します。
load('dofData.mat','dofs') for i=3:6 sys = interface(sys,"Plate1",dofs{1,i},"Pillar"+i,dofs{i,1}); sys = interface(sys,"Plate2",dofs{2,i},"Pillar"+i,dofs{i,2}); end
下のプレートと地面間の接続を指定します。
sysConDual = interface(sys,"Plate2",dofs{2,7});
物理インターフェイスを確認するには showStateInfo
を使用します。
showStateInfo(sysConDual)
The state groups are: Type Name Size ----------------------------------- Component Plate1 2646 Component Plate2 2646 Component Pillar3 132 Component Pillar4 132 Component Pillar5 132 Component Pillar6 132 Interface Plate1-Pillar3 12 Interface Plate2-Pillar3 12 Interface Plate1-Pillar4 12 Interface Plate2-Pillar4 12 Interface Plate1-Pillar5 12 Interface Plate2-Pillar5 12 Interface Plate1-Pillar6 12 Interface Plate2-Pillar6 12 Interface Plate2-Ground 6
spy
を使用して、最終モデルのスパース行列を可視化できます。
spy(sysConDual)
ここで、主要アセンブリ メソッドを使用して物理的接続を指定します。
sys = model; for i=3:6 sys = interface(sys,"Plate1",dofs{1,i},"Pillar"+i,dofs{i,1},'primal'); sys = interface(sys,"Plate2",dofs{2,i},"Pillar"+i,dofs{i,2},'primal'); end sysConPrimal = interface(sys,"Plate2",dofs{2,7},'primal');
物理インターフェイスを確認するには showStateInfo
を使用します。
showStateInfo(sysConPrimal)
The state groups are: Type Name Size ---------------------------- Component Plate1 2646 Component Plate2 2640 Component Pillar3 108 Component Pillar4 108 Component Pillar5 108 Component Pillar6 108
主要アセンブリによって、グローバル有限要素メッシュ内の一連の共有 DOF に関連付けられた冗長な DOF の半分が取り除かれます。
spy
を使用して、最終モデルのスパース行列を可視化できます。
spy(sysConPrimal)
この例のデータセットは、ASML の Victor Dolk によって提供されています。
入力引数
出力引数
xsys
— コンポーネントが並べ替えられたスパース状態空間モデル
sparss
モデル オブジェクト | mechss
モデル オブジェクト
バージョン履歴
R2020b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)