最新のリリースでは、このページがまだ翻訳されていません。 このページの最新版は英語でご覧になれます。

投影ベースの平衡化オプティマイザーを使用した定常状態のシミュレーション

この例では、findop で投影ベースのオプティマイザーを使用して、Simscape™ Multibody™ モデルの定常状態の操作点を検出する方法を説明します。結果の検証にはシミュレーションを使用します。

モデルを開く

Simulink モデルを開きます。

mdl = 'scdbackhoeTRIM';
open_system(mdl)

操作点の仕様の定義

操作点の仕様を作成する前に、モデルの初期条件を使用するようにモデルを構成します。

set_param(mdl,'LoadExternalInput','off')
set_param(mdl,'LoadInitialState','off')

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

ops = operspec(mdl);

出力に制約を課します。

ops.Outputs(1).Known = true(10,1);
ops.Outputs(1).y(1) = 0;    % Bucket angle
ops.Outputs(1).y(3) = 50;   % Upper angle
ops.Outputs(1).y(5) = -50;  % Lower angle
ops.Outputs(1).y(7) = 0;    % Base angle
ops.Outputs(1).y(9) = -45;  % Support angle

平衡化オプションの構成

平衡化オプティマイザーのオプションを構成します。'OptimizerType' オプションを 'graddescent-proj' に設定します。これは、モデルの物理的な状態の一貫性を強制する投影ベースの平衡化オプティマイザーです。平衡化の進捗状況を表示するには、'DisplayReport' オプションを 'iter' に設定します。

opt = findopOptions('OptimizerType','graddescent-proj',...
                    'DisplayReport','iter');
opt.OptimizationOptions.MaxFunEvals = 20000;

モデルの平衡化

これらの仕様を満たす定常状態の操作点を検出します。次のコマンドは数分かかります。

[op,rpt] = findop(mdl,ops,opt);
Optimizing to solve for all desired dx/dt=0, x(k+1)-x(k)=0, and y=ydes.
 
(Maximum Error)  Block
 ---------------------------------------------------------
(4.50000e+01) scdbackhoeTRIM/Out1
(3.88972e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Right/Revolute Joint  Arm
(3.25130e+00) scdbackhoeTRIM/Plant/Backhoe Arm/Arm-Bucket Joint
(2.92756e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.90835e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.87033e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.88039e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.75915e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.82770e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.83204e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.77134e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.77170e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.66093e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(1.91196e+00) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(1.48418e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.48194e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.92844e+00) scdbackhoeTRIM/Out1
(1.47015e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.46951e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47048e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47087e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47081e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47072e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47065e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47067e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47062e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47044e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47049e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47044e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47035e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.47009e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.46945e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.46915e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.46650e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.45218e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.43599e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.39092e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.32192e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.32141e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34505e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34732e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34643e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34590e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34577e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34579e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34598e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34609e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34550e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.34208e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.33732e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(1.21415e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(5.03874e-01) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(5.04915e-01) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(3.02028e-01) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(2.00116e-01) scdbackhoeTRIM/Out1
(2.80354e-01) scdbackhoeTRIM/Out1
(8.41676e-02) scdbackhoeTRIM/Plant/Lower Arm to Mounting Assembly
(9.96485e-02) scdbackhoeTRIM/Plant/Lower Arm to Mounting Assembly
(1.04079e-01) scdbackhoeTRIM/Plant/Lower Arm to Mounting Assembly
(9.08181e-02) scdbackhoeTRIM/Out1
(8.72986e-02) scdbackhoeTRIM/Out1
(2.96463e-02) scdbackhoeTRIM/Plant/Backhoe Arm/Upper-Lower Arm Joint
(9.04872e-03) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(2.39393e-03) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Right/Revolute Joint  Arm
(1.28775e-03) scdbackhoeTRIM/Plant/Backhoe Arm/Hydraulic Actuator Lower - Upper Arm/Prismatic  Joint
(1.61736e-04) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support  Arm Left/Revolute Joint  Arm
(1.59106e-04) scdbackhoeTRIM/Plant/Hydraulic Actuator Mounting - Lower Arm/Prismatic  Joint
(1.70351e-05) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate
(2.39957e-05) scdbackhoeTRIM/Plant/Hydraulic Actuator Mounting - Lower Arm/Prismatic  Joint
(1.49012e-05) scdbackhoeTRIM/Plant/Hydraulic Actuator Mounting - Lower Arm/Hydraulic Actuator/Simulink-PS Converter1
(7.45058e-06) scdbackhoeTRIM/Plant/Backhoe Arm/Hydraulic Actuator Lower - Upper Arm/Hydraulic Actuator/Simulink-PS Converter1
(7.45058e-06) scdbackhoeTRIM/Plant/Backhoe Arm/Hydraulic Actuator Lower - Upper Arm/Hydraulic Actuator/Simulink-PS Converter1

Operating point specifications were successfully met.

モデルのシミュレーション

計算した定常状態からモデルをシミュレートします。

set_param(mdl, 'LoadExternalInput','on')
set_param(mdl, 'ExternalInput','getinputstruct(op)')
set_param(mdl, 'LoadInitialState','on')
set_param(mdl, 'InitialState','getstatestruct(op)')
sim(mdl)

スコープを開いて結果を検査します。

open_system([mdl, '/Joint Angle Trajectories'])

シミュレーションの結果を見ると、5 つの角度がそれぞれの期待値に平衡化されていますが、数値的なノイズと不安定性のため、軌跡が時間とともに若干ずれていきます。フィードバック コントローラーを使用して、角度を安定させることができます。

bdclose(mdl)

参考

関数

関連するトピック