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!