/ Published in: MatLab
Expand |
Embed | Plain Text
% 10.10 Project % Spring 2011 % Jackie Simpson and Ben Frank %========================================================================== % Program flow has been decided-the user wants to optimize the process || %========================================================================== %:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: % A small function necessary as an event handler for button pushes :: %:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function Optimizer(hObject,eventdata) %this function is called in the event that the "optimize" button is pushed. %when it is called, it starts the optimization process global ReactorHeater ReactionHeatingPeriod AmountSolvent_S2 field1 field2 field3 % %:::::::::::::::::::::::::::::::::::::::::::::::::: % Step 2(B) - Optimize the process :: %::::::::::::::::::::::::::::::::::::::::::::::::::------------------------ % % STEP B1-------------------------------------------> ReactorHeater = 100; % ReactionHeatingPeriod = 1000; % AmountSolvent_S2 = 3; % Optimization_Variables_Initial_Values = [ReactorHeater; ReactionHeatingPeriod; AmountSolvent_S2]; % % STEP B2-------------------------------------------> % Search for optimum values of: % a) Reactor heater output % b) Period of heating the reactor % c) Amount of extraction solvent, S2 % options = optimset('Display', 'iter'); % this OPTION displays the value of % the Objective function at each iteration [Variables, Objective] = fminsearch(@Simulator, Optimization_Variables_Initial_Values, options); % the responsibility of fminsearch is to carry out the optimization. % Results_Displayer; end
You need to login to post a comment.
