How to realize a parameter identification with genetic algorithm?

1 次查看(过去 30 天)
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 个评论
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 CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by