Hello, I built a PI fuzzy control system using simulink with 3 gains that need to be tuned. I want to tune these gains automatically using genetic algorithm based on minimizing the mean square error. I have a m-file that runs the GA and calls a fitness function in another m-file. The fitness function m-file receives the gains as suggetsed population from GA and it is supposed to run the simulink block after sending the gains to it. The problem is that how to send the population (gains) during the run of GA to simulink and run the simulink block every generation???
FYI I used the sim command to run simulink and to workspace block to get the system output to the m-file. I tried using set_param,assignin commands and it didn't work (I knew because the output gains I got are not optimal for the controller)...
Please help me it's for my master thesis and I need this to finish...
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/41299-using-simulink-as-fitness-function-for-ga#comment_109772
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/41299-using-simulink-as-fitness-function-for-ga#comment_109772
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/41299-using-simulink-as-fitness-function-for-ga#comment_700709
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/41299-using-simulink-as-fitness-function-for-ga#comment_700709
Sign in to comment.