Accelerator/Rapid Accelerator use with Fuzzy Logic Controller
显示 更早的评论
I'm trying to use a genetic algorithm to iterate over my model, tuning the FIS parameters that i'm passing into the FLC in my Simulink model. Currently, the MATLAB code looks similar to the following:
global generic_fis;
% generic_fis = object.convertChromosome2FIS(chromosome); (edited out as not strictly accurate - replaced with following)
generic_fis = newfis('testfis');
sim(mdl);
Where generic_fis is specified as the input parameter to the Fuzzy Logic Controller block. I've also tried saving this FIS to a file, i.e. 'tunableFIS.fis', and specifying this as the input parameter to the Fuzzy Logic Controller block, but this has yielded the same result. Essentially, in Accelerator mode the model builds every time the sim() command is called. I've read through previous questions about this, which seem to indicate that any tunable parameters need to be contained within an inport to the model, but I'm not sure how to apply this to a Fuzzy Logic Controller since what i'm altering is the parameter of this block, and I'm not sure how to use a model variable to change this value as the only input available for this block is the input signal.
So to summarise, my question is: How do I stop the model re-building/initialising every time the sim() command is called in accelerator/rapid accelerator mode given that what i'm trying to update is the FIS parameter of the Fuzzy Logic Controller block?
Cheers,
Sam
采纳的回答
更多回答(1 个)
Ning Zhang
2017-9-6
0 个投票
You can consider to use the rapid simulation, to run over a range of parameters:
https://www.mathworks.com/help/rtw/examples/using-rsim-target-for-parameter-survey.html
If you are on MATLAB R2017a, you can consider to incorporate the "parsim" with mutli-core CPUs
https://www.mathworks.com/help/simulink/examples/parallel-simulations-using-parsim-parameter-sweep-in-rapid-accelerator-mode.html
类别
在 帮助中心 和 File Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!