Unstable output of a simulink model containing a Matlab S-funcion block
1 view (last 30 days)
Show older comments
Problem: Output is stable for small duration of simulation time and becomes unstable latter on. Model: My model contains an S-function block which has 6 input and 3 output ports. One of the outputs is fed to an spring-mass subsystem as an external force to the subsystem (other 2 outputs are connected to scope) . The outputs position, velocity and acceleration of the subsystem is then fed back to the S-function block, which in turn uses these values and timestep (calculated as difference between block.CurrentTime at present step and previous call to the S-function saved from block.CurrentTime at previous step) to update its output. I am putting discrete sample time for the S-function block to get an output (continuous doesn't work). I am also putting one unit delay to avoid any algebraic loop. Also If I break this loop between the S-function block and the subsystem the two give stable outputs (though apparently it is not the actual representation of the system, it seems to point out that the trouble is induced because of the coupling). Thanks for your help in advance.
0 Comments
Answers (0)
See Also
Categories
Find more on Block and Blockset Authoring 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!