Greetings,
I am having an issue with Stateflow that has me completely baffled, and I suspect it is related to SimPower Systems.
I have an abc-to-dq SimPowerSystems block - that is feeding a f(u) block, which takes the RMS value. The equation in the f(u) block is sqrt(u(1)^2+u(2)^2)/sqrt(2). That (double) output is being fed into a stateflow block, which does some calculations and changes states based on that value being over a threshold for a certain amount of time. I have that same output feeding a standard scope. The output on the scope looks normal - it fluctuates between .49 and .51. When I view it in Stateflow, it tracks normally, but then for one brief moment the value skyrockets to 193919841805095.500000. Since the Simulink scope reads the data fine but Stateflow does not, this makes me think there is a data type miscommunication. I have tried using standard math blocks instead of the f(u), and I get the same issue (though it is a smaller number, around 8 instead of 1.9 gigazillion). I've tried using a convert block (to double), but that doesn't help.
Any insight here would be appreciated, becasue I am stumped ..