Loading SimState and modification to the model file
7 次查看(过去 30 天)
显示 更早的评论
Hi,
I recently discovered this new SimState Matlab feature and am trying to get it working for my model file. This model file involves an S-function. Until today, I had been using the old "save states to workspace" to restart my simulation at any point I wanted. This had been working fine, except that the data stored in the delays was not recovered. To be complete, I should mention that I save and restore the state of my S-function manually.
Now, it seems that I can't use SimState correctly, and I suspect that I did something wrong - but I can't figure out what. The problem comes as follows:
1. I launch a simulation up to, say, t=10s.
2. Without making any modification to the model file, I generate the necessary data to restart my S-function at t=10s (basically write some data that was generated at the last time step into a file that'll be read by my S-function).
3. I modify the Stop time to, say t=20s, but don't change the Start time.
4. I tick the "Initial State" box in the configuration parameter dialog and provide the SimState as an input.
5. I re-launch my simulation and get the following error message: "Simulink cannot load the initial SimState because the model, 'my_model', was changed after the SimState was saved. Run the simulation again and resave the SimState."
I checked this page http://www.mathworks.com/help/toolbox/simulink/ug/brc69t5-1.html and I don't believe I am making any changes that would cause the rebuild of the model. I should also mention that I don't use any fancy feature like accelerators or fancy solvers (I'm using Euler).
Do you have any insight of what may be going wrong?
Cheers, Karim
2 个评论
Kaustubha Govind
2011-3-10
1) Have you written your S-function to support SimState? (see http://www.mathworks.com/help/toolbox/simulink/sfg/brza339.html)
2) If you remove your S-function and perform these steps with the modified model, are you able to successfully restore state and start simulation? (In other words, can you isolate the issue to the S-function block)
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!