how can I write GA code to simulate the simulation model?

Hi,
I am using GA as an optimization process to estimate 3 parameters in my model by comparing this with the desired model. This is working properly when I use mathematical equations of the models in objective function to get results and the Best Function graph looks acceptable. However, when I use my model as a simulation program (blocks) and import the result into GA code by sim(''), the Best Function graphs keep in constant value. My issue is that how can I write GA code to simulate the simulation model (import & export data while the GA program run). Is there anyone who has been working with GA and simulation?
Thanks

回答 (1 件)

Ab
Ab 2014 年 12 月 17 日

0 投票

The fitness function is: sum(y1-y2)^2, this is to keep the error small.
In every single generation will take the data from y1 and y1 mathematically from m-file, This has been done.
However, I need GA taking the data from simulation (blocks).
Can the ga code import y1 and y2 data from the simulation?
Thanks

カテゴリ

ヘルプ センター および File Exchange で MATLAB Coder についてさらに検索

質問済み:

Ab
2014 年 12 月 15 日

回答済み:

Ab
2014 年 12 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by