continuous하게만 사용가능한 블럭들을 한번에 볼수 있는 방법이 있을까요?
조회 수: 5 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2020년 9월 8일
편집: MathWorks Support Team
2025년 11월 14일
시뮬링크를 fixed step solver를 사용하고자하는데, 다음과 같은 에러가 발생합니다.
"FixedStepDiscrete" solver cannot be used to simulate block diagram <model_name> because it contains continuous states.
continuous 하게만 사용가능한 블럭들을 모델에서 포함하고 있는것 같은데, 이런 에러 블럭들을 한번에 볼수 있는 방법이 있을까요?
채택된 답변
MathWorks Support Team
2025년 11월 14일
편집: MathWorks Support Team
2025년 11월 14일
Continuous 블락을 찾는 방법을 알려드립니다. 일단 솔버는 기존에 에러 없이 사용가능하셨던 Variable Steps 솔버로 세팅 후, 하기의 과정을 진행합니다.
1. Simulink.BlockDiagram.getInitialState 명령어 사용
예시)
open_system(docpath(fullfile(docroot, 'toolbox','simulink','examples','ex_execution_order')))
model = gcs;
states = Simulink.BlockDiagram.getInitialState(model);
if ~isempty(states)
for n=1:length(states.signals)
if strcmp(states.signals(n).label,'CSTATE')
states.signals(n).blockName
end
end
end
코드 실행 결과:
ans =
'ex_execution_order/car dynamics/Integrator'
2. sldebug 명령어 사용
하기의 예시와 같이 sldebug 사용 후, states 입력하시면 모든 states 에 대한 결과가 표시됩니다. 디버깅 종료는 quit 을 입력합니다.
예시)
>> open_system(docpath(fullfile(docroot, 'toolbox','simulink','examples','ex_execution_order')))
>> sldebug(bdroot)
%----------------------------------------------------------------%
[TM = 0 ] simulate(ex_execution_order)
(sldebug @0): >> states
Continuous States for 'ex_execution_order':Idx Value (system:block:element Name 'BlockName') 0. 0 (0:0:0 CSTATE 'ex_execution_order/car dynamics/Integrator')
Discrete States for 'ex_execution_order':
Idx Value (system:block:element Name 'BlockName')
0 0 (1:0:0 DSTATE 'ex_execution_order/discrete cruise controller/Unit Delay1')
1 0 (1:5:0 DSTATE 'ex_execution_order/discrete cruise controller/Unit Delay')
(sldebug @0): >> quit
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!