Initfcn callback wont update during the sensitivity analysis of my model

1 次查看(过去 30 天)
Hello everyone,
I've come across a strange problem concerning the sensitivity analysis tool and the initialization callback of my Simulink model. The initfcn callback uses some of the parameters in the parameter set of the sensitivity analysis session. When I run the sensitivity analysis the callback doesn't see that the parameters are changing, it uses the same values (the default values in the base workspace) for each iteration.
OCVmine, OCVmaxe, lrStarte, lrEnde, me, pOCVmide are the variables in the base workspace that are being varied in the sensitivity analysis and this is my initfcn callback:
[SoCe, Vse] = pwp(OCVmine, OCVmaxe, lrStarte, lrEnde, me, pOCVmide);
set_param([gcs '/Battery/Cell 1'], 'SoC', 'SoCe', 'OCV', 'Vse');
[~, ix] = min(abs(SoCe - lrEnde/100));
Vinitiale = Vse(ix);
The variables are actually changing because the blocks in my model that use them see that they are changing, it's only the callback that doesn't seem to notice.
The top window shows the various samples of the sensitivity analysis session being evaluated, while the bottom window shows the baseworkspace.
Screenshot 2019-06-28 at 20.00.26.png
Does anyone have any clue what may be causing this problem?
Thank you and enjoy your day.

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by