automatic switch set by time simulink

21 ビュー (過去 30 日間)
JULIO JULIP
JULIO JULIP 2015 年 4 月 17 日
コメント済み: Youri Miessen 2021 年 4 月 14 日
Hello, i have a simulink model for small building distribution system, include PV and PU system. Is there any switching method in the matlab simulink, where can automatically trigger/choose from 2 inputs, 1 output and it driven by time (24hour period)?. For example; at time 9am-3pm, switch in A connection; at time 3.01pm-8.59am, switch in B connection. please help..

採用された回答

Sebastian Castro
Sebastian Castro 2015 年 4 月 17 日
You can
  • Use a Clock block to get the simulation time
  • Use a Math Function block to get the modulo, so time wraps to zero for a new day
  • Use an Interval Test block to check whether you are in the range 9 am - 3 pm
  • Feed that logical signal to your switch
For example, check this screenshot:
- Sebastian
  1 件のコメント
Youri Miessen
Youri Miessen 2021 年 4 月 14 日
But what if the stepsize is large (f.e. when you are simulating a whole year) and the modulo misses the exact point where it would wrap to zero for a new day?

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

その他の回答 (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