= Step 6- Post-optimization analysis =
Explanation: Once completed, the optimization run produces a variety of data that can be used for a plethora of analyses. The reader is encouraged to be creative in analyzing the data. There are some required steps, however, to harness the data as well as some basic pre-determined analyses developed by the thesis and coded in PVTOM.
#Once optimized, you must export and save the data. In the Optimization Toolbox toolbar, select ‘File’-> ‘Export to Workspace’.
#A new window will open called ‘Export to Workspace’. Select ‘Export results to a MATLAB structure named:”
#In the box to the right of the selected option, type a name reflecting the case study. A recommended naming mechanism is ‘CityHousetypeResultsOptimizationtry’. For example, if it’s the second time I’m optimizing a DR house in Montreal, I type ‘MontrealDRresults2’.
#The reader is also encouraged to save the optimization options in a similar fashion. This can be done by selecting ‘Export problem and options to a MATLAB structure named:’ and below it, ‘Include information needed to resume this run’. A recommended naming mechanism is ‘CityHousetypeOptionsOptimizationtry. For the 2nd optimization of a DR house in Montreal, this would become ‘MontrealDRoptions2’.
#Select OK. You will now see two data structures in your workspace. Data structures are a compilation of data arrays. You can save data structures in a workspace by selecting the structures and clicking the ‘Save’ button on the MATLAB Workspace toolbar . You can upload a saved data structure by clicking the ‘Import Data’ button
#You can access the optimization results by double clicking the data structure with the exported results (‘MontreadDRResults2’ for the example above). There are 37 optimized results based on the defined optimization parameters.
#The results are non-discrete, while they must be discrete to have real meaning. Please refer to thesis for a more detailed explanation. For the example above, this can be resolved by typing ‘ceil(MontrealDRResults2.x)’ in the command toolbox. The results are stored in an array on the workspace named ‘ans’. Copy and paste the matrix into Excel. For purposes of clarity, replaced assigned number for each technology with their actual name.
#Copy and paste the array named ‘fval’ in the results data structure next to the variables in Excel. The first column of values are life cycle costs and the second column are annual emission balance for each member of the population. Unless tampered with by the user, the variables and the function values in each row represent a member of the optimized population.
#Plot emissions against costs in Excel to obtain the Pareto front.
#You can ‘Sort’ the members based on costs or emissions in Excel. This will facilitate determining least costly or least emission-intensive systems based on optimized population.
#You can simulate a particular system configuration by typing ‘optimmasterversion(V1,V2,V3,…V7)’ in the MATLAB command toolbox. Each of the V variables is a numerical value for the respective variable. They are, in order from left to right, number of pv rows in parallel, number of battery rows in parallel, number of batteries in a string, number of CHP units in parallel, CHP technology assigned number, PV technology assigned number, and battery technology assigned number. Please note that the assigned numbers for the technologies cannot be zero.
#Indicators defined in Chapter 3 of thesis can be calculated after simulation run by typing ‘indicators’ in the MATLAB command window.
#Finally, There is no ‘standardized’ post-optimization m-file. Mining data is a skill that the user must acquire over time. This is why knowledge of MATLAB and the thesis is important beforehand. While standardizing certain results and graphs can certainly be achieved in the future, the current version of PVTOM does not contain any such features. As with any simulation and optimization method, producing and interpreting meaningful data is an art that will take time to develop.<br>
= Step 5- Define case study =
#Press ‘Start’. Depending on your processor speed, an optimization can take as much as a couple of hours. Once the reader feels comfortable with ‘PVTOM’, the optimization is typically quite stable and reliable and can be left alone until completion. There is a ~10% chance that the optimizer will crash. Restart the optimizer if the optimization fails and diagnose the problem only if a problem persists. As a caveat, the reader should remove any hibernation/shut down features for their computer.
#DO NOT CLOSE ANY WINDOWS WHEN COMPLETE.
#NOTE: Don`t worry about `log of zero` warnings. <br><br>
[[Category:Queens_Applied_Sustainability_Group_Lab_Protocols]] [[Category:Cogeneration]] [[Category:Photovoltaics]]