how to execute optimization of a function which runs a simulink model?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2017년 12월 15일
"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.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Manual Performance Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!