out of memory when using rapid accelerater and sim
3 views (last 30 days)
Show older comments
I have a HEV model and i need to tune a variable using GA. However, I encounter a difficulties. When i call the model from a m file using sim, matlab start to generate the code, once it is done, it start to use a lot of memory and finally run out of the resources. I tried to stop the program when i realize that, however, matlab crashed every time.
I use the following code at first, however, matlab return a message saying that the variable in my init_file.m is not defined. However, i used callbacks to call my init_file.m in my mdl. Another strange things is that, i can run this model with normal mode.
options = simset('SrcWorkspace','current');
sim('PHEV_P_Master',[],options);
Then i changed my code:
paramNameValStruct.SimulationMode = 'rapid';
paramNameValStruct.AbsTol = '1e-5';
paramNameValStruct.SaveState = 'on';
paramNameValStruct.StateSaveName = 'xoutNew';
paramNameValStruct.SaveOutput = 'on';
paramNameValStruct.OutputSaveName = 'youtNew';
simOut = sim('PHEV_P_Master',paramNameValStruct);
Then it start to run out of memory.
I have 12G ram and i could run this model solely in rapid accelerator mode(click the run button in simulink).
By the way, my operation system is win 7 X64, intel i5-2410m, my compiler is GCC, matlab 2016a.
Thanks.
0 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!