How to realize a parameter identification with genetic algorithm?

1 回表示 (過去 30 日間)
Verena Stangl
Verena Stangl 2018 年 4 月 2 日
コメント済み: Star Strider 2018 年 4 月 7 日
Dear Community! I've developed a RC-model of a building and I'm using that model as a state space model. I have measurement data of the building (room temp., ambient temp., solar radiation,..). I've established a grey box model in matlab and compare the measured room temperature with the temperature of the building model. That works so far, but according to the start parameters of R and C (of my State space model matrix) I get a great variety in my match result. So I would like to define the start parameters of the R's and C's through a genetic algorithm. Does anybody have an idea? I would be grateful for your help.
opt = greyestOptions('SearchMethod', 'fmincon'); %Options used in grey box model
options = gaoptimset('HybridFcn',{@patternsearch}); % idea for ga
object = sum((y_m-y).^2); %difference error of modelled and measured temperature
[x, fval] = ga(object,8, options)

回答 (1 件)

Star Strider
Star Strider 2018 年 4 月 2 日
Your objective function does not allow the ga function to adjust any of the parameters of your model. (I would have expected this to have thrown an error.)
It ideally should be something like this:
object = @(b) sum((y_m(b)-y).^2);
where your ‘y_m’ model is a function of ‘b’ (or whatever you want to call your parameter vector). You can pass other parameters to it as well, if necessary. See the documentation on Passing Extra Parameters (link).
  4 件のコメント
Verena Stangl
Verena Stangl 2018 年 4 月 7 日
Okay, thank you. I have Matlab R2017b installed. Have a nice weekend!
Star Strider
Star Strider 2018 年 4 月 7 日
My pleasure.
The same likely applies to R2017b. When I looked through the Release Notes for R2018a, the options for ga had not changed.
I hope you enjoy yours as well!
If my Answer helped you solve your problem, please Accept it!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by