Main Content

addoutputspec

出力仕様を操作点の仕様に追加

説明

newOpspec = addoutputspec(opspec,block,port) は、Simulink® モデルの出力仕様を既存の操作点の仕様または操作点の仕様の配列に追加します。出力仕様は、ブロック block の指定された出力端子 port から発生する信号用に追加されます。

指定された端子の幅を検出するために、addoutputspec コマンドはモデルを再コンパイルします。

すべて折りたたむ

Simulink モデルを開きます。

sys = 'scdspeed';
open_system(sys)

モデル用に既定の操作点の仕様オブジェクトを作成します。

opspec = operspec(sys)
opspec = 


 Operating point specification for the Model scdspeed.
 (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.) 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: 
----------
    <strong>u</strong>    <strong>Known</strong>    <strong>Min</strong>     <strong>Max</strong>
    <strong>_</strong>    <strong>_____</strong>    <strong>____</strong>    <strong>___</strong>

(1.) scdspeed/Throttle  perturbation
    0    false    -Inf    Inf

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

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

rad/s to rpm ブロックの出力端子に出力仕様を追加します。

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

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

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

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

newspec
newspec = 


 Operating point specification for the Model scdspeed.
 (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.) 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: 
----------
    <strong>u</strong>    <strong>Known</strong>    <strong>Min</strong>     <strong>Max</strong>
    <strong>_</strong>    <strong>_____</strong>    <strong>____</strong>    <strong>___</strong>

(1.) scdspeed/Throttle  perturbation
    0    false    -Inf    Inf

Outputs: 
----------
     <strong>y</strong>      <strong>Known</strong>    <strong>Min</strong>     <strong>Max</strong>
    <strong>____</strong>    <strong>_____</strong>    <strong>____</strong>    <strong>___</strong>

(1.) scdspeed/rad//s to rpm
    2000    true     -Inf    Inf

Simulink モデルを開きます。

sys = 'scdspeed';
open_system(sys)

モデル用に既定の操作点の仕様オブジェクトの 3 行 1 列の配列を作成します。

opspec = operspec(sys,[3,1])
opspec = 

Array of operating point specifications for the model scdspeed. To display an 
 operating point specification, select an element from the array.

rad/s to rpm ブロックの出力端子に出力仕様を追加します。

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

この出力仕様は、opspec 内のすべての操作点の仕様オブジェクトに追加されます。

opspec の各仕様に異なる出力制約を指定できます。たとえば、仕様ごとに異なる既知の値を指定します。

newspec(1,1).Outputs(1).Known = 1;
newspec(1,1).Outputs(1).y = 1900;

newspec(2,1).Outputs(1).Known = 1;
newspec(2,1).Outputs(1).y = 2000;

newspec(3,1).Outputs(1).Known = 1;
newspec(3,1).Outputs(1).y = 2100;

入力引数

すべて折りたたむ

Simulink モデルの操作点の仕様。以下のいずれかとして指定します。

  • OperatingSpec オブジェクト — 単一の OperatingSpec オブジェクトに出力仕様を追加します。

  • OperatingSpec オブジェクトの配列 — 配列内のすべての OperatingSpec オブジェクトに同じ出力仕様を追加します。仕様オブジェクトの Model プロパティはすべて同じでなければなりません。

モデルの OperatingSpec オブジェクトを作成するには、関数 operspec を使用します。

出力仕様を追加する Simulink ブロック。そのブロックのパスを含む文字ベクトルまたは string として指定します。blockopspec.Model で指定されている Simulink モデル内になければなりません。

出力仕様を追加する出力端子。[1,N] の範囲の正の整数として指定します。ここで N は指定された block の出力端子の数です。

出力引数

すべて折りたたむ

更新された操作点の仕様。OperatingSpec オブジェクトまたは opspec と同じ次元をもつ OperatingSpec オブジェクトの配列として返されます。newOpspec は、その配列 Outputs 内に新しい出力仕様が含まれる点を除いて opspec と同じです。

新しい出力仕様の制約と仕様はドット表記を使って変更できます。

代替機能

定常状態マネージャー

定常状態マネージャーを使用してモデルを平衡化するときに、出力仕様を対話的に追加できます。詳細については、定常状態マネージャーを使用した仕様からの操作点の計算を参照してください。

Simulink モデル

Simulink モデル内に出力仕様を直接追加できます。そのためには、仕様を追加する信号を右クリックし、[線形解析ポイント][平衡化出力制約] を選択します。

バージョン履歴

R2006a より前に導入