Data store memory(DSM)
8 次查看(过去 30 天)
显示 更早的评论
Hello
I am using Data store memory block in my simulink model to initialize a variable(array) to use in a matlab function block.Its a big model with tight tolerances. When I run I see that the DSM block looks into the full array(variable is size 50) at every time step so basically the simulation is EXTREMELY SLOW. How can I get rid of this.
Thank you
James
0 个评论
采纳的回答
Nirmal Gunaseelan
2012-2-27
Hi James,
Looking through all the warnings, it appears from the diagnostics that the MATLAB Fcn block is running at minor times steps (the model has continuous states or you have chosen a continuous state solver) and obviously the block is storing values at all time steps (including minor time steps). I don't think the DSM block has anything to do with this apart from providing the diagnostics. These write after write diagnostics are to make sure that this is what you intended to do and are not an error by themselves. Currently, the way you have modeled is making the block write to elements at all minor time steps. Could you change the solver type (say to discrete if your model doesnt have continuous states) and see if minor steps go away? This will also have a significant improvement in performance, which was your original issue.
-Nirmal
4 个评论
Nirmal Gunaseelan
2012-2-27
I'm going to try out a few things, but in the mean time could you also provide a snippet of your access code in the MATLAB Fcn block? I just want to verify that element wise access is actually happening.
更多回答(2 个)
Nirmal Gunaseelan
2012-2-27
Hi James,
Could you give more details on what blocks are being used with the DSM block? Are you using a Data Store Write block as well?
Is the problem that the DSM block is accessing at every time step, or is it that you want only certain parts to be accessed? Have you tried Element wise assignment/selection?
-Nirmal
James
2012-2-28
2 个评论
Nirmal Gunaseelan
2012-2-28
Hi James,
I wanted to try out other ways of achieving your functionality without using shiftu/if conditions. I am not sure if we are preventing full access by using those lines. I'll get back to you.
-Nirmal
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!