Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

コマンド ラインでの仕様からの操作点の計算

モデルの状態、出力、および入力に対する制約を指定して、これらの制約を満たすモデルの操作条件を検出することにより、Simulink® モデルの定常状態の操作点を計算できます。定常状態の操作点の詳細については、操作点についておよび定常状態の操作点の計算を参照してください。

Simulink モデルの操作点を見つけるには、この例に示すように、findopを使用してモデルをプログラムで平衡化することができます。

あるいは、次を使用してモデルを平衡化できます。

この例では、出力仕様を満たす操作点を計算します。同様の方法を使用して、状態や入力の仕様を定義できます。また、状態、出力、および入力の仕様の組み合わせを定義することもできます。したがって、たとえば状態仕様のみを使用する必要はありません。

仕様を満たすモデルの平衡化の詳細については、仕様からの定常状態の操作点の計算を参照してください。

Simulink モデルを開く

Simulink モデルを開きます。

mdl = 'scdspeed';
open_system(mdl)

操作点の仕様の定義

モデルの既定の操作点の仕様を作成します。

opspec = operspec(mdl)
opspec = 


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

States: 
----------
     x         Known    SteadyState     Min         Max        dxMin       dxMax   
___________ ___________ ___________ ___________ ___________ ___________ ___________
                                                                                   
(1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
   0.543       false       true        -Inf         Inf        -Inf         Inf    
(2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s
  209.48       false       true        -Inf         Inf        -Inf         Inf    

Inputs: 
----------
  u   Known  Min   Max 
_____ _____ _____ _____
                       
(1.) scdspeed/Throttle  perturbation
  0   false -Inf   Inf 

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

モデルにルートレベルの出力端子がないため、既定の操作点の仕様オブジェクトには出力仕様がありません。

この例では、既知の定常状態のエンジン速度を指定します。そのためには、rad/s to rpm ブロックの出力に出力仕様を追加します。

opspec = addoutputspec(opspec,'scdspeed/rad//s to rpm',1);

出力制約に既知の値 2000 rpm を指定します。

opspec.Outputs(1).Known = 1;
opspec.Outputs(1).y = 2000;

更新された操作点の仕様を表示します。

opspec
opspec = 


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

States: 
----------
     x         Known    SteadyState     Min         Max        dxMin       dxMax   
___________ ___________ ___________ ___________ ___________ ___________ ___________
                                                                                   
(1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
   0.543       false       true        -Inf         Inf        -Inf         Inf    
(2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s
  209.48       false       true        -Inf         Inf        -Inf         Inf    

Inputs: 
----------
  u   Known  Min   Max 
_____ _____ _____ _____
                       
(1.) scdspeed/Throttle  perturbation
  0   false -Inf   Inf 

Outputs: 
----------
  y   Known  Min   Max 
_____ _____ _____ _____
                       
(1.) scdspeed/rad//s to rpm
2000  true  -Inf   Inf 

モデルの平衡化

これらの仕様を満たす操作点を検出します。

op1 = findop(mdl,opspec);
 Operating point search report:
---------------------------------

opreport = 


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

Operating point specifications were successfully met.
States: 
----------
    Min          x          Max        dxMin        dx         dxMax   
___________ ___________ ___________ ___________ ___________ ___________
                                                                       
(1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
   -Inf       0.54363       Inf          0      2.6649e-13       0     
(2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s
   -Inf      209.4395       Inf          0      -8.4758e-12      0     

Inputs: 
----------
   Min        u        Max   
_________ _________ _________
                             
(1.) scdspeed/Throttle  perturbation
  -Inf    0.0038183    Inf   

Outputs: 
----------
Min   y   Max 
____ ____ ____
              
(1.) scdspeed/rad//s to rpm
2000 2000 2000

操作点探索レポートに、仕様が正常に満たされ、両方の状態が予想どおり定常状態にあること (dx = 0) が示されます。

平衡化中に出力の範囲を指定することもできます。たとえば、19002100 rpm の間に定常状態条件があることがわかっているとします。速度をこの範囲に平衡化するには、操作点の仕様を変更します。

opspec.Outputs(1).Min = 1900;
opspec.Outputs(1).Max = 2100;

この場合は出力値がわかっていないので、出力は不明として指定します。出力値の初期推定を指定することもできます。

opspec.Outputs(1).Known = 0;
opspec.Outputs(1).y = 2050;

これらの仕様を満たす操作点を検出します。

op2 = findop(mdl,opspec);
 Operating point search report:
---------------------------------

opreport = 


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

Operating point specifications were successfully met.
States: 
----------
    Min          x          Max        dxMin        dx         dxMax   
___________ ___________ ___________ ___________ ___________ ___________
                                                                       
(1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
   -Inf       0.5436        Inf          0      2.9879e-13       0     
(2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s
   -Inf      209.4799       Inf          0      -9.8968e-13      0     

Inputs: 
----------
   Min        u        Max   
_________ _________ _________
                             
(1.) scdspeed/Throttle  perturbation
  -Inf    0.0050021    Inf   

Outputs: 
----------
   Min        y        Max   
_________ _________ _________
                             
(1.) scdspeed/rad//s to rpm
  1900    2000.3853   2100   

操作点探索レポートに、仕様が正しく満たされたことが示されます。

モデルを平衡化した後、次のことが可能です。

参考

| |

関連するトピック