pulse block in conditional subsystem
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a Simulink model which uses solver ode45 with variable step size. In Matlab I set an index, that determines, which of two different subsystems shall be executed. A conditional block in Simulink checks, based on this index, which subsystem shall be executed. The subsystems generate a signal, which I merge with a Merge-block for the same variable in the further model.
My problem is, that I have pulse blocks in one of these subsystems. Because of that I get an error saying ".../Pulse' is not allowed within conditionally executed subsystems since it contains a variable step size sample time."
I have two different solutions right now:
1) Make two separate Simulink models and execute the right one in Matlab. Disadvantage: The most of these both models is the same and I have to apply any changes to both models.
2) Execute both subsystems and choose the right signal by a multiplexer made of basic Simulink blocks. Compare the index with its possible values by a Compare-to-constant-block. If it has value 1, multiply 1 with the signal from subsystem 1 and multiply zero with the signal from subsystem 2. Disadvantage: Very slow, because both subsystems are executed
Does anybody have another idea to solve this problem with the possibility to still use accelerator mode?
Thank you very much, Jasmin
0 件のコメント
回答 (1 件)
Guy Rouleau
2013 年 8 月 24 日
Change the Pulse Generator from Time-Based to Sample-based. That way the block will take a fixed-step size and the error should go away.
Another option is to implement the funcitonality using basic blocks. Sum, Unit Delay and a Comparison should be all you need.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で General Applications についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!