Error in Stateflow diagram

2 views (last 30 days)
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

Accepted Answer

Sebastian Castro
Sebastian Castro on 4 Nov 2015
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

More Answers (0)

Categories

Find more on Complex Logic in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!