Using Simulink Fast Restart in a parallel computed optimization problem
이전 댓글 표시
Hi, I have a Simulink Model which works perfect when i turn on fast restart. I can change the Values of my parameters A1, A2 and i by hand and it does not need to recompile.
Now i want to use this model in a parameter optimization problem using parallel computing AND fast restart. It would save a lot of time to cut out the recompiling time. The Problem is parallel computing works great but the model compiles for every iteration.
I set up the optzimization like this
% Simulator set up with experiment data, multiple experiments
Simulator = createSimulator(Exp(1));
Simulator = fastRestart(Simulator,'On'); %Fast Restart ON??
% estimation function handle, sdo requires function with just one input
% argument
estFcn = @(param) ObjectiveFun(param,Simulator,Exp);
% optimization options
parpool
opt = sdo.OptimizeOptions;
opt.Method = 'surrogateopt';
opt.UseParallel = true;
opt.OptimizedModel = 'Model';
opt.ParallelFileDependencies = files;
opt.MethodOptions.PlotFcn = 'surrogateoptplot';
opt.MethodOptions.MaxFunctionEvaluations = Iterations;
% Optimization
vOpt = sdo.optimize(estFcn,param,opt);
I just tried running the same code without parallel computing (opt.UseParallel = false) and fast restart works.. but not with parallel computing
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!