Simulink: Excite System for couple seconds but longer simulation time

2 ビュー (過去 30 日間)
Ko Fa
Ko Fa 2020 年 12 月 3 日
コメント済み: Ameer Hamza 2020 年 12 月 4 日
I am trying to excite a spring mass damper system with a sine wave block for 10 sec. But I want the overall Simulation time to be longer than that so I can see the response after the source is gone.
Any help to the right direction is gretly appreciated

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 12 月 3 日
There can be several ways, but the easiest might be to use a MATLAB function block: https://www.mathworks.com/help/simulink/ug/creating-an-example-model-that-uses-a-matlab-function-block.html. You can input the clock block: https://www.mathworks.com/help/simulink/slref/clock.html to the MATLAB function block and write the following code inside it
function y = fcn(t)
if t < 10
y = sin(t);
else
y = 0;
end
end
  2 件のコメント
Ko Fa
Ko Fa 2020 年 12 月 3 日
thank you!
Ameer Hamza
Ameer Hamza 2020 年 12 月 4 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by