Matlab GA toolbox coupling with external simulation code.
7 ビュー (過去 30 日間)
古いコメントを表示
I have the following problem when using GA tool for optimization. My objective function is the result of simulating each population in an external code. My question is: how can I handle the evaluation of the objective function for each population, running the simulation code for each individual.
2 件のコメント
Ameer Hamza
2020 年 10 月 12 日
Are you able to call the external simulation code from MATLAB, pass it some parameters, and get the output in return?
回答 (2 件)
Star Strider
2020 年 10 月 12 日
See if the approach in Parameter Estimation for a System of Differential Equations will do what you want. It uses the ga function to optimise the parameters for differential equations integrated using ode45.
8 件のコメント
Star Strider
2020 年 10 月 13 日
The diagram simply outlines the essence of the genetic algorithm.
You can likely substitute ‘ERANOS’ for ‘kinetics’ in my code, obviously with the appropriate changes. (I have no idea what ‘ERANOS’ is, so I cannot help you with it.)
Ameer Hamza
2020 年 10 月 13 日
編集済み: Ameer Hamza
2020 年 10 月 13 日
You can write a MATLAB function wrapper around the call to the external simulator. Something like this
function f = objFun(x)
% call your external simulation here, pass value of x
% and return the objective function value y.
y = call_external_simulation(x);
end
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!