i want to use stateflow diagram to simulate optimization control to prevent the rate of reaction, but there is still error in diagram, could anyone help me?. The diagram can be changed and any rule can be used just for example and testing. Thank you

 채택된 답변

Sebastian Castro
Sebastian Castro 2015년 11월 4일

0 개 추천

The error message tells you what's wrong: There are 2 outputs that the chart has to produce, but the chart in its current state never assigns any value to them. So, when the Reactor block tries to look at its "heater" and "stirrer" signals they come up empty.
You need to add assignment operators to either the states
entry:
RPM = 1000;
Temp = 20;
or to your state transitions
{RPM = 1000; Temp = 20;}
As long as you do at least once at the beginning, Simulink will have stored values for RPM and Temp and this will remove the error. Typically you want to initialize your outputs to default values (usually zero) and then update them at certain points in your chart logic.
- Sebastian

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Stateflow에 대해 자세히 알아보기

질문:

2015년 11월 3일

댓글:

2015년 11월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by