how to execute optimization of a function which runs a simulink model?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
My problem is to find an optimal value o a matrix "K" 1x16 which maximize the output of 12 simulation of a simulink model. I have a simulink model which produce a certain set of output. The same simulink model is running 12 times and I have to evaluate the minimum output over the 12 simulation runs. Then, I wrote a function that when it is called with input argument "K" it returns the minimum output (a scalar) over the 12 simulation runs of the simulink model. Eventually, I would like to maximize such output by changing the value of "K". Note that the 12 simulation runs launched by the funcion I wrote have the same parameter K.
I tried to use the basic call of "ga", i.e. [K, val] = ga(@myfun, 16) since there are basically 16 parameters (since K is a matrix 1x16) and myfun is the function which launch the 12 simulation runs with the input K. The function returns the oputput while the minimum output of the 12 simulations is found. Using this formulation, I found that the result is always the same, and I know that it is not the optimal.
I used the same method by using fminimax instead of ga, and the result was the same. I tried with different K0 a initial value for K but nothing changed.
Am I doing it wrong? In general, is it possible to solve an optimization problem in which the fitness function is not analytical but it is related to a simulink model (even if the function which launch the simulation of the simulink it is formally a matlab function)?
Thank you all!
Matteo
2 comentarios
Walter Roberson
el 15 de Dic. de 2017
"In general, is it possible to solve an optimization problem in which the fitness function is not analytical but it is related to a simulink model"
Yes.
The general process you describe is acceptable.
It sounds as if you might have problems either in myfun or in the function that returns the minimum output of the 12 runs of myfun.
Respuestas (0)
Ver también
Categorías
Más información sobre Manual Performance Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!