Clear Filters
Clear Filters

シミュレーション中に​パラメータを時間変化​させる方法はあります​か?

30 views (last 30 days)
和希
和希 on 29 Jun 2023
Commented: 和希 on 4 Jul 2023
Simulinkで伝達関数G(s)=K/(T1*s+1)の係数を変化させ応答の変化を調べたいと思っています。sはラプラス変数、K、T1が係数です。今回はT1だけをシミュレーション中に変化させたいです。具体的にはシミュレーション時間が100秒ではT1の値を1から10へ線形的に変化させたいです。何か方法はありますか?

Accepted Answer

Toshinobu Shintai
Toshinobu Shintai on 4 Jul 2023
Edited: Toshinobu Shintai on 4 Jul 2023
デバッグタブで停止したい時間を指定し、モデルを実行します。
モデルを実行すると、100秒で一時停止します。この時にパラメーターを変更し(例えばワークスペースに置かれているT1変数の値を1から10に書き換える)、以下のコマンドをコマンドウィンドウで実行します。
set_param(model_name, 'SimulationCommand', 'update')
model_nameは、実行したモデルファイルの名前です。
次に、再度実行ボタンをクリックします。
これにより、変更されたパラメーターが反映された状態で、残りのシミュレーション時間分を実行します。
  1 Comment
和希
和希 on 4 Jul 2023
回答ありがとうございます。教えて頂いたことを試してみたいと思います。

Sign in to comment.

More Answers (0)

Categories

Find more on 一般分野への適用 in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!