Main Content

モデル統計の表示

この例では、モデル統計を使用してモデルの複雑度の変更による影響を判定する方法を説明します。

  1. 単純な機械システムを使用する例を開くには、以下を入力します。

    openExample('simscape/SimpleMechanicalSystemExample')

    Default Simple Mechanical System example model.

  2. モデル統計を表示するために、モデル ウィンドウの [デバッグ] タブで、[Simscape][統計ビューアー] をクリックします。

    Arrow pointing to the location of the Statistics Viewer tool on the canvas toolstrip.

    ツールが開きますが、データは一切含まれていません。[モデルの更新] ボタンに、統計の更新が必要であることを示す注意記号が表示されます。

    Empty Statistics Viewer window with update model button highlighted.

  3. [モデルの更新] ボタンをクリックします。ウィンドウにモデル統計の概要が表示されます。

    Updated overview window, which shows a summary

  4. 既定のページには、モデル統計の概要が含まれています。[変数] を選択すると、シミュレーション変数に関する情報が表示されます。このバージョンのモデルには代数変数がないことがわかります。

    Variables pane of the Statistics Viewer tool showing 0 in the Algebraic variables row.

  5. 運動の範囲を制限するために、Translational Hard Stop ブロックを、Translational Spring ブロックおよび Translational Damper ブロックと並列にモデルのブロック線図へと追加します。

    Simple Mechanical System example model with a Translational Hard Stop block added in parallel to the spring-damper system.

  6. 統計ビューアー ツールに戻ります。モデル コンフィギュレーションを変更した後も、[モデルの更新] ボタンに統計の更新が必要であることを示す注意記号が表示されることに注意してください。モデル統計を更新します。

    Variables pane of the Statistics Viewer tool showing 5 in the Algebraic variables row.

    代数変数が増えていることがわかります。これは、Translational Hard Stop ブロックで非線形性が追加されたことによるものです。ソルバーで線形最適化を使用してモデルをシミュレートすることはできなくなります。

参考

関連する例

詳細