シミュレーションを前​回の停止時刻から再開​する方法はありますか​?

9 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 6 Jun 2025

シミュレーションを停止後、停止時刻から再度シミュレーションを行いたいと考えています。シミュレーション停止時の最後の状態をメモリに保存し、その情報を取得して接続し、続行する方法はありますか?
私の状況では、10時間以上モデルを実行し、その後いくつかのパラメーターを調整して、停止した時点からシミュレーションを再実行します。もし最初からシミュレーションを実行し直すと、非常に時間の無駄になります。

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 6 Jun 2025
Simulink.op.ModelOperatingPoint を使用して、以下のようにシミュレーションでモデルの操作点を保存できます。
fuelsys set_param('fuelsys','SaveFinalState','on','FinalStateName',... 'myOperPoint','SaveOperatingPoint','on'); simOut = sim('fuelsys','StopTime','2') myOperPoint = simOut.myOperPoint
その後、以下のように上記に保存したSimluik.op.ModelOperatingPointオブジェクトを使用して初期状態を指定することで、2秒の停止時点からシミュレーションを開始することができます。
set_param('fuelsys','LoadInitialState','on','InitialState',... 'myOperPoint'); myOperPoint = simOut.myOperPoint
これで、以下のキャプチャ画像に示すように、その時点からシミュレーションが動作していることがわかります。
注意: 添付の記録 file (UI_Iteractive_way.mp4)は、UIインタラクティブを介して操作点を保存および復元する方法を示しています。
モデル操作点の使用の詳細については、次のリンクを参照してください。
 
- モデル操作点を使用したシミュレーション ワークフローの高速化
- Simulink.op.ModelOperatingPoint
- Specify Initial State for Simulation

More Answers (0)

Categories

Find more on モデル化 in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!