How to use a MATLAB optimization function to do optimization using different PCs
Show older comments
I am using "ga" function of MATLAB to Run an optimization. The optimization function is as follow:
function [Obj] = Fun_opt (x0)
...
e.Run('Sheet1.FirstExample');
...
end
description of the function: simply it opens excel, writes some data in excel, runs a Macro within the excel, receives some data from excel (objective function).
The macro file is as follow:
Sub FirstExample()
Dim objADS
....
objADS.Application.Simulation.Run (True)
....
end Sub
The Macro file also simply goes in main simulation software and writes guess data of ga (x0) function and then runs the simulator, and then receive some data from simulator (objective function).
In normal ways, ga sends first guess (x0) to excel (macro) and macro use this guess and runs the simulator. Then. it recieves objective function which will be read by matlab. This single process continues to reach the minimum of the objective function based on the optimization algorithm. Now, I would like ga (or even any other possible function), send different guess to different computers to do simulation at the same time. For example, I have 5 PCs, then the optimization function produces 5 different x0, and runs the simulator on 5 PCs. Again the same process goes on and on. This way my simulation speed will increase.
I should mention I have to do it on different computers as my the main simulator (Aspen) licence does not allow it to be open in the same computer twice.
Accepted Answer
More Answers (0)
Categories
Find more on Problem-Based Optimization Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!