Main Content

このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。

Simulink モデルの変更と操作点の仕様の同期

Simulink® モデルを変更すると、状態、入力、または出力が変更、追加、または削除される可能性があり、それによって操作点が変更されます。既存の操作点の仕様オブジェクトを同期して、モデル内の変更を反映させることができます。

定常状態マネージャーを使用したモデルの変更の同期

定常状態マネージャーが開いている間に Simulink モデルを変更する場合、定常状態マネージャーで操作点の仕様を同期して、モデルの変更を反映させなければなりません。

Simulink モデルを開きます。

sys = ('scdspeedctrl');
open_system(sys)

定常状態マネージャーを開くには、Simulink モデル ウィンドウの [アプリ] ギャラリーで [定常状態マネージャー] をクリックします。

現在のモデル コンフィギュレーションに基づいて操作の仕様を作成するには、定常状態マネージャー[定常状態] タブで [仕様の平衡化] をクリックします。

[spec1] ドキュメントでは Reference Filter ブロックが 1 つの状態をもちます。

Simulink モデル ウィンドウで Reference Filter ブロックをダブルクリックします。伝達関数の [分子係数]100 に変更し、[分母係数][1 20 100] に変更します。

[OK] をクリックします。

この変更によりフィルターの次数が大きくなり、Simulink モデルに状態が追加されます。

操作点の仕様を更新してモデルの変更を反映させるには、定常状態マネージャー[仕様] タブで [モデルから同期] をクリックします。

仕様が更新されます。ここで Reference Filter ブロックは 2 つの状態をもちます。

これらの仕様を満たす操作点を見つけるには、[仕様] タブで [平衡化] Play button をクリックします。

モデル線形化器を使用したモデルの変更の同期

モデル線形化器が開いている間に Simulink モデルを変更する場合、モデル線形化器で操作点の仕様を同期して、モデルの変更を反映させなければなりません。

Simulink モデルを開きます。

sys = ('scdspeedctrl');
open_system(sys)

モデル線形化器を開くには、Simulink モデル ウィンドウの [アプリ] ギャラリーで、[モデル線形化器] をクリックします。

モデル線形化器[操作点] ドロップダウン リストで、[モデルの平衡化] を選択します。

[モデルの平衡化] ダイアログ ボックスで、Reference Filter ブロックは状態を 1 つ含みます。

Simulink モデル ウィンドウで Reference Filter ブロックをダブルクリックします。伝達関数の [分子係数]100 に変更し、[分母係数][1 20 100] に変更します。

[OK] をクリックします。

この変更によりフィルターの次数が大きくなり、Simulink モデルに状態が追加されます。

操作点の仕様を更新してモデルの変更を反映させるには、[モデルの平衡化] ダイアログ ボックスで、[モデルと同期] をクリックします。

仕様が更新されます。ここで Reference Filter ブロックは 2 つの状態をもちます。

これらの仕様を満たす操作点を見つけるには、[平衡化の開始] をクリックします。

コマンド ラインを使用したモデルの変更の同期

以下の例では、既存の操作点の仕様オブジェクトを Simulink® モデルの変更で更新する方法を示します。

モデルを開きます。

sys = 'scdspeedctrl';
open_system(sys)

現在のモデル コンフィギュレーションに基づいて操作点の仕様オブジェクトを作成します。

opspec = operspec(sys)
opspec = 


 Operating point specification for the Model scdspeedctrl.
 (Time-Varying Components Evaluated at time t=0)

States: 
----------
       <strong>x</strong>       <strong>Known</strong>    <strong>SteadyState</strong>    <strong>Min</strong>     <strong>Max</strong>    <strong>dxMin</strong>    <strong>dxMax</strong>
    <strong>_______</strong>    <strong>_____</strong>    <strong>___________</strong>    <strong>____</strong>    <strong>___</strong>    <strong>_____</strong>    <strong>_____</strong>

(1.) scdspeedctrl/External Disturbance/Transfer Fcn
          0    false       true        -Inf    Inf    -Inf      Inf 
          0    false       true        -Inf    Inf    -Inf      Inf 
(2.) scdspeedctrl/PID Controller/Filter/Cont. Filter/Filter
          0    false       true        -Inf    Inf    -Inf      Inf 
(3.) scdspeedctrl/PID Controller/Integrator/Continuous/Integrator
     8.9768    false       true        -Inf    Inf    -Inf      Inf 
(4.) scdspeedctrl/Reference Filter/State Space
        200    false       true        -Inf    Inf    -Inf      Inf 
(5.) scdspeedctrl/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
    0.54363    false       true        -Inf    Inf    -Inf      Inf 
(6.) scdspeedctrl/Vehicle Dynamics/w = T//J w0 = 209 rad//s
     209.44    false       true        -Inf    Inf    -Inf      Inf 

Inputs: None 
----------

Outputs: None 
----------

Reference Filter ブロックの伝達関数を変更します。分子パラメーターを 100分母パラメーターを [1 20 100] に設定します。

set_param('scdspeedctrl/Reference Filter','N',"100");
set_param('scdspeedctrl/Reference Filter','D',"[1 20 100]");

モデル パラメーターが変更されたため、次のコマンドを使用して opspec の仕様を満たす操作点を検出しようとすると、エラーが発生します。

op = findop(sys,opspec);

操作点の仕様オブジェクトを更新して、モデルの変更を反映させます。

opspec = update(opspec);

更新された仕様を満たす操作点を見つけます。

op = findop(sys,opspec);
 Operating point search report:
---------------------------------

opreport = 


 Operating point search report for the Model scdspeedctrl.
 (Time-Varying Components Evaluated at time t=0)

Operating point specifications were successfully met.
States: 
----------
    <strong>Min</strong>        <strong>x</strong>       <strong>Max</strong>    <strong>dxMin</strong>        <strong>dx</strong>         <strong>dxMax</strong>
    <strong>____</strong>    <strong>_______</strong>    <strong>___</strong>    <strong>_____</strong>    <strong>___________</strong>    <strong>_____</strong>

(1.) scdspeedctrl/External Disturbance/Transfer Fcn
    -Inf          0    Inf      0                0      0  
    -Inf          0    Inf      0                0      0  
(2.) scdspeedctrl/PID Controller/Filter/Cont. Filter/Filter
    -Inf          0    Inf      0                0      0  
(3.) scdspeedctrl/PID Controller/Integrator/Continuous/Integrator
    -Inf     8.9768    Inf      0      -4.5077e-14      0  
(4.) scdspeedctrl/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
    -Inf    0.54363    Inf      0       2.9365e-15      0  
(5.) scdspeedctrl/Vehicle Dynamics/w = T//J w0 = 209 rad//s
    -Inf     209.44    Inf      0      -1.5226e-13      0  
(6.) scdspeedctrl/Reference Filter/State Space
    -Inf          0    Inf      0                0      0  
    -Inf         20    Inf      0                0      0  

Inputs: None 
----------

Outputs: None 
----------

操作点の仕様オブジェクトを更新した後は、最適化アルゴリズムによって操作点が正しく検出されます。

参考

関連するトピック