Posted By

bfrank on 04/09/11


Tagged

1010


Versions (?)

Optimizer


 / Published in: MatLab
 

  1. % 10.10 Project
  2. % Spring 2011
  3. % Jackie Simpson and Ben Frank
  4.  
  5. %==========================================================================
  6. % Program flow has been decided-the user wants to optimize the process ||
  7. %==========================================================================
  8. %::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9. % A small function necessary as an event handler for button pushes ::
  10. %::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  11. function Optimizer(hObject,eventdata)
  12. %this function is called in the event that the "optimize" button is pushed.
  13. %when it is called, it starts the optimization process
  14. global ReactorHeater ReactionHeatingPeriod AmountSolvent_S2 field1 field2 field3
  15. %
  16. %::::::::::::::::::::::::::::::::::::::::::::::::::
  17. % Step 2(B) - Optimize the process ::
  18. %::::::::::::::::::::::::::::::::::::::::::::::::::------------------------
  19. %
  20. % STEP B1------------------------------------------->
  21. ReactorHeater = 100;
  22. %
  23. ReactionHeatingPeriod = 1000;
  24. %
  25. AmountSolvent_S2 = 3;
  26. %
  27. Optimization_Variables_Initial_Values = [ReactorHeater; ReactionHeatingPeriod; AmountSolvent_S2];
  28. %
  29. % STEP B2------------------------------------------->
  30. % Search for optimum values of:
  31. % a) Reactor heater output
  32. % b) Period of heating the reactor
  33. % c) Amount of extraction solvent, S2
  34. %
  35. options = optimset('Display', 'iter'); % this OPTION displays the value of
  36. % the Objective function at each iteration
  37. [Variables, Objective] = fminsearch(@Simulator, Optimization_Variables_Initial_Values, options);
  38. % the responsibility of fminsearch is to carry out the optimization.
  39. disp('The finminsearch function was called')
  40. %
  41. Results_Displayer;
  42. end

Report this snippet  

You need to login to post a comment.