Simstate and the Memory Block

1 vue (au cours des 30 derniers jours)
Nathan Fitzgerald
Nathan Fitzgerald le 14 Juil 2016
I'm trying to understand how to access and/or change the SimState of Simulink's Memory block. For example, I opened up the built-in simulink demo "sldemo_bounce" and turned on the options for saving the complete SimState in the final state. I used the default variable name xFinal.
After running the simulation, xFinal.loggedStates is a 2x1 struct array. Both items refer to the blockName 'sldemo_bounce/Second-Order Integrator' and refer to the velocity and position integrators. I can't seem to find any indication of the saved state of the Memory block from that block diagram, although it definitely has a state.
The reason why I care is that I have a different model that uses a memory block where I'd like to restart the simulation using SimState for all of the other states except that memory block. For the memory block needs to be reinitialized before restarting the simulation, but I can't find a good way to do it. For my application, I'm simulating a feedback controller on a plant model and trying to assess how the control responds to "failures" in the plant. The intent was to simulate the model for a "long" time to get rid of all of the startup transients in the control, save the SimState, then execute a series of failure simulations that all start from the "steady" condition as saved by the SimState. The problem is that there are 1 or 2 states in the model that are controlled by Memory blocks that I would like to reset before running my failure simulations, and I can't figure out how to access them.
Thanks,

Réponses (0)

Catégories

En savoir plus sur Schedule Model Components dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by