setxu
操作点に状態と入力を設定します。
構文
op_new = setxu(op_point,x,u)
説明
setxu
は、操作点の状態値と入力値を設定します。この関数は、fmincon
を使用して最適化問題で操作を使用する場合など、状態値と入力値をベクトルの形式で指定する必要がある場合に使用します。
op_new = setxu(op_point,x,u)
は、指定された状態と入力値 (それぞれ x
および u
) による新しい操作点を返します。Simulink® シミュレーションから返されたものと同じ形式のベクトルまたは構造体として x
を指定します。x
を時間をもつ構造体として指定することはサポートされていません。u
をベクトルとして指定します。関数 getxu
を使用して、別の操作点オブジェクトから x
および u
を両方取得できます。
例
シミュレーションからの状態値を使用した操作点オブジェクトの初期化
シミュレーションから状態値をエクスポートし、エクスポートされた値を使用して操作点オブジェクトを初期化します。
Simulink モデルを開きます。この例では scdplane
モデルを使用します。
mdl = 'scdplane';
open_system(mdl)
これらの値を設定すると、シミュレーションの実行後にモデルの最終状態をワークスペースに保存できます。Simulink エディターの [モデル化] タブで [モデル設定] をクリックします。次に、[コンフィギュレーション パラメーター] ダイアログ ボックスで [最終状態] パラメーターを選択します。
モデルのシミュレーションを実行します。シミュレーションの実行後、変数 xFinal
がワークスペースに表示されます。この変数は最終状態の値を含むベクトルです。
sim(mdl)
scdplane
の操作点オブジェクトを作成します。
op_point = operpoint(mdl)
Operating Point for the Model scdplane. (Time-Varying Components Evaluated at time t=0) States: ---------- (1.) scdplane/Actuator Model x: 0 (2.) scdplane/Aircraft Dynamics Model/Transfer Fcn.1 x: 0 (3.) scdplane/Aircraft Dynamics Model/Transfer Fcn.2 x: 0 (4.) scdplane/Controller/Alpha-sensor Low-pass Filter x: 0 (5.) scdplane/Controller/Pitch Rate Lead Filter x: 0 (6.) scdplane/Controller/Proportional plus integral compensator x: 0 (7.) scdplane/Controller/Stick Prefilter x: 0 (8.) scdplane/Dryden Wind Gust Models/Q-gust model x: 0 (9.) scdplane/Dryden Wind Gust Models/W-gust model x: 0 x: 0 Inputs: ---------- (1.) scdplane/u u: 0
すべての状態はまず 0
に設定されます。
操作点オブジェクトの状態を xFinal
の値に初期化します。入力を 9
に設定します。
newop = setxu(op_point,xFinal,9)
Operating Point for the Model scdplane. (Time-Varying Components Evaluated at time t=0) States: ---------- (1.) scdplane/Actuator Model x: -0.032 (2.) scdplane/Aircraft Dynamics Model/Transfer Fcn.1 x: 0.56 (3.) scdplane/Aircraft Dynamics Model/Transfer Fcn.2 x: 678 (4.) scdplane/Controller/Alpha-sensor Low-pass Filter x: 0.392 (5.) scdplane/Controller/Pitch Rate Lead Filter x: 0.133 (6.) scdplane/Controller/Proportional plus integral compensator x: 0.166 (7.) scdplane/Controller/Stick Prefilter x: 0.1 (8.) scdplane/Dryden Wind Gust Models/Q-gust model x: 0.114 (9.) scdplane/Dryden Wind Gust Models/W-gust model x: 0.46 x: -2.05 Inputs: ---------- (1.) scdplane/u u: 9
代替方法
関数 setxu
の代替方法として、モデル線形化器 アプリを使用して操作点の状態と入力を設定します。
バージョン履歴
R2006a より前に導入
参考
getxu
| initopspec
| operpoint
| operspec
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)