Close
About
FAQ
Home
Collections
Login
USC Login
Register
0
Selected
Invert selection
Deselect all
Deselect all
Click here to refresh results
Click here to refresh results
USC
/
Digital Library
/
University of Southern California Dissertations and Theses
/
Utility – customer interface strategy and user application for electric vehicles and distributed generation management
(USC Thesis Other)
Utility – customer interface strategy and user application for electric vehicles and distributed generation management
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
I Master Thesis Utility – Customer Interface Strategy and User Application for Electric Vehicles and Distributed Generation Management By Tanay Manjrekar USC ID: 1130933441 Advisor: Dr. Mohammed Beshir A thesis submitted in partial fulfillment of The requirement for the degree of MASTER OF SCIENCE IN ELECTRICAL ENGINEERING UNIVERSITY OF SOUTHERN CALIFORNIA Viterbi School of Engineering MAY 2016 II Master Thesis ACKNOWLEDGMENT My thesis would not have been possible without the efforts of several people who have helped me over the last two semesters during my research at the University of Southern California. I would like to express my sincere gratitude to my advisor Dr. Mohammed Beshir. He has been an integral part of my education at USC and has been extremely helpful in guiding me through my research during my Master’s program. Several productive discussions with Dr. Beshir have helped me to understand the power utility grid on a large scale and his insights has helped me channel my thesis towards a real-world situation, which would not have been possible without his advice and Guidance based upon his extensive experience and knowledge. I would also like to thank Zeming Jiang who helped me throughout my research by providing data files and useful advice based upon his research on the USC car share ride program. I accessed Zeming’s research to better understand the customer related data and its implications for Electric Vehicles. I would also like to thank my friends Preetam Shingavi and Sankalp Pampattiwar who helped me analyze and develop the customer interface modules from a wide range of possible graphical user interface platforms. As prior to my thesis, I did not have sufficient experience in HTML, but Preetam helped me understand the basics and provided valuable resources to study and learn HMTL in very short period. I would also like to thank my friend Prashanth Morkonda for helping me with the study on integrating solar PV installations into the system. Finally, I would like to thank my parents who have supported me throughout all my endeavors. They have always encouraged me to accept challenges and learn from my experiences. I hope and believe that my efforts would give them happiness and satisfaction. III Master Thesis ABSTRACT As the transportation industry gears up for a positive transformation towards the introduction of electric vehicles and associated systems, the larger implications of this transformation needs to be studied. The introduction of electric vehicles would cause a ripple effect in multiple industries. The utility needs to be able to support this change, as it would have to potentially provide the power that will drive this change. There have been major developments in the power grid as well with respect to adopting improving technologies. Smart systems are being put in place, which help us to regulate and channelize the flow of power to better suit our needs. Due to the massive scale of the grid, the changes might take a longer time duration to come to effect. When these systems are in place, much like how we are connected across distances through internet we would have the capabilities to connect to multiple objects and devices for different purposes and solutions. However, just being connected does not provide solutions, rather an intelligent protocol of communication leads to better solutions. The introduction of EVs might have adverse effects on the power grid if the charging cycles for these EVs is not regulated. The power grid faces different demands and actual grid loads throughout the day, but they do follow a common pattern. If the power demand is plotted on a curve, we can observe peaks and lows, which repeat over time. This information can be utilized to direct the power that would be utilized for charging EVs. With the introduction of distributed power generation system, individual homeowners can have solar panel installations and provide power sufficient for their usage as well as source it to the grid. This brings into account a dynamic factor, which needs to be accounted for when the grid plans the dispatch of power to customers. Now it is easy to notice the number of nodes and systems that are in play in such a setup. The key to have all these systems function well together is a strong link of communication. A step ahead of setting up a communication channel in between the systems is to automate the entire setup. That would truly help us to utilize the resources at hand to their complete capabilities. Through this thesis, I intend to propose a system that would attempt to provide a solution for this communicating in between these intelligent distributed systems. To implement this system on a large scale the method to compute and communicate needs to be as simplistic as possible. Such a simplistic method would not be limited by the operating platform or the hardware in use. This is the central idea upon which the entire system is based upon. A simple, multiplatform, easy-to-use interface that can be scaled up in quick time and be equally efficient in delivering the desired output. The modularity of the systems allows the integration of multiple sub-systems like EVs, distributed power generation as well as distributed energy storage. IV Master Thesis V Master Thesis TABLE OF CONTENTS ACKNOWLEDGMENT ........................................................................................................................ II ABSTRACT .......................................................................................................................................... III TABLE OF CONTENTS ....................................................................................................................... V LIST OF FIGURES ............................................................................................................................. VII LIST OF TABLES ................................................................................................................................ IX CHAPTER 1: Introduction ................................................................................................................. - 1 - 1.1 Background ................................................................................................................ - 1 - 1.1.1 Introduction to Electric Vehicles ........................................................................ - 1 - 1.1.2 Implications of Electric Vehicles ........................................................................ - 1 - 1.1.3 Introduction to Distributed Power Generation and Storage ............................... - 2 - 1.1.4 Implications of Distributed Generation and Storage .......................................... - 2 - 1.2 Proposed Solution ...................................................................................................... - 3 - 1.3 Applications ............................................................................................................... - 3 - CHAPTER 2: Algorithm .................................................................................................................... - 4 - 2.1 System ........................................................................................................................ - 4 - 2.2 Key Parameters .......................................................................................................... - 5 - 2.2.1 Available Usable Power (AUP) .......................................................................... - 5 - 2.2.2 Charging Cost Representation (CCR) ................................................................ - 5 - 2.2.3 Discharging Cost Representation (DCR) ........................................................... - 6 - 2.2.4 Customer Preference Rating ............................................................................... - 6 - 2.2.5 Co-efficient of Distribution ................................................................................ - 7 - 2.3 Formulas..................................................................................................................... - 7 - 2.4 Block Diagram ......................................................................................................... - 10 - 2.4.1 Overview .......................................................................................................... - 10 - 2.4.2 Utility Feed........................................................................................................ - 11 - 2.4.3 Electric Vehicle Module ................................................................................... - 12 - 2.4.4 Solar Panel Module .......................................................................................... - 13 - 2.4.5 Battery Storage ................................................................................................. - 14 - 2.5 Flowcharts ................................................................................................................ - 15 - 2.5.1 Utility GUI Flowchart ...................................................................................... - 15 - 2.5.2 Customer GUI Flowchart ................................................................................. - 24 - CHAPTER 3: Implementation ......................................................................................................... - 27 - 3.1 Customer Profiles ..................................................................................................... - 27 - 3.1.1 Customer Profile 1 – Utility favored ................................................................ - 27 - 3.1.2 Customer Profile 2 – Cost favored ................................................................... - 28 - 3.1.3 Customer Profile 3 – Customer favored ........................................................... - 30 - 3.2 Enrollment and Incentive programs ......................................................................... - 31 - 3.3 Distributed Energy Integration ................................................................................. - 32 - VI Master Thesis 3.4 Fleet Management .................................................................................................... - 32 - CHAPTER 4: Simulation and Modelling ........................................................................................ - 33 - 4.1 Profile 1 – Utility Centric ......................................................................................... - 33 - 4.2 Profile 2 – Cost Centric ............................................................................................ - 35 - 4.3 Profile 3 – Customer Centric .................................................................................... - 36 - 4.4 Emergency Condition ............................................................................................... - 37 - 4.5 Instructions ............................................................................................................... - 38 - CHAPTER 5: Solar PV Installations ............................................................................................... - 41 - CHAPTER 6: Implementation ......................................................................................................... - 46 - 6.1 Utility GUI ............................................................................................................... - 46 - 6.2 Customer GUI .......................................................................................................... - 55 - 6.3 Customer Web App .................................................................................................. - 61 - CHAPTER 7: Future work ............................................................................................................... - 66 - CHAPTER 8: Conclusions ............................................................................................................... - 67 - References ........................................................................................................................................ - 68 - APPENDIX ...................................................................................................................................... - 69 - A. Utility Code : U – GUI_M ............................................................................................... - 70 - B. Customer GUI Code : C – GUI_M ................................................................................ - 164 - C. Customer Web App ........................................................................................................ - 181 - D. Solar Power Extraction Code ......................................................................................... - 187 - VII Master Thesis LIST OF FIGURES Figure 1: System ........................................................................................................................ - 4 - Figure 2 : Key Factors ................................................................................................................ - 8 - Figure 3 : Coefficients of Distribution ....................................................................................... - 9 - Figure 4 : System Level Block Diagram .................................................................................. - 10 - Figure 5 : Utility Input .............................................................................................................. - 11 - Figure 6 : Electric Vehicle Module .......................................................................................... - 12 - Figure 7 : Solar Panel Module ................................................................................................. - 13 - Figure 8 : Distributed Energy Storage ...................................................................................... - 14 - Figure 9 : Utility Input flowchart ............................................................................................. - 15 - Figure 10 : Available Capacity Flowchart ................................................................................ - 17 - Figure 11 : Maximum Available Capacity Flowchart .............................................................. - 18 - Figure 12 : Available Usable Power Flowchart ........................................................................ - 20 - Figure 13 : CCR, DCR Calcuations ......................................................................................... - 21 - Figure 14 : OTP Calculations ................................................................................................... - 23 - Figure 15 : Customer Gui Flowchart ....................................................................................... - 24 - Figure 16 : Emergency Condition ............................................................................................ - 26 - Figure 17 : Profile 1 – Parameter Distribution ......................................................................... - 27 - Figure 18 : Profile 1 – Coefficient Distribution ....................................................................... - 28 - Figure 19 : Profile 2 – Parameter Distribution ......................................................................... - 29 - Figure 20 : Profile 2 – Coefficient Distribution ....................................................................... - 29 - Figure 21 : Profile 3 – Parameter Distribution ......................................................................... - 30 - Figure 22 : Profile 3 – Coefficient Distribution ....................................................................... - 31 - Figure 23 : Profile 1 – Example ............................................................................................... - 33 - Figure 24 : Profile 2 - Example ................................................................................................ - 35 - Figure 25 : Profile 3 - Example ................................................................................................ - 36 - Figure 26 : Emergency Condition ............................................................................................ - 37 - Figure 27 : Google Street View ................................................................................................ - 41 - Figure 28 : NREL Application 1 .............................................................................................. - 42 - Figure 29 : NREL Application 2 .............................................................................................. - 42 - Figure 30 : NREL Application 3 .............................................................................................. - 43 - Figure 31 : Utiltiy GUI ............................................................................................................. - 46 - Figure 32 : Utiltiy GUI Step 1.................................................................................................. - 47 - Figure 33 : Utiltiy GUI Step 2.................................................................................................. - 48 - Figure 34 : Utiltiy GUI Step 3.................................................................................................. - 48 - Figure 35 : Utiltiy GUI Step 4.................................................................................................. - 49 - Figure 36 : Utiltiy GUI Step 5.1 ............................................................................................... - 49 - Figure 37 : Utiltiy GUI Step 5.2 ............................................................................................... - 50 - Figure 38 CalISO Outlook ....................................................................................................... - 50 - Figure 39 : Utiltiy GUI Step 6.................................................................................................. - 51 - Figure 40 : Utiltiy GUI Step 7.................................................................................................. - 51 - Figure 41 : Utiltiy GUI Step 8.................................................................................................. - 52 - Figure 42 : Utiltiy GUI Step 9.................................................................................................. - 52 - Figure 43 : Utiltiy GUI Step 10................................................................................................ - 53 - Figure 44 : Utiltiy GUI Step 11 ................................................................................................ - 53 - Figure 45 : Utiltiy GUI Step 12................................................................................................ - 54 - Figure 46 : Customer GUI Step 1 ............................................................................................ - 55 - Figure 47 : Customer GUI Step 2 ............................................................................................ - 56 - Figure 48 : Customer GUI Step 3 ............................................................................................ - 56 - Figure 49 : Customer GUI Step 4 ............................................................................................ - 57 - Figure 50 : Customer GUI Step 5.1 ......................................................................................... - 57 - Figure 51 : Customer GUI Step 5.2 ......................................................................................... - 58 - VIII Master Thesis Figure 52 : Customer GUI Step 5.3 ......................................................................................... - 58 - Figure 53 : Customer GUI Step 5.4 ......................................................................................... - 59 - Figure 54 : Customer GUI Step 6.1 ......................................................................................... - 59 - Figure 55 : Customer GUI Step 6.2 ......................................................................................... - 60 - Figure 56 : Customer GUI Step 6.3 ......................................................................................... - 60 - Figure 57 : Customer APP Step 1 ............................................................................................. - 61 - Figure 58 : Customer APP Step 2 ............................................................................................. - 62 - Figure 59 : Customer APP Step 3 ............................................................................................. - 62 - Figure 60 : Customer APP Step 4 ............................................................................................. - 63 - Figure 61 : Customer APP Step 5 ............................................................................................. - 63 - Figure 62 : Customer APP Step 7 ............................................................................................. - 64 - Figure 63 : Customer APP Step 8.1 .......................................................................................... - 64 - Figure 64 : Customer APP Step 8.2 .......................................................................................... - 65 - IX Master Thesis LIST OF TABLES Table 1 : Profile 1 - OTP .......................................................................................................... - 34 - Table 2 : Profile 2 - OTP .......................................................................................................... - 35 - Table 3 : Profile 3 - OTP .......................................................................................................... - 36 - Table 4 : Instructions ................................................................................................................ - 40 - Table 5 : Solar PV Installation ................................................................................................. - 43 - Table 6 : Solar PV Data ............................................................................................................ - 44 - Table 7 : Solar PV Output ........................................................................................................ - 45 - Table 8 : Output OTP File ........................................................................................................ - 54 - - 1 - Master Thesis CHAPTER 1: Introduction 1.1 Background 1.1.1 Introduction to Electric Vehicles With the increasing number of electric vehicles, the demand on the electric utilities is ever increasing. The dynamics of transportation seem to be shifting towards energy efficient and environment friendly modes of transport. The realization about importance of reducing carbon emissions and preserving the environment is bringing about a transformation in the transportation technologies. The urge to reduce the dependence on conventional fuel sources for transportation is driving the experimentation and implementation of new sources of energy to power different modes of transport. A strong contender to challenge these conventional modes is electricity. There has been a considerable growth in the attempts to use electricity as a source in the transportation industry and with time, these efforts have been showing considerably promising results as well. Today we can be certain that electricity will play an integral role in the development of future transportation systems and technologies. Today we see a growth in the electric vehicle industry, which has been improving over the years and is delivering high-end vehicles, shaking up the conventional automotive industry. The key component for all electric vehicles is the battery and energy storage. With new improvements in battery technology and different implementations of various types of cell chemistries, the battery performance and safety considerations have been improving at a stunning rate. Soon as we perfect the battery technology and energy storage systems, we would reach a state where it would be possible to enable electricity-powered transportation at all levels of the transportation system. At present there is a booming increase in the sale of personal electric vehicles and people are adopting to this change at a fast pace. Public transportation systems have been experimenting with battery powered buses and alternative methods and it is only a matter of time now when these systems start operating at the full scale. 1.1.2 Implications of Electric Vehicles Now this is the present state of the transportation system and it is indeed very promising. However, often we do not reflect on the chain reactions that such systems trigger. The transformation in the transportation system will affect multiple industries and systems. The source of electricity and the system that supports it, i.e. our power systems, would bear a considerable effect of this transformation. To drive these changes in the transportation system the power generation systems have to provide the required power additional power and gear up the infrastructure to enable it to do so. This includes providing the power from the Grid to make these systems operational. This implies increased loads on the power grid. These effects can severely ramp up when considering such increased loads during the peak hours of operation. There have been several studies considering the effects of integrating electric vehicles to the grid. There are models, which have been proposed to solve the issues that would have to be considered when dealing with the integration of electric vehicles with the grid. These changes will be incremental to begin with, but soon might have larger implications on the entire grid. The difficulty in adapting - 2 - Master Thesis to these changes from the utility perspective comes from the fact that the scale and massive size of the infrastructure that needs to be upgraded for implementing new advanced technologies and smart systems. 1.1.3 Introduction to Distributed Power Generation and Storage Today, Distributed Power Generation Systems are being extensively studied and are developing at a fast pace. As the name suggests, distributed power generation means generating the required power at the point of power consumption itself. This might be related to generating power for a small-localized area or even individual homes and setups. The advancements in technology have made this capability achievable and economically feasible in the recent past. As the technology is further perfected, the implementation of this mode of power utilization is expected to increase considerably. At present, Solar Photovoltaic cells are being used on a large scale for such setups. They are easy to install and after the installation costs there is virtually a very small investment required to continue reaping the benefits of free electricity. This makes solar PV installations a popular choice amongst customers. With the efficiencies of PV cells increasing and the cost of installations decreasing, it is estimated that individuals on a large scale will adopt solar PV installations. There is a significant drawback for solar power, which needs to be considered. This being the variability in energy received from the Sun. Over a small area, the solar power can fluctuate considerably within minutes. Cloud cover and atmospheric conditions drive these fluctuations. There is a solution to this drawback as well, which is being accepted and implemented at a slow but steady pace, distributed energy storage. Today distributed energy storage largely consists of batteries. There have been several improvements and developments in battery technology with respect to the size capability and safety associated with these installations. The batteries are getting smaller, efficient and cheaper with time and it is expected improve with the amount of resources dedicated to this task. The entire setup would soon include a solar PV installation complemented by a battery storage installation that can possibly provide energy around the clock. 1.1.4 Implications of Distributed Generation and Storage Distributed energy storage provides several advantages and helps the utility as well by reducing the total power load. Having said that it is important to consider the dynamic parameters that are induced in the system due to introduction of distributed generation. Now if we consider solar energy on a daily basis, it is easy to infer an average curve of when it would peak and when not be functional. Energy storage might be able overcome the smaller fluctuations but, they are installation dependent and might not be necessarily included. Hence, there is a lot of variability that inherently comes in along with such distributed energy options. There needs to be a clear mode of operation for this integration, which can be customizable right down to the individual level. This can be achieved through a simple link of communication between the grid and the installation. - 3 - Master Thesis 1.2 Proposed Solution One of the possible solutions to this issue, which I propose through my thesis research, tries to explore feasibility of a simplified solution that can be implemented on a large scale. At present, there is no direct link or mode of direction between utilities and the EV customers. One of the integral parts of integration of Electric Vehicle (EV) system would be to provide such a link in between the electricity providing utilities to the electricity consuming EV customers. This link of communication would prove to be an important factor when we consider the ability of the power utilities to direct the usage of energy according to their capabilities and load bearing capacity. This however needs to be seen from the customer’s point of view as well. To promote the use of EV’s and to propagate a wide spread change in the modes of transportation it is essential to consider this communication link. The EV transition would only be possible if the EV users are able to charge and use their vehicles at their own convenience. All the above needs to be implemented at the simplest form using easily available data and the existing infrastructure. By modeling, the strategies based upon certain critical parameters and generating a unified multiplatform solution, this technique can be implemented on a large scale in quick time. The core idea is to reach a midpoint in between the capabilities of the utility to provide the power and the ease of use and convenience of the EV customers to ensure sustained growth in the adoption of electric vehicles on a large scale. Distributed generation and storage of energy can also be integrated on similar lines to meet the needs of EV customers. The algorithm is based upon simplistic parameters and can be implemented in a modular manner such that multiple systems can be incorporated and they can function coherently. At a household level, solar power can be used to meet the needs during the peak loads and a battery system would be able to store this generated energy and utilize it when the grid instructs it to. Automating the entire setup gives a coherent and efficient solution utilizing the available resources. The modularity of the system is a big advantage when trying to implement it for various setups and thus has an inherent requirement of being multiplatform. At the same time there needs to be a provision for different customers and users to select the pattern or the modulation method implemented by the utility. Through the modes of customer profiles and records these pattern can be implemented on a large scale using the same skeleton structure for the entire system. 1.3 Applications The applications of the proposed system would be spread out over a wide range of installations. From the simplest form of being implemented at the individual household level just for personal EVs, to managing fleets of EVs used for mass transportation coupled with distributed generation, the system would be a quick and easy solution. It is important for the utilities to promote the use of EVs with the help of granting incentives based upon their habits of charging and using the Grid power. The cost of electricity is can prove to be a key factor to drive EV users towards following a certain desired pattern for their charging cycles. The utility can implement this in a very effective way by reducing the costs of electricity and encouraging customers to use electricity at lower cost during certain specific periods in the day. - 4 - Master Thesis CHAPTER 2: Algorithm 2.1 System The system by itself is a modular system and for every scenario may or may not consist of all the modules involved in the setup Microcontroller Home Automation Circuit Household Appliances and Devices Smart Switching Circuit Utility Database Figure 1: System Figure 1 shows the proposed system which can be integrated with a home automation setup. The utility data will be accessed by the controller from the server. The SOC of the car battery and the energy storage battery will be fed into the controller through sensors and the solar PV panel output would be detected by the controller. All these values and variables will be used to calculate the necessary outputs for each module. These modules will be controlled by a set of smart switches and will be directed by the utility data that is accessed by the controller. This would be a real time automated system. - 5 - Master Thesis 2.2 Key Parameters To simplify the algorithm without compromising on the efficiency, the identification of key parameters was essential. These key parameters were based upon a study of different charging algorithms and strategies. There are certain functions of the system that stand out when we are considering different charging strategies. These are the core components and can provide an efficient model of the system. They form the basis of all calculations. Since these parameters have different dimensions and cannot be compared directly, I normalize them and then use the quantities as a function of the parameters. To normalize the values, I consider the values of 24 hours. Then these factors are normalized to scale of 0 to 10 based upon the dataset for the 24 hours in consideration. 2.2.1 Available Usable Power (AUP) Available usable power is a representation of the actual power that the Grid can supply at any given time for charging purposes. This is a function of the actual capacity production and the current load on the Grid. To normalize the quantity to a function of the total available capacity for a period of 24 hours, we can calculate the maximum capacity for the given dataset. This maximum capacity is then considered as reference and the instantaneous or predicted capacity for that hour (depending upon the data available) is normalized to a scale of 0 to 10/100. Now another key parameter is the usable power factor (UPF). This parameter is a representation of the buffer of safety margin that the utility reserves as unusable power. This ‘UPF’ represents the percentage of available power that the utility can supply for charging. These parameters favor the utility side of the algorithm. This depends upon the utilities capacity and is an accurate representation of the total power available for charging at any given time. The utility can dispatch the desired amount of power for charging and control the ‘UPF’ and coefficient for this purpose. 2.2.2 Charging Cost Representation (CCR) The cost of charging is the cost that the customers would have to incur if they were to charge their EVs at a particular given time. At present, this can be related to the general cost of electricity for a given period. With the sophistication of the system these costs and values would represent accurate costs and rates specific for charging purposes - 6 - Master Thesis This parameter has larger implications for large fleets of EVs. These fleets can reduce their costs largely by charging at times when the cost of electricity is low. Typically, during the day the cost of electricity shoots up during the peak power consumption period. At times due to low capacity during such peaks, utilities have to trade power from neighboring utilities at a much higher rate. This cost is then distributed over the consumers using high amounts of electricity during the peak hours. Tracking the ‘CCR’ and charging EVs accordingly customers and particularly large fleets of EVs can reap the benefits of charging at a lower cost of electricity. 2.2.3 Discharging Cost Representation (DCR) The cost of discharging can prove to be a huge incentive for EV users. The cost of discharging is the cost that EV users are paid when they supply power back to the grid during the peak load periods. A charged EV is equivalent to battery source used to store energy. If one does not require using one’s charged vehicle for travelling, one can supply energy to the grid for a certain amount of time and gain benefits out of it. The vehicle can then be charged at a later point of time when the cost of electricity is lower and the user needs the vehicle to commute. Thus, the owners would gain a net profit by simply discharging the vehicle to the grid during peak load hours. This would be able to help the utility to reduce the peak load on the grid. V2G or vehicle to grid charging needs the infrastructure to be put in place for operation. This interface is presently not available as it is presently used only on an experimental basis and requires detailed protocol for discharging to the grid. Since the algorithm is meant to scale up and propose a solution as and when the grid is ready to implement it, the discharging of EVs is related by a function of the cost that the users would be paid for supplying power to the grid. Fleet owners can plan such discharging and charging cycles and gain a considerable net profit during peak load periods. 2.2.4 Customer Preference Rating Customer preference rating is a representation of each customers charging preferences. These would be typically based upon the daily schedule of the customers. This depends upon the convenience of the users to charge their vehicles, as they need it. - 7 - Master Thesis This parameter is independent of the cost of electricity or the state of the grid. This parameter may vary considerably for each individual user and might not follow a specified pattern. The idea of using this as a key parameter for deciding is the fact that customers need to feel comfortable with the charging cycles required for their vehicles. To promote the use of electric vehicles it is essential that the users be given the freedom and the facility to charge their vehicles as per their convenience. It is essential that the interface between the customer and the utility is bi- directional and favors both in different configurations. 2.2.5 Co-efficient of Distribution The co-efficient of distribution is the co-efficient associated with each parameter mentioned above. For calculations, only three coefficients are considered i.e. coefficient of AUP, coefficient of CCR, coefficient of CPR. Due to the ambiguity in the methods of V2G, the coefficient of DCR is not used and is calculated separately. These coefficients act as weights for the normalized values. They can be used by the utility to make the decisions purpose/attribute centric. The coefficients of distribution are entered by the utility for all iterations. The summation of the coefficients always adds up to unity. The coefficients can be used to make any factor dominate over the rest. This is particularly useful to create different profiles and give the users a variety to choose the charging patterns and related subscriptions. 2.3 Formulas Available usable power (AUP): Customer preference rating (CPR): Charging cost representation (CCR): Discharging Cost Representation (DCR): Mcd Pc Ac Upf A AUP 10 ) 1 ( 10 3 1 MaxCc G B CCR 10 4 MaxDc G DCR 10 max G Gc C CPR - 8 - Master Thesis Condition: (A+B+C) < or = 10 Scaling factor = 10 Optimum Time Period (OTP): As all quantities are normalized, the range would be from -10 to 10. This range can be changed by modifying the scaling factor in each formula. The following is a representation of all the parameters involved in the calculations Figure 2 : Key Factors The figure 2 depicts the dependence of the OTP on the constituent factors. The OTP at any given time will not exceed the value 10. This is ensured by weighing the coefficients appropriately. DCR is inversely proportional to OTP. 0 2 4 6 8 10 00 to 06 06 to 10 10 to 16 16 to 21 21 to 24 Aup Cpr Ccr OTP Dcr 10 Ccr Cpr Aup OTP - 9 - Master Thesis Figure 3 : Coefficients of Distribution Figure 3 shows the composition of the OTP. Four cases considered for the same time interval of 10-16 hours from the previous graph. It can be observed that for different coefficients, the OTP in the same time interval changes its value as well as percentage composition This allows the utility to control the OTP parameters according to the utility capacity and strategy. It can be easily manipulated to be utility centric, consumer centric or even cost centric. 0 1 2 3 4 5 6 7 8 A=7,B=2,C=1 A=5,B=3,C=2 A=2,B=6,C=4 A=3,B=5,C=2 Ccr Cpr Aup - 10 - Master Thesis 2.4 Block Diagram 2.4.1 Overview Household Appliances Automated Smart Interconnect Solar Panel Module Battery Utility Feed EV Display Figure 4 : System Level Block Diagram Figure 4 is a block diagram of all the modules that constitute the entire system. Each module of this system can be implemented either individually or as a combination. The customers can select the modules to be added to their subscription based upon the available installations and selected profiles. The utility has to manage a single output file that contains all the information for different profiles. The customer interface uses selected information extracted from the while pertaining to the installation. All the modules feed in the information to a centralized controller or microprocessor and the central controller computes and defines the operation for each module. There is constant feedback from all modules and thus the controller manages all the operating states and responds to faults accurately. The feed from the utility can be fetched from an online server where the utility updates these files. The base model for the system will consist of three core components: Utility feed, Automated smart interconnect and Electric Vehicles. All other modules would be considered as add-ons to the base system. - 11 - Master Thesis 2.4.2 Utility Feed Input Data from Utility Database Sort Data Files Input Utility Preferences & Input co- efficients Fetch Instantaneous Values for all parameters Calculate AUP,CPR, CCR, DCR Export Excel File Calculate OTP Utility Feed Figure 5 : Utility Input The utility feed contains real time data from the grid and instructions which the utility can direct depending upon the state of the grid. The prediction of data can be based up historic and current data. The utility can use predicted data values to reserve charging times for fleets of EVs and other such setups. The daily load curves can be studied and predictive functions can be optimized. To calculate instantaneous or predicted charging/discharging functions, the formulas remain the same and the key factors can be varied to favor a desired output. - 12 - Master Thesis 2.4.3 Electric Vehicle Module Fetch Weekly User Data Select User User Database Extract average Weekday & Weekend data Check the Battery SOC Fetch the Utility Feed Data Compute available energy for EV Charging Drive Output / Store in Excel doc Electric Vehicles Figure 6 : Electric Vehicle Module The Electric vehicle module is supposed to be a combination of the car’s mileage, battery SOC and user preference. The number of miles travelled at an average would help in taking decisions about battery charging as we can predict the charging cycles. The battery SOC would give the exact state of the battery irrespective of the miles travelled. The expected miles to be travelled can then be used to calculate the urgency of charging the EV. The customer preference would be the convenience of the customer to charge one’s car. This parameter might be unique for different cars and should be fed in manually into the system. All these parameters would be considered as shown above before instructing a customer or an automated setup. The ultimate decision would depend upon the battery SOC as well if the car needs to be charged urgently. - 13 - Master Thesis 2.4.4 Solar Panel Module Fetch Solar PV data from NREL Input the Season to fetch data from NREL Database Input the Location and PV panel Installation Size Input The day to fetch the data for Compute available solar power and household requirements Drive Output / Store in Excel doc Solar Panel Module Figure 7 : Solar Panel Module Solar panels in this model represent distributed sources of energy. When we consider a household setup, solar panels seem to be the popular choice for distributed energy generation. These sources are usually weather dependent and hence fluctuate to a considerable extent. Cloud cover can also affect solar power and the total available solar power would also vary during different seasons. The data used for the simulations is historical data, however in an actual implementation a live feed of data would be used. As the data used for simulations is from the NREL website for a given location across a year, the data is a good accurate method to estimate the likely effects of integrating solar power generation into the setup. In practice the historical data would be helpful for predictive analysis. - 14 - Master Thesis 2.4.5 Battery Storage Fetch real-time User Data Select User Fetch the Utility Feed Data Compute Required energy for system Drive Output / Store in Excel doc Fetch the Solar Panel Module Data Fetch the EV Stats Distributed Storage Figure 8 : Distributed Energy Storage Battery storage is being accepted at a fast pace and energy storage for distributed generation is favored. This helps eliminate the variability in the nature of distributed generation. For battery storage the SOC of the battery is important and the predicted utility feed is extremely important. The urgency of charging can be determined by these quantities. A strong contender in the battery storage technology is the Tesla Power-wall. The data was used to model some of the Matlab models to help with the integration of energy storage modules. These modules would ideally dispatch the energy when the grid is under peak load and the SOC of the battery is considerably high. - 15 - Master Thesis 2.5 Flowcharts 2.5.1 Utility GUI Flowchart Start Enter Profile Select Subfolder for the entered Profile Enter Season Select Subfolder for the entered season Enter Day of the Week Select Subfolder for the entered Day Fetch the data file for selected conditions 2 Figure 9 : Utility Input flowchart - 16 - Master Thesis Part 1: The above flowchart represents initializing the program for the utility setup. First the profile for which the data is to be configured for needs to be selected by the user. The data from that particular folder in the file structure will be accessed. Then the user needs to enter the season for which the data is to be entered for. The data from that particular season folder under the profile folder is accessed. Then the user needs to enter the day of the week to be selected. The data file for that particular day is to be fetched. The elements from the data file have to be arranged in arrays in the workspace or database and the appropriate indexing is required. This database is the then to be used for all other calculations and analysis. Part 2: The flowchart below represents the acquisition of data for calculating the maximum available capacity to charge. We increment the variable 'i' based on the number of times we want to the information to be updated. E.g. for hourly - i = 24. X and Y represent the total available capacity and predicted load respectively. We attain the required values from the database and then find the available capacity for each time period and store the data again (z). Depending upon the time period after the variable 'i' exceeds the maximum value the loop exits and we move on to the next step. - 17 - Master Thesis 2 i=0 i<=24 3 X,Y Z=X-Y Z i=i+1 Database Figure 10 : Available Capacity Flowchart - 18 - Master Thesis 3 J=0 Largest = z[0] J=24? Z[j] > Largest J=j+1 Largest = z[j] 4 Y N Y N Figure 11 : Maximum Available Capacity Flowchart - 19 - Master Thesis Part 3: The above flowchart represents the steps to attain the maximum available capacity of the Grid. This value will later be used to normalize the quantity. The value of 'j' will depend upon the number of values calculated in the previous step. e.g. hourly - 'j' = 24 A new variable ‘largest’ is created and is given the value of the first element of the array. This variable is then compared to each value of the array. If a value of a given index in the array is greater than the value of the variable ‘largest’ then the value of the variable is replaced with the value stored at the given index in the array. Once all the required iterations are completed the loop is exited and we move onto the next step. Part 4: In the flowchart given below we will find out the Available Usable Power or AUP. The value of the variable Maximum capacity difference 'Mcd' is made equal to the value of 'largest' after step 3. The quantities Coefficient of availability 'A', Actual capacity 'Ac', Actual load 'Pc' and Usable power fraction 'Upf' are to be entered. These coefficients give the different weights to the quantities. Upf is a representation of the safety band of energy that the utility desires to reserve for unseen events and fluctuations in load. These values are then used to calculate the Available usable power 'Aup'. AUP is stored in the database as an array. The resolution depends upon the time period for which the parameters are defined. - 20 - Master Thesis 4 MCD=Largest A, Ac, Pc, Upf AUP Database 5 Figure 12 : Available Usable Power Flowchart Mcd Pc Upf Ac A AUP 10 ) 1 ( - 21 - Master Thesis 5 B, C, G2, G3, G4, MaxCc, MaxDc Cpr=B X G2 Cpr Ccr, Dcr MaxDC G 10 4 DCR 6 Database 10 3 1 MaxCc G C CCR Figure 13 : CCR, DCR Calcuations - 22 - Master Thesis Part 5: From the above flowchart the following quantities are attained: Coefficient of Customer preference - B Coefficient of Charging preference - C Coefficient of Discharging preference - D Actual Customer preference - G2 Actual charging cost - G3 Actual Discharging cost - G4 Maximum charging cost - MaxCc Maximum discharging cost - MaxDc These values are then used to calculate the following quantities: Customer preference rating - Cpr Charging cost representation - Ccr Discharging cost representation - Dcr Part 6: The flowchart below is used to calculate the Optimum Time Period We attain the following values from the database: Available usable power - Aup Customer preference rating - Cpr Charging cost representation - Ccr Discharging cost representation - Dcr Then we calculate the OTP using the given formula. As the charging and discharging quantities are complementary the signs are reversed. - 23 - Master Thesis 6 Aup, Cpr, Ccr, Dcr OTP Export Datasheets 7 Database 10 Ccr Cpr Aup OTP Figure 14 : OTP Calculations - 24 - Master Thesis 2.5.2 Customer GUI Flowchart 7 OTP If OTP > 6 Send Charge Command If OTP > 3 Send Hold Command Send Do Not Charge Command If DCR > 5 Send Discharge Command Send Do Not Discharge Command 8 Y Y Y Figure 15 : Customer Gui Flowchart - 25 - Master Thesis Part 7: The above flowchart is related to the display of results. The nomenclature is: Highly favored time for charging - Charge Moderately favored time for charging - Hold Least favored time for charging - Do Not Charge Most favored discharging time - Discharge Least favored discharging time - Do Not Discharge The OTP is used for calculating the charging period. The DCR is used to calculate the discharging period. The entire program can be made operate at desired timings and the steps would be run iteratively. Part 8: The flowchart given below is the system fault check condition. If a fault, error or malfunction occurs at the utility then the utility can issue an emergency signal. This signal will overwrite the data in the datasheets and the emergency signal will be displayed. Forced shut down will take place and all charging and discharging facilities will be temporarily shut down. Once faults are cleared and the system is up and running then the entire system will get refreshed and the appropriate values will be loaded in the datasheet. Once reset the charging/discharging systems will function as expected. - 26 - Master Thesis 8 Fault Export Datasheet Send Emergency Code Force Shutdown Refresh Stop Y N Figure 16 : Emergency Condition - 27 - Master Thesis CHAPTER 3: Implementation The model I propose for this study includes creating a subscription based portfolio for the customers. This would make it easier for the utilities to manage and handle the power distribution allotted for EV charging. The utilities can make changes to the coefficients that each utility enters in the GUI to modulate the output to favor different key factors in the final OTP files that are transmitted to the customers. The customers can select the predefined profiles that they would like to subscribe for and the customer GUI would access the data accordingly. For simplicity purposes I have considered three broad customer profiles for the simulations and modelling. 3.1 Customer Profiles 3.1.1 Customer Profile 1 – Utility favored The utility favored profile would benefit the utility more than the customers. In this profile the utility would almost entirely direct the usage of power for charging depending upon their peak loads and available charging capacity. The coefficients of charging for this profile would be favoring ‘A’ the available capacity charging coefficient. The value for A would be between 7 to 10. The remaining coefficients can take any value in between 3 to 0. The utility can promote this profile by providing incentives and reduced rates for customers who select this profile. Figure 17 : Profile 1 – Parameter Distribution -2 0 2 4 6 8 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Aup Cpr Ccr OTP - 28 - Master Thesis Figure 17 shows the variation in OTP for a given set of coefficients for profile 1. A = 8; B = 1; C = 1 Figure 18 : Profile 1 – Coefficient Distribution Figure 18 shows a few combinations for the distribution of the coefficients that the utility would enter for profile 1. These coefficients would modulate the OTP as shown in figure 17. The time period between changing these coefficients for each profile can be set by the utility as per their choice. 3.1.2 Customer Profile 2 – Cost favored The cost favored profile would direct the outcome towards a cost based approach. In this profile the outcome of the algorithm would direct the customers to charge their vehicles at time which corresponds to the lowest cost power for charging. This cost of charging the vehicles might change from utility to utility, but the baseline metric or cost curve for them would be more or less the same. As the cost of electricity is really a function of the available capacity for most utilities, one can expect the outcome to be similar to the customer profile 1. This particular model however helps both, the utility by favoring charging during a time period when the load on the grid is comparatively less and the customers as they can charge their vehicles at a lower cost. The coefficients of charging would for this profile would be favoring ‘B’ the available capacity charging coefficient. The value for B would be between 7 to 10. The remaining coefficients can take any value in between 3 to 0. Figure 19 shows the variation in OTP for a given set of coefficients for profile 2. A = 1; B = 8; C = 1 0 1 2 3 4 5 6 7 8 9 10 Combination 1 Combination 2 Combination 3 Combination 4 Ccr Cpr Aup - 29 - Master Thesis Figure 19 : Profile 2 – Parameter Distribution Figure 20 : Profile 2 – Coefficient Distribution Figure 18 shows a few combinations for the distribution of the coefficients that the utility would enter for profile 2. These coefficients would modulate the OTP as shown in figure 19. Since the cost of electricity does not vary rapidly or frequently, the charging and discharging curves for profile 2 would be stable as compared to other profiles. 0 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Aup Cpr Ccr OTP 0 2 4 6 8 10 Combination 1 Combination 2 Combination 3 Combination 4 Ccr Cpr Aup - 30 - Master Thesis 3.1.3 Customer Profile 3 – Customer favored The customer favored profile would benefit the customers by providing them the convenience of charging their cars almost entirely based on their preference. In this profile the utility would direct the usage of power based upon the customers driving schedule and charging preferences. This profile would also favor the SOC of the EV battery. This charging profile might eventually prove to be expensive for the customers. If the customer intends to charge their vehicles during the peak hours of operation, then the cost of electricity might prove to be higher for such a profile. The coefficients of charging would for this profile would be favoring ‘C’ the available capacity charging coefficient. The value for C would be between 7 to 10. The remaining coefficients can take any value in between 3 to 0. Figure 21 : Profile 3 – Parameter Distribution Figure 21 shows the variation in OTP for a given set of coefficients for profile 3. A = 1; B = 0; C = 9 Figure 22 shows a few combinations for the distribution of the coefficients that the utility would enter for profile 3. These coefficients would modulate the OTP as shown in figure 21. The charging curves for users of these profiles would be unique and would cater to specific needs and habits of the EV customers. The effective cost of charging might be higher but that might be a result of a small penalty imposed by the utility in terms of lower incentives or higher prices. 0 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Aup Cpr Ccr OTP - 31 - Master Thesis Figure 22 : Profile 3 – Coefficient Distribution 3.2 Enrollment and Incentive programs The idea behind creating an interface between the utilities and the EV customers is to make it easier for the utilities to modulate the energy that is dedicated for charging electric vehicles. To increase the customer participation in such a program it is essential for the utilities to encourage customers to follow such programs by giving incentives. The above mentioned profiles would be helpful for the utilities to maintain a record and monitor the charging preferences of their customers. An effective method to direct the customers to opt for certain customer profiles is by providing incentives for profiles like the profile1 and profile 2. These two profiles would particularly be favored by utilities as it helps utilities to manage their resources and allocate the power when it is convenient and suitable for them. The incentive programs can have various time period options, some ranging from 3-6 months to some ranging to an annual subscription. This would give the customers an option to try and test a few different customer profiles before they choose a particular profile. There can be different programs for residential customers and for commercial customers as well. Fleet owners can benefit to large extents in such a setup. The implications of profiles for individual and fleet owners would be considerably different. Separating the profiles would enable the utility to better characterize the outputs for all kinds of setups appropriately hence leading to a more efficient system. As such a subscription based service does not exist on a large scale in utilities and the effects that such a system might induce would need to be studied. 0 1 2 3 4 5 6 7 8 9 10 Combination 1 Combination 2 Combination 3 Combination 4 Ccr Cpr Aup - 32 - Master Thesis 3.3 Distributed Energy Integration The integration for distributed sources of energy can be based upon the similar subscription options. Based upon the total installations for a particular customer the profile can have additional incentives for solar power installations and other energy storage options. This is something that the utilities would promote on a large scale to reduce the load on the grid. The system can be modelled to integrate any kind of distributed energy installation and the customers would just have to enter the total installation details and a few other parameters and then the distributed controllers can make decisions based off the same files which are made available from the utility to the customers. The database of the customer’s location information and total installations can help the utilities to generate better prediction models and modulate the generation and usage of power accordingly. As the grid power is dispatched at a fixed interval, these predictions can be approximated and used as a guideline for allocating the resources. 3.4 Fleet Management Fleet management might not seem to be a pressing issue at the moment, but with the increase in the use of EVs for public transport it might soon prove to be an issue during peak load period for utilities. With the improvement in battery technology EVs would soon be used on a large scale for such purposes. Such public transportation fleets are presently being experimented by OLEV in Korea. Fleet management can highly benefit from such models. Large fleets of EVs would be usually related to corporate organizations and public transportation systems. These mass transit systems usually have a well-defined power usage pattern based upon their operation. For such a system it is essentially important to reduce the cost of charging and the load on the grid as multiple EVs are in operation. If a utility can direct the charging periods for such fleets it helps them to allocate their resources appropriately. This in turn helps the fleet owners as utilities can provide lower costs for such setups. Potentially these fleets of EVs can also be used as a large source of stored energy. V2G is presently used on an experimental basis, but when the technology is perfected, the use of such fleets for sourcing power to the grid would drastically change. - 33 - Master Thesis CHAPTER 4: Simulation and Modelling The simulations and modelling is based upon static/historical data. In actual implementation the data will be from a live feed. To simulate the live feed a random data generator has been included in the system. This ensures a new data set for each iteration and helps to verify the functionalities of the algorithm. The following are the results for different conditions for different profiles. 4.1 Profile 1 – Utility Centric Figure 23 : Profile 1 – Example Figure 23 shows an example for the output settings of a profile 1 user. The coefficients represent the weights given to each parameter. - 34 - Master Thesis The following table shows the OTP results for a given set of conditions for profile 1 Time OTP DCR Cost 1 7.243656 1.454545 9 2 6.790232 1.454545 9 3 4.578394 1.454545 9 4 7.740142 1.454545 9 5 6.229297 1.454545 9 6 9.008733 1.454545 9 7 3.175318 7.272727 31 8 9.340426 7.272727 31 9 7.933808 7.272727 31 10 8.110297 7.272727 31 11 7.817826 7.272727 31 12 3.776967 5.454545 25 13 5.66303 5.454545 25 14 8.978724 5.454545 25 15 1.773947 7.272727 31 16 8.177591 7.272727 31 17 3.221149 10 47 18 2.401513 10 47 19 0.197906 10 47 20 0.027549 10 47 21 7.302787 7.272727 31 22 6.03252 1.454545 9 23 5.13823 1.454545 9 24 7.429733 1.454545 9 Table 1 : Profile 1 - OTP - 35 - Master Thesis 4.2 Profile 2 – Cost Centric Figure 24 : Profile 2 - Example Figure 24 shows an example for the output settings of a profile 2 user. The following table shows the OTP results for a given set of conditions for profile 2 Time OTP DCR Cost Time OTP DCR Cost 1 8.252838 1.454545 9 13 4.898241 5.454545 25 2 8.197544 1.454545 9 14 4.342678 5.454545 25 3 7.927815 1.454545 9 15 3.37829 7.272727 31 4 8.313383 1.454545 9 16 3.879249 7.272727 31 5 8.129139 1.454545 9 17 0.81286 10 47 6 8.168085 1.454545 9 18 0.312907 10 47 7 3.369113 7.272727 31 19 -0.15582 10 47 8 3.601007 7.272727 31 20 0.10336 10 47 9 3.329472 7.272727 31 21 3.87245 7.272727 31 10 3.870924 7.272727 31 22 7.705142 1.454545 9 11 4.135258 7.272727 31 23 7.896085 1.454545 9 12 5.048192 5.454545 25 24 8.275529 1.454545 9 Table 2 : Profile 2 - OTP - 36 - Master Thesis 4.3 Profile 3 – Customer Centric Figure 25 : Profile 3 - Example Time OTP DCR Cost Time OTP DCR Cost 1 9.593263 1.454545 9 13 7.221645 5.454545 25 2 9.537969 1.454545 9 14 3.866082 5.454545 25 3 9.26824 1.454545 9 15 7.295312 7.272727 31 4 9.653809 1.454545 9 16 7.79627 7.272727 31 5 9.469564 1.454545 9 17 5.71286 10 47 6 7.408511 1.454545 9 18 2.412907 10 47 7 3.086135 7.272727 31 19 0.544182 10 47 8 2.618028 7.272727 31 20 0.80336 10 47 9 1.646494 7.272727 31 21 3.309518 7.272727 31 10 2.887945 7.272727 31 22 6.245568 1.454545 9 11 5.252279 7.272727 31 23 8.536511 1.454545 9 12 8.071596 5.454545 25 24 9.615955 1.454545 9 Table 3 : Profile 3 - OTP - 37 - Master Thesis 4.4 Emergency Condition The following condition represents an emergency condition issued by the utility. In this state all applications will be non-operational until the fault at the utility end is cleared out. For a setup like the one shown in figure 26, the smart circuit would entirely switch over to the energy storage option. Hence, it displays the instruction “Use Powerwall”. In a scenario in which the customer does not have an energy storage option, the system will be non-operational until the setup is restored by the utility Figure 26 : Emergency Condition - 38 - Master Thesis 4.5 Instructions Instruction Implication Charge: In this condition, the EV will start charging. The conditions are favorable for the grid as the grid has excess energy, which can be supplied to charge vehicles. Hold: The conditions are not entirely favorable for charging. Hence charging should be done if the SOC of the battery is low and the user would not be able to wait until a more favorable time. In an automated setup, this can be estimated by the daily user preference and the SOC. Do not charge: The conditions are not favorable for charging. Do not charge as the utility is experiencing peak loading conditions or the cost electricity is maximum. - 39 - Master Thesis Charge Energy Storage: The energy storage setup can be charged. This condition occurs when the utility has excess power produced. This also corresponds to the OTP rating. Discharge energy storage: The energy storage needs to be used for other operations as the utility is experiencing peak loads Solar Power Available: This image represents that solar PV cells are functional and are receiving adequate amount of sunlight. The total available power might not necessarily satisfy all the needs of an installation but it implies that some amount of solar power is available. No/Inadequate Solar Power Available: This represents that the solar PV cells are not receiving adequate amount of sunlight and cannot generate the desired amount of power - 40 - Master Thesis Grid Power required: This image depicts that the solar power generated is inadequate or not present. Hence the power to be supplied for the installation requires to be provided by the grid. Emergency Stop: This symbol denotes an emergency stop condition issued by the utility. This condition will stop all operations until the utility clears the fault signal. Once the fault is cleared, the utility refreshes the app and the emergency condition is released. Table 4 : Instructions - 41 - Master Thesis CHAPTER 5: Solar PV Installations The interface in between the utilities and the customers with solar PV panels might differ for different setups. Hence, for simulation purposes the present GUI only displays if the solar power available at a particular instant is sufficient for supplying power to the entire household. The integration with the algorithm was ambiguous and more research pertaining to the distributed generation schemes and policies is required for integrating it with the algorithm. At present the GUI portrays an accurate representation of the solar power available as per historical data. For the GUI, I have used the hourly solar power data provided by the NREL website. Consider an average US house for demonstrative purposes. Calculate the power generated using the irradiance of the Sun, the installed capacity and the weather prediction. Import these parameters in the form of an excel sheet through Matlab and then process it. I used the following house to model the solar panel installation for practical purposes. House selected: 3100 Orchard Ave, (USC area), Los Angeles. Figure 27 : Google Street View The figure 27 to 29 show the application on the NREL website that can be used to calculate the hourly data for any given location and installation. - 42 - Master Thesis Figure 28 : NREL Application 1 Figure 29 : NREL Application 2 - 43 - Master Thesis Figure 30 : NREL Application 3 The following data can be acquired from the NREL website. The parameters can be modified further for accurate data. The values used for the following table are based upon nominal expected conditions. PV Watts: Hourly PV Performance Data Requested Location: 90007 Location: LOS ANGELES, CA Lat (deg N): 33.93 Long (deg W): 118.4 Elev (m): 32 DC System Size (kW): 22.9 Module Type: Standard Array Type: Fixed (open rack) Array Tilt (deg): 20 Array Azimuth (deg): 180 System Losses: 14.08 Inverter Efficiency: 96 DC to AC Size Ratio: 1.1 Average Cost of Electricity Purchased from Utility ($/kWh): 0.13 Initial Cost 3.3 Cost of Electricity Generated by System ($/kWh): 0.17 Table 5 : Solar PV Installation - 44 - Master Thesis Some of the terms mentioned in the Table above can be explained as follows: Beam Irradiance (W/m^2): Direct solar irradiance (also referred to as direct normal irradiance) is a measure of the rate of solar energy arriving at the Earth's surface from the Sun's direct beam, on a plane perpendicular to the beam, and is usually measured by a pyrheliometer mounted on a solar tracker. Diffuse Irradiance (W/m^2): It is the amount of radiation received per unit area by a surface that does not arrive on a direct path from the sun, but has been scattered by molecules and particles in the atmosphere. Basically, it is the illumination that comes from clouds and the blue sky. Plane of Array Irradiance (W/m^2): Solar irradiance as observed from the plane of the installed array of PV panels DC Array Output (W): The generated DC output power from the solar PV cells. AC System Output (W): The generated DC output power converted into AC output power. The inverter power losses need to be included in the calculation. After the above data is entered, the data is exported as an excel file. This excel file can be accessed to retrieve the hourly data for any given day. Since the data is related to solar energy which is an inherently fluctuating source that depends upon the weather, the conditions might differ in actual operation. Using the historical data is method to verify the system and shall be replaced by a live feed during operation. The table depicts the data exported from the NREL website. Table 6 : Solar PV Data This data contains fields which are not essential for the calculations and the critical data needs to be extracted for modelling purposes. Hence, by using a Matlab code, the following data is extracted according to the seasons and the output files are stored as per the days of the week to obtain a random dataset for a week for each season. This method gives an approximate simulation of the random data with a representation of different seasons. - 45 - Master Thesis Table 7 : Solar PV Output These extracted data files are then exported from Matlab and stored into a file structure that represents the different seasons and days of the week. Hence, when the Matlab GUI is used, the data is retrieved from the file structure accordingly and is used for further processing. - 46 - Master Thesis CHAPTER 6: Implementation The model I propose for this study includes creating a subscription based portfolio for the customers. This would make it easier for the utilities to manage and handle the power distribution allotted for EV charging. The utilities can make changes to the coefficients that each utility enters in the GUI to modulate the output to favor different key factors in the final OTP files that are transmitted to the customers. The customers can select the predefined profiles that they would like to subscribe for and the customer GUI would access the data accordingly. For simplicity purposes I have considered three broad customer profiles for the simulations and modelling. 6.1 Utility GUI Figure 31 : Utiltiy GUI The above shown in Figure 31, depicts the Utility Graphic User Interface (U-GUI). The U-GUI allows the utility to access historic and predicted data which can then be analyzed. This can then be used as a reference to define the charging patterns for different conditions and profiles. The utility can use this GUI to create the output files which can be exported in any file format. These files would be stored on the online server and would be made available to customers who subscribe for the service. Irrespective of the platform used by the customer, the data in the files will follow the same format. However, the files might be stored in different file formats like .xls, .csv, .html etc. - 47 - Master Thesis The following is a step-by-step procedure for utilizing the U-GUI. Step 1: Run the U-GUI using Matlab. Figure 32 : Utiltiy GUI Step 1 All the fields will be blank and the windows will show default settings. Step 2: Select the profile that needs to be configured. The three profiles listed as – Profile 1 – Utility Centric Profile 2 – Cost Centric Profile 3 – Customer Centric The U-GUI will create different output files for different profiles and the customers will access these files according to their subscriptions. Select the profile from the drop down menu as shown in figure. - 48 - Master Thesis Figure 33 : Utiltiy GUI Step 2 For demonstration, I selected the utility centric option. Step 3: To view the previously recorded/ predicted data, first select the season for which you want to configure the output. Since this is a static system with no active live feed from the utility, these additional files have been stored accordingly and are being accessed through the GUI. In a full-fledged system the utility would have access to a direct feed from servers with historic and predicted data. Figure 34 : Utiltiy GUI Step 3 - 49 - Master Thesis Step 4: Select the day of the week for which the data needs to be accessed. Figure 35 : Utiltiy GUI Step 4 Step 5: Now to select different predicted generation and predicted load click on the push buttons denoting predicted generation and predicted load to get the data represented in the form of graphs. Figure 36 : Utiltiy GUI Step 5.1 - 50 - Master Thesis For viewing predicted load, click on the push button. Figure 37 : Utiltiy GUI Step 5.2 Now it is important to note that for simulation purposes the data used here is historic data. When the system is actually deployed the data would be updated through a live feed from the server. The data is expected to be similar to the ‘outlook page’ on the Cal-ISO webpage. Figure 38 CalISO Outlook - 51 - Master Thesis Step 6 Random data generator: The random data generator will generate any random value between 0 and 5000 MW and then adds that value to the data as shown in the figure below. Figure 39 : Utiltiy GUI Step 6 This is included to test that the algorithm works for all possible conditions. As the data set used in the simulation is a static data set, the random generator ensures that the input data set will create different values for all iterations. Step 7 Available capacity push button gives the difference in between the actual production and the randomized load data file. Figure 40 : Utiltiy GUI Step 7 This is a good representation for the utilities to refer to when defining customer profiles. - 52 - Master Thesis Step 8 Now you need to enter the co- efficient of distribution for weighing the different parameters. Figure 41 : Utiltiy GUI Step 8 Step 9: The usage coefficient is the amount of power that can be dedicated for charging purposes. The utility needs to maintain a comfortable buffer to account for any power surges or sudden disturbances on the power grid. The value is expected to be between 0.1 to 0.4 for this parameter depending upon the total system capacity. For different values of coefficient, the charging times can be calculated. The coefficients can be changed multiple times before the values are exported to the customers. Figure 42 : Utiltiy GUI Step 9 - 53 - Master Thesis Step 10: Press the charging push button to display the optimum time for charging. Figure 43 : Utiltiy GUI Step 10 Step 11: Similarly, the discharging time can be represented by selecting the discharging push button. Figure 44 : Utiltiy GUI Step 11 - 54 - Master Thesis Step11: The data can be exported any desired file format using the export button. In the present program the data is then sent out in excel and CSV format. The excel format is used by the Customer GUI and the CSV format is used by the webapp. Figure 45 : Utiltiy GUI Step 12 The data file exported will be as follows Table 8 : Output OTP File - 55 - Master Thesis 6.2 Customer GUI Step 1: Run the C-GUI using Matlab. Figure 46 : Customer GUI Step 1 All the fields will be blank and the windows will show default settings. Step 2: Select the profile that needs to load onto the system. The three profiles listed as – Profile 1 – Utility Centric Profile 2 – Cost Centric Profile 3 – Customer Centric The C-GUI will access different files that are set for different profiles by the utility. The customers will be able to access these files according to their subscriptions. Select the profile from the drop down menu as shown in figure. - 56 - Master Thesis Figure 47 : Customer GUI Step 2 For demonstration, I selected the Cost centric option. Step 3: Now select the season from the drop down menu as shown. In actual operation the season will be replaced by a live feed and hence the steps taken by the customers would be minimal. Figure 48 : Customer GUI Step 3 Step 4: Select the day of the week for which the data needs to be accessed. - 57 - Master Thesis Figure 49 : Customer GUI Step 4 Step 5: Now to select the field to view the related data. Different fields can be selected to view different parameters. This gives the customers an idea of the predicted data for all parameters. It would prove to be helpful for planning purposes. Figure 50 : Customer GUI Step 5.1 The following figure shows the OTP for a given day - 58 - Master Thesis Figure 51 : Customer GUI Step 5.2 The following figure shows the data for the available solar power for a given day. Figure 52 : Customer GUI Step 5.3 The following figure shows the DCR for a given day - 59 - Master Thesis Figure 53 : Customer GUI Step 5.4 Step 6: The following figure shows the predicted output for the selected day at 6 am Figure 54 : Customer GUI Step 6.1 The following figure shows the output for the selected day at 2 pm. - 60 - Master Thesis Figure 55 : Customer GUI Step 6.2 The following figure shows the output for the given day at 8 pm. Figure 56 : Customer GUI Step 6.3 - 61 - Master Thesis 6.3 Customer Web App The customer web app was developed to portray the multi-platform functionality of the algorithm. The calculations done in Matlab can be exported in any file format required and accessed by multiple platforms. The web app gives the user the ability to access the data from a computer or any hand held device with an internet connection. The following application was written in HTML and was hosted from the computer itself. A server can be used for this purpose and the application can be used from anywhere using internet. Step1: The default page for the web app is as shown below in figure Figure 57 : Customer APP Step 1 Step 2: Select the profile that needs to load onto the system. The three profiles listed as – Profile 1 – Utility Centric Profile 2 – Cost Centric Profile 3 – Customer Centric The web app will access different files from the server that are set for different profiles by the utility. The customers will be able to access these files according to their subscriptions. - 62 - Master Thesis Profile 1 is selected for demonstration as shown in figure. Use the drop down box for this purpose. Figure 58 : Customer APP Step 2 Step3: The season is selected using the drop down menu as shown in the figure 59. Figure 59 : Customer APP Step 3 - 63 - Master Thesis Step 4: The day of the week can be selected as shown in the drop down menu in figure 60 Figure 60 : Customer APP Step 4 Step 5: The Field can be selected as shown in the drop down menu in figure Figure 61 : Customer APP Step 5 - 64 - Master Thesis Step 7: The output for the selected field can be viewed by clicking the pushbutton enter as shown in the figure 62. Figure 62 : Customer APP Step 7 Step 8: The predicted output for a given time on the selected day can be viewed by entering the desired time and selecting enter as shown in figure Figure 63 : Customer APP Step 8.1 - 65 - Master Thesis The following figure shows another instance of the predicted data for a different time period selected foer the same day Figure 64 : Customer APP Step 8.2 - 66 - Master Thesis CHAPTER 7: Future work This project has several areas which can be used and expanded for multiple applications. The simplicity of the algorithm and ease of modification make it extremely convenient to use it on multiple platforms and systems. The central idea of this project revolves around creating an efficient smart system, which can be used together with multiple platforms such that charging, and discharging can be controlled by several ways. Applications can be developed on Android, iOS, HTML and these can be used to control the charging facility and to set up the parameters used in automated charging systems. The technology has to be more or less self-sufficient and all calculations must be taken by a computer. Further sophistication is also required for this project. Battery charging level, daily average miles traveled and other such parameters can help in taking decisions during the hold or intermediate state when there is no clear instruction from the utility. The data from the car-share ride program needs to be integrated with this data. It is important to get accurate data about customer preferences and habits to get a better estimate of the load. In operation, every customer’s needs might be unique but this data will be helpful for simulation purposes. The present system does not use servers or online services. When implemented at full scale all the data can be transferred over Wi-Fi and the customers can have accounts in which all the data is stored. This can help on distributing benefits to customers based on their user profile and power usage. Incentives can be given for appropriate usage of power and following utility instructions. Having a good interactive system for charging will promote the usage of electric vehicles and the incentives and added benefits will prove beneficial for the utility as well as customers. Different programs can be set up according to different kind of user profiles and charging habits. Utilities should aim at flattening the duck curve and utilizing a maximum of the excess energy produced throughout the day. This can prove to be a very effective and efficient energy management tool. - 67 - Master Thesis CHAPTER 8: Conclusions The research has led to the development of a simple unified multiplatform algorithm, which aims at improving the communication and control of the utility over the charging and discharging habits of customers. This will help to improve the load distribution and prediction capabilities of the utility. If customer follow the instructions and in case of automated charging the charging and discharging curves of the customers will match with those of the utility and this will enable the utilities to save more power and improve the efficiency of the system overall. Large fleets of electric vehicles can be discharged during high peak load periods, thus helping the utility reduce the effect of peak loading situations. As the charging curves will not be abrupt it will help to flatten out the duck curve which is a major problem faced by utilities all around. The times when there is excess generation due to base-load generation and most of the energy is wasted, we can go ahead with automated car charging techniques. On the customer side, the improved communication capabilities will help the utilities strike a balance between regulated demand and peak power requirement. As the customer, preference will also be included in the calculations it will be easier for the customers to charge their batteries accordingly. This would help to reduce the initial hesitation often found in customers considering electric vehicles due to charging period. It will promote the usage of electric vehicles and help on reducing carbon emissions. The fact that charging stations can be automated changes the dynamics of the system. Customers can rely on computers to calculate the best possible time to charge and discharge batteries. This gives a lot of flexibility to customers to use electric vehicles. The capability to manage customer data easily reduces the utilities workload and helps in giving out incentives and benefits. The research outcome has been highly effective for different cases of inputs and conditions. The algorithm gives accurate results for various data files and models. The modular approach works well with determining the outcome for different situations. Other modules can be integrated to this system without any changes to the base algorithm. Further sophistication and polishing of the algorithm can help create a complete smart efficient automated charging system. - 68 - Master Thesis References (n.d.). Retrieved from www.afdc.energy.gov/: http://www.afdc.energy.gov/fuels/electricity_locations.html (n.d.). Retrieved from www.energy.ca.gov: http://www.energy.ca.gov/renewables/tracking_progress/documents/electric_vehic le.pdf (n.d.). Retrieved from evobsession.com: http://evobsession.com/electric-car-charging-101- types-of-charging-apps-more/ (n.d.). Retrieved from www.teslamotors.com: https://www.teslamotors.com/powerwall Berman, B. (n.d.). Retrieved from http://www.plugincars.com: http://www.plugincars.com/ultimate-guide-electric-car-charging-networks- 126530.html gosolarcalifornia. (n.d.). Retrieved from http://www.gosolarcalifornia.ca.gov: http://www.gosolarcalifornia.ca.gov/csi/step3.php J. A. Peças Lopes, F. J. (2009). Smart Charging Strategies for Electric Vehicles : Enhancing Grid Performance and Maximizing the Use of Variable Renewable Energy Resources. EVS24 International Battery, Hybrid and Fuel Cell Electric Vehicle Symposium , 1-11. pvwatts. (n.d.). Retrieved from http://nrel.gov: http://pvwatts.nrel.gov/pvwatts.php Rui Freire, J. D. (2010). Integration of Renewable Energy Generation with EV Charging Strategies to Optimize Grid Load Balancing. Annual Conference on Intelligent Transportation Systems, 392-396. Southern California Edison. (n.d.). Retrieved from https://www.sce.com: https://www.sce.com/wps/portal/home/residential/rates/Time-Of-Use-Residential- Rate-Plans/Residential-Rate- Changes/!ut/p/b1/tVPBUoMwEP0VPXikWUhL4JgqUrC0tlgtXDopTSlKA0KmV b_e0OnB6oh6MKfNznub3bcvKEZzFAu2y1Ims0KwvLnH5sL3rqjudg1vHI4IUD 10AncyxI7ZVYBIAeCbQ-HA1y2X Today's Outlook. (n.d.). Retrieved from Califonia ISO: http://www.caiso.com/Pages/TodaysOutlook.aspx - 69 - Master Thesis APPENDIX - 70 - Master Thesis A. Utility Code : U – GUI_M Matlab code for Utility GUI function varargout = Final1utility(varargin) % FINAL1UTILITY MATLAB code for Final1utility.fig % FINAL1UTILITY, by itself, creates a new FINAL1UTILITY or raises the existing % singleton*. % % H = FINAL1UTILITY returns the handle to a new FINAL1UTILITY or the handle to % the existing singleton*. % % FINAL1UTILITY('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in FINAL1UTILITY.M with the given input arguments. % % FINAL1UTILITY('Property','Value',...) creates a new FINAL1UTILITY or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before Final1utility_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to Final1utility_OpeningFcn via varargin. % % Begin initialization code - DO NOT EDIT GUI_Singleton = 1; GUI_State = struct('GUI_Name', mfilename, ... 'GUI_Singleton', GUI_Singleton, ... 'GUI_OpeningFcn', @Final1utility_OpeningFcn, ... 'GUI_OutputFcn', @Final1utility_OutputFcn, ... 'GUI_LayoutFcn', [] , ... 'GUI_Callback', []); if nargin && ischar(varargin{1}) GUI_State.GUI_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = GUI_mainfcn(GUI_State, varargin{:}); else GUI_mainfcn(GUI_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before Final1utility is made visible. function Final1utility_OpeningFcn(hObject, ~, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to Final1utility (see VARARGIN) %% % Choose default command line output for Final1utility - 71 - Master Thesis handles.output = hObject; axes(handles.Plot3); imshow('chargeon.jpg') % USC logo display % Update handles structure GUIdata(hObject, handles); % UIWAIT makes Final1utility wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Final1utility_OutputFcn(~, ~, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; function edit1_Callback(~, ~, ~) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes during object creation, after setting all properties. function edit1_CreateFcn(hObject, ~, ~) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit2_Callback(~, ~, ~) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, ~, ~) % hObject handle to edit2 (see GCBO) - 72 - Master Thesis % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit3_Callback(~, ~, ~) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit4_Callback(~, ~, ~) % hObject handle to edit4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, ~, ~) % hObject handle to edit4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in Seasons. function Seasons_Callback(hObject, eventdata, handles) % hObject handle to Seasons (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) - 73 - Master Thesis % Hints: contents = cellstr(get(hObject,'String')) returns Seasons contents as cell array % contents{get(hObject,'Value')} returns selected item from Seasons global PopSeasonfinal contents = cellstr(get(hObject,'String')); PopSeason = contents{get(hObject,'Value')}; if (strcmp(PopSeason,'Summer')) PopSeasonNumber = 1; elseif (strcmp(PopSeason,'Autumn')) PopSeasonNumber = 2; elseif (strcmp(PopSeason,'Winter')) PopSeasonNumber = 3; elseif (strcmp(PopSeason,'Spring')) PopSeasonNumber = 4; end PopSeasonfinal = PopSeasonNumber; % --- Executes during object creation, after setting all properties. function Seasons_CreateFcn(hObject, eventdata, handles) % hObject handle to Seasons (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in PredictedGeneration. function PredictedGeneration_Callback(~, ~, handles) % hObject handle to PredictedGeneration (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 - 74 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 - 75 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 - 76 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 - 77 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 - 78 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 - 79 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end end %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Time = data(:,1); CapacityProductionMW = data(:,2); ActualLoadMW = data(:,3); CustomerPreferenceSurvey = data(:,4); ChargingRatesCentskWh = data(:,5); DischargingRatesCentskWh = data(:,6); %% Clear temporary variables clearvars data raw; % display 24 hours graph for Generation axes(handles.Plot1); plot(CapacityProductionMW) xlabel('Time (0-24)'); ylabel('Capacity (MW)'); grid on; % --- Executes on button press in PredictedLoad. function PredictedLoad_Callback(~, ~, handles) % hObject handle to PredictedLoad (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); - 80 - Master Thesis elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end - 81 - Master Thesis elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 - 82 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 - 83 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 - 84 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end - 85 - Master Thesis end %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Time = data(:,1); CapacityProductionMW = data(:,2); ActualLoadMW = data(:,3); CustomerPreferenceSurvey = data(:,4); ChargingRatesCentskWh = data(:,5); DischargingRatesCentskWh = data(:,6); %% Clear temporary variables clearvars data raw; %% Display 24 hours graph for Load axes(handles.Plot1); plot(ActualLoadMW) xlabel('Time (0-24)'); ylabel('Load (MW)'); grid on; % --- Executes on button press in Randomize. function Randomize_Callback(hObject, eventdata, handles) % hObject handle to Randomize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Randomize %% Import the data global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); - 86 - Master Thesis end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 - 87 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 - 88 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 - 89 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end - 90 - Master Thesis elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end end %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Time = data(:,1); - 91 - Master Thesis CapacityProductionMW = data(:,2); ActualLoadMW = data(:,3); CustomerPreferenceSurvey = data(:,4); ChargingRatesCentskWh = data(:,5); DischargingRatesCentskWh = data(:,6); %% Clear temporary variables clearvars data raw; %% Random Data Generation RX = 1*rand(1,24); global RandCapacityProduction ; RandCapacityProduction = ones(1,24); for n = 1:24 RandCapacityProduction(n) = (ActualLoadMW(n)+ 5000*RX(n)); end display (RandCapacityProduction) % display 24 hours graph for Generation axes(handles.Plot1); plot(RandCapacityProduction) xlabel('Time (0-24)'); ylabel('Capacity (MW)'); grid on; % --- Executes on button press in AvailableCapacity. function AvailableCapacity_Callback(~, ~, handles) % hObject handle to AvailableCapacity (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 - 92 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 - 93 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 - 94 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 - 95 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 - 96 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end end %% Create output variable data = reshape([raw{:}],size(raw)); - 97 - Master Thesis %% Allocate imported array to column variable names Time = data(:,1); CapacityProductionMW = data(:,2); ActualLoadMW = data(:,3); CustomerPreferenceSurvey = data(:,4); ChargingRatesCentskWh = data(:,5); DischargingRatesCentskWh = data(:,6); %% Clear temporary variables clearvars data raw; %% % calculate actual available capacity global RandCapacityProduction Nocoeffavailablecharging = ones(1,24); for n = 1:24 Nocoeffavailablecharging(n) = CapacityProductionMW(n)-RandCapacityProduction(n); end display (Nocoeffavailablecharging) % display the 24 hour graph for capacity axes(handles.Plot1); bar(Nocoeffavailablecharging) xlabel('Time (0-24)'); ylabel('Capacity (MW)'); grid on; % --- Executes on button press in Coeffenter. function Coeffenter_Callback(~, ~, handles) % hObject handle to Coeffenter (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % global declarations to use variables in different functions global CoeffA global CoeffB global CoeffC global Factorper % Obtain values entered by user CoeffA = str2double(get(handles.edit1,'string')); CoeffC = str2double(get(handles.edit2,'string')); CoeffB = 10 - CoeffA - CoeffC; Factorper = str2double(get(handles.edit3,'string')); % Display values on command screen display (CoeffA) display (CoeffB) display (CoeffC) display (Factorper) - 98 - Master Thesis % --- Executes on button press in OTPcharging. function OTPcharging_Callback(~, ~, handles) % hObject handle to OTPcharging (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 - 99 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 - 100 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 - 101 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 - 102 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 - 103 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end end %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Time = data(:,1); CapacityProductionMW = data(:,2); ActualLoadMW = data(:,3); CustomerPreferenceSurvey = data(:,4); ChargingRatesCentskWh = data(:,5); DischargingRatesCentskWh = data(:,6); %% Clear temporary variables clearvars data raw; %% global declarations global CoeffA global CoeffB global CoeffC global Factorper global RandCapacityProduction %% Calculate Available charging capacity (Factor included) Availablecharcap = ones(1,24); - 104 - Master Thesis for n = 1:24 Availablecharcap(n) = CapacityProductionMW(n)-((Factorper + 1)*RandCapacityProduction(n)); end display (Availablecharcap) %% Maximum values calculation MaxAvailablecharcap = max(Availablecharcap); display(MaxAvailablecharcap) Maxchargerate = max(ChargingRatesCentskWh); display (Maxchargerate) %% % Calculation for 24 hours (All parameters) TwentyFourAUP = ones(1,24); for n = 1:24 TwentyFourAUP(n) = (CoeffA*Availablecharcap(n)*10)/MaxAvailablecharcap; end TwentyFourCustomer = ones(1,24); for n = 1:24 TwentyFourCustomer(n) = CoeffB * CustomerPreferenceSurvey(n); end TwentyFourCCR = ones(1,24); for n = 1:24 TwentyFourCCR(n) = CoeffC * (1-(ChargingRatesCentskWh(n)/Maxchargerate))* 10; end TwentyFourOTP = ones(1,24); for n = 1:24 TwentyFourOTP(n) = (TwentyFourAUP(n) + TwentyFourCustomer(n) + TwentyFourCCR(n))/10; end % Display the OTP graph for 24 hours axes(handles.Plot2); bar(TwentyFourOTP) xlabel('Time (0-24)'); ylabel('OTP'); grid on; % --- Executes on button press in OTPdischarging. function OTPdischarging_Callback(~, ~, handles) % hObject handle to OTPdischarging (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data %% Import the data global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 - 105 - Master Thesis if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 - 106 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 - 107 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 - 108 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 - 109 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 - 110 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end end %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Time = data(:,1); CapacityProductionMW = data(:,2); ActualLoadMW = data(:,3); CustomerPreferenceSurvey = data(:,4); ChargingRatesCentskWh = data(:,5); DischargingRatesCentskWh = data(:,6); %% Clear temporary variables clearvars data raw; %% Maximum value calculations for DCR Maxdischrate = max(DischargingRatesCentskWh); display (Maxdischrate) % 24 hours DCR calculation TwentyFourDCR = ones(1,24); for n = 1:24 TwentyFourDCR(n) = (10*DischargingRatesCentskWh(n)/Maxdischrate); end % Display 24 hour DCR graph axes(handles.Plot2); bar(TwentyFourDCR) xlabel('Time (0-24)'); ylabel('DCR'); grid on; % --- Executes on button press in Exportdata. function Exportdata_Callback(~, ~, ~) - 111 - Master Thesis % hObject handle to Exportdata (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end - 112 - Master Thesis elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile1\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 - 113 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 - 114 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile2\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\STuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 - 115 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ATuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\AFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Autumn\ASundaydata.xlsx','Sheet1','A2:F25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Summer\SSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Winter\WSundaydata.xlsx','Sheet1','A2:F25'); end - 116 - Master Thesis elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPMondaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPTuesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPWednesdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPThursdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPFridaydaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSaturdaydata.xlsx','Sheet1','A2:F25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Utility\Profile3\Spring\SPSundaydata.xlsx','Sheet1','A2:F25'); end end end %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Time = data(:,1); CapacityProductionMW = data(:,2); ActualLoadMW = data(:,3); CustomerPreferenceSurvey = data(:,4); ChargingRatesCentskWh = data(:,5); DischargingRatesCentskWh = data(:,6); %% Clear temporary variables clearvars data raw; %% global declarations global CoeffA global CoeffB global CoeffC global Factorper global RandCapacityProduction %% Calculate Available charging capacity Availablecharcap = ones(1,24); for n = 1:24 Availablecharcap(n) = CapacityProductionMW(n)-((Factorper + 1)*RandCapacityProduction(n)); end display (Availablecharcap) - 117 - Master Thesis %% Maximum parameters MaxAvailablecharcap = max(Availablecharcap); display(MaxAvailablecharcap) Maxchargerate = max(ChargingRatesCentskWh); display (Maxchargerate) Maxdischrate = max(DischargingRatesCentskWh); display (Maxdischrate) %% 24 hour calculations TwentyFourAUP = ones(1,24); for n = 1:24 TwentyFourAUP(n) = (CoeffA*Availablecharcap(n)*10)/MaxAvailablecharcap; end TwentyFourCustomer = ones(1,24); for n = 1:24 TwentyFourCustomer(n) = CoeffB * CustomerPreferenceSurvey(n); end TwentyFourCCR = ones(1,24); for n = 1:24 TwentyFourCCR(n) = CoeffC * (1-(ChargingRatesCentskWh(n)/Maxchargerate))* 10; end TwentyFourOTP = ones(1,24); for n = 1:24 TwentyFourOTP(n) = (TwentyFourAUP(n) + TwentyFourCustomer(n) + TwentyFourCCR(n))/10; end TwentyFourDCR = ones(1,24); for n = 1:24 TwentyFourDCR(n) = (10*DischargingRatesCentskWh(n)/Maxdischrate); end % Create output array to export OTPoutput = [1 TwentyFourOTP(1) TwentyFourDCR(1) ChargingRatesCentskWh(1);2 TwentyFourOTP(2) TwentyFourDCR(2) ChargingRatesCentskWh(2);3 TwentyFourOTP(3) TwentyFourDCR(3) ChargingRatesCentskWh(3);4 TwentyFourOTP(4) TwentyFourDCR(4) ChargingRatesCentskWh(4);5 TwentyFourOTP(5) TwentyFourDCR(5) ChargingRatesCentskWh(5);6 TwentyFourOTP(6) TwentyFourDCR(6) ChargingRatesCentskWh(6);7 TwentyFourOTP(7) TwentyFourDCR(7) ChargingRatesCentskWh(7);8 TwentyFourOTP(8) TwentyFourDCR(8) ChargingRatesCentskWh(8);9 TwentyFourOTP(9) TwentyFourDCR(9) ChargingRatesCentskWh(9);10 TwentyFourOTP(10) TwentyFourDCR(10) ChargingRatesCentskWh(10);11 TwentyFourOTP(11) TwentyFourDCR(11) ChargingRatesCentskWh(11);12 TwentyFourOTP(12) TwentyFourDCR(12) ChargingRatesCentskWh(12);13 TwentyFourOTP(13) TwentyFourDCR(13) ChargingRatesCentskWh(13);14 TwentyFourOTP(14) TwentyFourDCR(14) ChargingRatesCentskWh(14);15 TwentyFourOTP(15) TwentyFourDCR(15) ChargingRatesCentskWh(15);16 TwentyFourOTP(16) TwentyFourDCR(16) - 118 - Master Thesis ChargingRatesCentskWh(16);17 TwentyFourOTP(17) TwentyFourDCR(17) ChargingRatesCentskWh(17);18 TwentyFourOTP(18) TwentyFourDCR(18) ChargingRatesCentskWh(18);19 TwentyFourOTP(19) TwentyFourDCR(19) ChargingRatesCentskWh(19);20 TwentyFourOTP(20) TwentyFourDCR(20) ChargingRatesCentskWh(20);21 TwentyFourOTP(21) TwentyFourDCR(21) ChargingRatesCentskWh(21);22 TwentyFourOTP(22) TwentyFourDCR(22) ChargingRatesCentskWh(22);23 TwentyFourOTP(23) TwentyFourDCR(23) ChargingRatesCentskWh(23);24 TwentyFourOTP(24) TwentyFourDCR(24) ChargingRatesCentskWh(24)]; % headers for excel file if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputmonday.csv',OTPoutput,h eader) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 - 119 - Master Thesis % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputfriday.csv',OTPoutput,hea der) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputsaturday.csv',OTPoutput,h eader) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputsunday.csv',OTPoutput,hea der) end - 120 - Master Thesis elseif PopSeasonfinal == 2 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp - 121 - Master Thesis csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputfriday.csv',OTPoutput,head er) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputsaturday.csv',OTPoutput,he ader) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 3 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputmonday.xls',OTPoutput,'Sheet1','A2') - 122 - Master Thesis % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputtuesday.csv',OTPoutput,hea der) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputwednesday.csv',OTPoutput, header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputfriday.xls',header,'Sheet1') % offset location for values considering headers - 123 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputsunday.csv',OTPoutput,head er) end elseif PopSeasonfinal == 4 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations - 124 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputtuesday.csv',OTPoutput,head er) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputwednesday.csv',OTPoutput,h eader) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; - 125 - Master Thesis % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputsunday.csv',OTPoutput,head er) end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputtuesday.csv',OTPoutput,he ader) - 126 - Master Thesis elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputfriday.csv',OTPoutput,hea der) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp - 127 - Master Thesis csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputsaturday.csv',OTPoutput,h eader) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 2 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers - 128 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputfriday.csv',OTPoutput,head er) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('Time1','D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputsaturday.csv',OTPoutput,he ader) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsunday.xls',header,'Sheet1') - 129 - Master Thesis % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 3 if Popdayfinal == 1 header ={'Time1','Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputtuesday.csv',OTPoutput,hea der) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputwednesday.csv',OTPoutput, header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations - 130 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputsunday.csv',OTPoutput,head er) end elseif PopSeasonfinal == 4 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; - 131 - Master Thesis % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputtuesday.csv',OTPoutput,head er) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Spring\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Spring\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputwednesday.csv',OTPoutput,h eader) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file - 132 - Master Thesis header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputsunday.csv',OTPoutput,head er) end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Summer\Profile3\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Summer\Profile3\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputmonday.csv',OTPoutput,he ader) - 133 - Master Thesis elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp - 134 - Master Thesis csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputfriday.csv',OTPoutput,hea der) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputsaturday.csv',OTPoutput,h eader) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 2 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers - 135 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputfriday.csv',OTPoutput,head er) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsaturday.xls',header,'Sheet1') - 136 - Master Thesis % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputsaturday.csv',OTPoutput,he ader) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 3 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputtuesday.csv',OTPoutput,hea der) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations - 137 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputwednesday.csv',OTPoutput, header) elseif Popdayfinal == 4 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; - 138 - Master Thesis % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputsunday.csv',OTPoutput,head er) end elseif PopSeasonfinal == 4 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputtuesday.csv',OTPoutput,head er) elseif Popdayfinal == 3 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputwednesday.csv',OTPoutput,h eader) elseif Popdayfinal == 4 - 139 - Master Thesis % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputsunday.csv',OTPoutput,head er) end - 140 - Master Thesis end end %% % --- Executes on button press in EmStop. function EmStop_Callback(hObject, eventdata, handles) % hObject handle to EmStop (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) OTPoutput = [ 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ; 100000 100000 100000 ] global PopProfilefinal global PopSeasonfinal global Popdayfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputmonday.csv',OTPoutput,h eader) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; - 141 - Master Thesis % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputfriday.csv',OTPoutput,hea der) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputsaturday.csv',OTPoutput,h eader) elseif Popdayfinal == 7 % headers for excel file - 142 - Master Thesis header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Summer\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 2 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputwednesday.csv',OTPoutput ,header) - 143 - Master Thesis elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputfriday.csv',OTPoutput,head er) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputsaturday.csv',OTPoutput,he ader) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Autumn\outputsunday.csv',OTPoutput,hea der) - 144 - Master Thesis end elseif PopSeasonfinal == 3 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputtuesday.csv',OTPoutput,hea der) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputwednesday.csv',OTPoutput, header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp - 145 - Master Thesis csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Winter\outputsunday.csv',OTPoutput,head er) end elseif PopSeasonfinal == 4 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputmonday.xls',OTPoutput,'Sheet1','A2') - 146 - Master Thesis % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputtuesday.csv',OTPoutput,head er) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputwednesday.csv',OTPoutput,h eader) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputfriday.xls',header,'Sheet1') % offset location for values considering headers - 147 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile1\Spring\outputsunday.csv',OTPoutput,head er) end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; - 148 - Master Thesis % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputfriday.csv',OTPoutput,hea der) elseif Popdayfinal == 6 % headers for excel file - 149 - Master Thesis header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputsaturday.csv',OTPoutput,h eader) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Summer\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 2 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputtuesday.csv',OTPoutput,he ader) - 150 - Master Thesis elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputfriday.csv',OTPoutput,head er) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputsaturday.csv',OTPoutput,he ader) - 151 - Master Thesis elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Autumn\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 3 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputtuesday.csv',OTPoutput,hea der) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp - 152 - Master Thesis csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputwednesday.csv',OTPoutput, header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsunday.xls',OTPoutput,'Sheet1','A2') - 153 - Master Thesis % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Winter\outputsunday.csv',OTPoutput,head er) end elseif PopSeasonfinal == 4 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputtuesday.csv',OTPoutput,head er) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Spring\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Spring\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputwednesday.csv',OTPoutput,h eader) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputthursday.xls',header,'Sheet1') % offset location for values considering headers - 154 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile2\Spring\outputsunday.csv',OTPoutput,head er) end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations - 155 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Summer\Profile3\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Summer\Profile3\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputmonday.csv',OTPoutput,he ader) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file - 156 - Master Thesis header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputfriday.csv',OTPoutput,hea der) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputsaturday.csv',OTPoutput,h eader) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Summer\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 2 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputmonday.csv',OTPoutput,he ader) - 157 - Master Thesis elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputtuesday.csv',OTPoutput,he ader) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputwednesday.csv',OTPoutput ,header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputthursday.csv',OTPoutput,h eader) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputfriday.csv',OTPoutput,head er) - 158 - Master Thesis elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputsaturday.csv',OTPoutput,he ader) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Autumn\outputsunday.csv',OTPoutput,hea der) end elseif PopSeasonfinal == 3 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp - 159 - Master Thesis csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputtuesday.csv',OTPoutput,hea der) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputwednesday.csv',OTPoutput, header) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsaturday.xls',OTPoutput,'Sheet1','A2') - 160 - Master Thesis % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsunday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Winter\outputsunday.csv',OTPoutput,head er) end elseif PopSeasonfinal == 4 if Popdayfinal == 1 header ={'Time1','OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputmonday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputmonday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputmonday.csv',OTPoutput,hea der) elseif Popdayfinal == 2 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputtuesday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputtuesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputtuesday.csv',OTPoutput,head er) elseif Popdayfinal == 3 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputwednesday.xls',header,'Sheet1') % offset location for values considering headers - 161 - Master Thesis xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputwednesday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputwednesday.csv',OTPoutput,h eader) elseif Popdayfinal == 4 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputthursday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputthursday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputthursday.csv',OTPoutput,hea der) elseif Popdayfinal == 5 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputfriday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputfriday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputfriday.csv',OTPoutput,heade r) elseif Popdayfinal == 6 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsaturday.xls',header,'Sheet1') % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsaturday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputsaturday.csv',OTPoutput,hea der) elseif Popdayfinal == 7 % headers for excel file header ={'OTP','DCR','Cost'}; % header locations xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsunday.xls',header,'Sheet1') - 162 - Master Thesis % offset location for values considering headers xlswrite('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsunday.xls',OTPoutput,'Sheet1','A2') % Write csv file for webapp csvwrite_with_headers('D:\Thesis_Last Month\MatlabCodes\Customer\chargeon\chargeon\data\Profile3\Spring\outputsunday.csv',OTPoutput,head er) end end end % --- Executes on selection change in Popweek. function Popweek_Callback(hObject, eventdata, handles) % hObject handle to Popweek (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global Popdayfinal contents = cellstr(get(hObject,'String')); Popday = contents{get(hObject,'Value')}; if (strcmp(Popday,'Monday')) PopdayNumber = 1; elseif (strcmp(Popday,'Tuesday')) PopdayNumber = 2; elseif (strcmp(Popday,'Wednesday')) PopdayNumber = 3; elseif (strcmp(Popday,'Thursday')) PopdayNumber = 4; elseif (strcmp(Popday,'Friday')) PopdayNumber = 5; elseif (strcmp(Popday,'Saturday')) PopdayNumber = 6; elseif (strcmp(Popday,'Sunday')) PopdayNumber = 7; end Popdayfinal = PopdayNumber; % --- Executes during object creation, after setting all properties. function Popweek_CreateFcn(hObject, eventdata, handles) % hObject handle to Popweek (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end %% End of the code % GUI for Utility % One week display % Coefficient & factor input % OTP and DCR Calculation % Export the data as a excel sheet - 163 - Master Thesis % --- Executes on selection change in Profilemenu. function Profilemenu_Callback(hObject, eventdata, handles) % hObject handle to Profilemenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,'String')) returns Profilemenu contents as cell array % contents{get(hObject,'Value')} returns selected item from Profilemenu global PopProfilefinal contents = cellstr(get(hObject,'String')); PopProfile = contents{get(hObject,'Value')}; if (strcmp(PopProfile,'Profile 1')) PopProfileNumber = 1; elseif (strcmp(PopProfile,'Profile 2')) PopProfileNumber = 2; elseif (strcmp(PopProfile,'Profile 3')) PopProfileNumber= 3; end PopProfilefinal = PopProfileNumber; % --- Executes during object creation, after setting all properties. function Profilemenu_CreateFcn(hObject, eventdata, handles) % hObject handle to Profilemenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end - 164 - Master Thesis B. Customer GUI Code : C – GUI_M Matlab code for Customer GUI function varargout = Customer_TH(varargin) % CUSTOMER_TH MATLAB code for Customer_TH.fig % CUSTOMER_TH, by itself, creates a new CUSTOMER_TH or raises the existing % singleton*. % % H = CUSTOMER_TH returns the handle to a new CUSTOMER_TH or the handle to % the existing singleton*. % % CUSTOMER_TH('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in CUSTOMER_TH.M with the given input arguments. % % CUSTOMER_TH('Property','Value',...) creates a new CUSTOMER_TH or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before Customer_TH_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to Customer_TH_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help Customer_TH % Begin initialization code - DO NOT EDIT GUI_Singleton = 1; GUI_State = struct('GUI_Name', mfilename, ... 'GUI_Singleton', GUI_Singleton, ... 'GUI_OpeningFcn', @Customer_TH_OpeningFcn, ... 'GUI_OutputFcn', @Customer_TH_OutputFcn, ... 'GUI_LayoutFcn', [] , ... 'GUI_Callback', []); if nargin && ischar(varargin{1}) GUI_State.GUI_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = GUI_mainfcn(GUI_State, varargin{:}); else GUI_mainfcn(GUI_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before Customer_TH is made visible. function Customer_TH_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) - 165 - Master Thesis % varargin command line arguments to Customer_TH (see VARARGIN) % Choose default command line output for Customer_TH handles.output = hObject; % display USC logo axes(handles.axes8); imshow('chargeon.jpg') % Update handles structure GUIdata(hObject, handles); % UIWAIT makes Customer_TH wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Customer_TH_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in pushpredict. function pushpredict_Callback(hObject, eventdata, handles) % hObject handle to pushpredict (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data for OTP global OTP global DCR global DCArrayOutputW1 %% global declarations global Entertime Entertime = str2double(get(handles.predictime,'string')); %% match array positions with time signature OTPcheck = OTP(Entertime); DCRcheck = DCR(Entertime); %% display EV output %If else part 1 if OTPcheck > 99999 axes(handles.axes2); imshow('stop.jpg') title('Emergency!') elseif OTPcheck > 6 - 166 - Master Thesis axes(handles.axes2); imshow('EV_Green.jpg') title('Charge') elseif OTPcheck > 3 axes(handles.axes2); imshow('EV_Yellow.jpg') title('Hold') else axes(handles.axes2); imshow('EV_Red.jpg') title('Do not charge') end %% display Battery output %If else part 2 if OTPcheck > 99999 axes(handles.axes3); imshow('dischargebattery.jpg') title('Emergency!') elseif DCRcheck > 5 axes(handles.axes3); imshow('dischargebattery.jpg') title('Discharge Powerwall') else axes(handles.axes3); imshow('chargebattery.jpg') title('Charge Powerwall') end %% Solardc = DCArrayOutputW1(Entertime); display (Solardc) %% Home part %% Import the data [~, ~, raw] = xlsread('C:\Users\TANAY\Documents\MATLAB\thesis\SolarDG\Home_Daily.xlsx','Sheet1','A2:B25'); %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Hour2 = data(:,1); UsageKW = data(:,2); %% Clear temporary variables clearvars data raw; %% match array positions with time signature Solarout = DCArrayOutputW1(Entertime)- UsageKW(Entertime); display(Solarout) %If else part 1 - 167 - Master Thesis if OTPcheck > 99999 axes(handles.axes4); imshow('stop.jpg') title('Emergency!') elseif Solardc > 200 axes(handles.axes4); imshow('solar-panel_available.png') title('Solar Power Available') else axes(handles.axes4); imshow('solar_panel_go.png') title('Solar Power Unavailable') end %If else part 2 if OTPcheck > 99999 axes(handles.axes5); imshow('stop.jpg') title('Emergency!') elseif Solarout > 300 axes(handles.axes5); imshow('solar-panel_available.png') title('Solar Power Sufficient') else axes(handles.axes5); imshow('Grid_Power.png') title('Grid Power Required') end % --- Executes on selection change in popday. function popday_Callback(hObject, eventdata, handles) % hObject handle to popday (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,'String')) returns popday contents as cell array % contents{get(hObject,'Value')} returns selected item from popday global Popdayfinal contents = cellstr(get(hObject,'String')); Popday = contents{get(hObject,'Value')}; if (strcmp(Popday,'Monday')) PopdayNumber = 1; elseif (strcmp(Popday,'Tuesday')) PopdayNumber = 2; elseif (strcmp(Popday,'Wednesday')) PopdayNumber = 3; elseif (strcmp(Popday,'Thursday')) PopdayNumber = 4; elseif (strcmp(Popday,'Friday')) PopdayNumber = 5; elseif (strcmp(Popday,'Saturday')) - 168 - Master Thesis PopdayNumber = 6; elseif (strcmp(Popday,'Sunday')) PopdayNumber = 7; end Popdayfinal = PopdayNumber; % --- Executes during object creation, after setting all properties. function popday_CreateFcn(hObject, eventdata, handles) % hObject handle to popday (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in popfield. function popfield_Callback(hObject, eventdata, handles) % hObject handle to popfield (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,'String')) returns popfield contents as cell array % contents{get(hObject,'Value')} returns selected item from popfield global Popdayfield contents = cellstr(get(hObject,'String')); Popday = contents{get(hObject,'Value')}; if (strcmp(Popday,'OTP')) Popdayfield = 1; elseif (strcmp(Popday,'Solar Power')) Popdayfield = 2; elseif (strcmp(Popday,'DCR')) Popdayfield = 3; end % --- Executes during object creation, after setting all properties. function popfield_CreateFcn(hObject, eventdata, handles) % hObject handle to popfield (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end - 169 - Master Thesis % --- Executes on button press in pushenter. function pushenter_Callback(hObject, eventdata, handles) % hObject handle to pushenter (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Import the data global Popdayfield global OTP global DCR global DCArrayOutputW1 if Popdayfield == 1 %% display (OTP) axes(handles.axes1); bar(OTP) xlabel('Time (0-24)'); ylabel('OTP'); grid on; %% Solar Part elseif Popdayfield == 2 axes(handles.axes1); plot(DCArrayOutputW1) xlabel('Time (0-24)'); ylabel('Capacity (W)'); grid on; %% %%DCR Out elseif Popdayfield == 3 display (DCR) axes(handles.axes1); bar(DCR) xlabel('Time (0-24)'); ylabel('DCR'); grid on; end function predictime_Callback(hObject, eventdata, handles) % hObject handle to predictime (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of predictime as text % str2double(get(hObject,'String')) returns contents of predictime as a double %% global declarations - 170 - Master Thesis global Entertime % get input value from user Entertime =(get(hObject,'string')); %Entertime = str2double(get(hObject,'string')); % display the enerted value in command window display (Entertime) % --- Executes during object creation, after setting all properties. function predictime_CreateFcn(hObject, eventdata, handles) % hObject handle to predictime (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in popseason. function popseason_Callback(hObject, eventdata, handles) % hObject handle to popseason (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,'String')) returns popseason contents as cell array % contents{get(hObject,'Value')} returns selected item from popseason global PopSeasonfinal contents = cellstr(get(hObject,'String')); PopSeason = contents{get(hObject,'Value')}; if (strcmp(PopSeason,'Summer')) PopSeasonNumber = 1; elseif (strcmp(PopSeason,'Autumn')) PopSeasonNumber = 2; elseif (strcmp(PopSeason,'Winter')) PopSeasonNumber = 3; elseif (strcmp(PopSeason,'Spring')) PopSeasonNumber = 4; end PopSeasonfinal = PopSeasonNumber; % --- Executes during object creation, after setting all properties. function popseason_CreateFcn(hObject, eventdata, handles) % hObject handle to popseason (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. - 171 - Master Thesis % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in ProfileSelect. function ProfileSelect_Callback(hObject, eventdata, handles) % hObject handle to ProfileSelect (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,'String')) returns ProfileSelect contents as cell array % contents{get(hObject,'Value')} returns selected item from ProfileSelect global PopProfilefinal contents = cellstr(get(hObject,'String')); PopProfile = contents{get(hObject,'Value')}; if (strcmp(PopProfile,'Profile 1')) PopProfileNumber = 1; elseif (strcmp(PopProfile,'Profile 2')) PopProfileNumber = 2; elseif (strcmp(PopProfile,'Profile 3')) PopProfileNumber= 3; end PopProfilefinal = PopProfileNumber; % --- Executes during object creation, after setting all properties. function ProfileSelect_CreateFcn(hObject, eventdata, handles) % hObject handle to ProfileSelect (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in Load. function Load_Callback(hObject, eventdata, handles) % hObject handle to Load (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global OTP global Time global DCR global Cost global PlaneofArrayIrradianceWm1 global DCArrayOutputW1 global ACSystemOutputW1 global PopProfilefinal - 172 - Master Thesis global Popdayfinal global PopSeasonfinal if PopProfilefinal == 1 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Summer\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; - 173 - Master Thesis elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Autumn\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Winter\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; - 174 - Master Thesis elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile1\Spring\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end end elseif PopProfilefinal == 2 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Summer\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 - 175 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Autumn\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Winter\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 - 176 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile2\Spring\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end end elseif PopProfilefinal == 3 if PopSeasonfinal == 1 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Summer\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end - 177 - Master Thesis elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Autumn\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 - 178 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Winter\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputmonday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputtuesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputwednesday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputthursday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputfriday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsaturday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\Profile3\Spring\outputsunday.xls','Sheet1','A2:D26'); raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}; end end end %% Replace non-numeric cells with NaN R = cellfun(@(x) ~isnumeric(x) && ~islogical(x),raw); % Find non-numeric cells raw(R) = {NaN}; % Replace non-numeric cells %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Time = data(:,1); OTP = data(:,2); DCR = data(:,3); Cost = data(:,4); %% Clear temporary variables clearvars data raw R; %% Solar Part if PopSeasonfinal == 1 if Popdayfinal == 1 - 179 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Summer\outputmonday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Summer\outputtuesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Summer\outputwednesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Summer\outputthursday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Summer\outputfriday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Summer\outputsaturday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Summer\outputsunday.xls','Sheet1','A2:C25'); end elseif PopSeasonfinal == 2 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Autumn\outputmonday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Autumn\outputtuesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Autumn\outputwednesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Autumn\outputthursday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Autumn\outputfriday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Autumn\outputsaturday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Autumn\outputsunday.xls','Sheet1','A2:C25'); end elseif PopSeasonfinal == 3 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Winter\outputmonday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Winter\outputtuesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Winter\outputwednesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 4 - 180 - Master Thesis [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Winter\outputthursday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Winter\outputfriday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Winter\outputsaturday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Winter\outputsunday.xls','Sheet1','A2:C25'); end elseif PopSeasonfinal == 4 if Popdayfinal == 1 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Spring\outputmonday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 2 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Spring\outputtuesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 3 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Spring\outputwednesday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 4 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Spring\outputthursday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 5 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Spring\outputfriday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 6 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Spring\outputsaturday.xls','Sheet1','A2:C25'); elseif Popdayfinal == 7 [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Spring\outputsunday.xls','Sheet1','A2:C25'); end end %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names PlaneofArrayIrradianceWm1 = data(:,1); DCArrayOutputW1 = data(:,2); ACSystemOutputW1 = data(:,3); %% Clear temporary variables clearvars data raw; %% - 181 - Master Thesis C. Customer Web App <!DOCTYPE html> <meta charset="utf-8"> <head> <title>Charge On !</title> </head> <style> body { font: 12px sans-serif; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .bar { fill: orange; } .bar:hover { fill: orangered ; } .x.axis path { display: none; } .d3-tip { line-height: 1; font-weight: bold; padding: 12px; background: rgba(0, 0, 0, 0.8); color: #fff; border-radius: 2px; } /* Creates a small triangle extender for the tooltip */ .d3-tip:after { box-sizing: border-box; display: inline; font-size: 10px; width: 100%; line-height: 1; color: rgba(0, 0, 0, 0.8); content: "\25BC"; position: absolute; text-align: center; - 182 - Master Thesis } /* Style northward tooltips differently */ .d3-tip.n:after { margin: -1px 0 0 0; top: 100%; left: 0; } header { display: block; background: #FAFAFA; float: left;width: 100%} article, aside, details, figcaption, figure, footer,header, hgroup, menu, nav, section { display: block; } .headerText { width: 80%; text-align: center; vertical-align: middle; height: 100px; font-size: 7em; color: #9A0003; float: left;} .logo {float: left;} #resultDiv {float: right;margin-right: 200px;margin-top: 2%;} #titleResult {text-align: center;} body {background: #EAEAEA;} </style> <body> <header> <a href="/" class="logo"><img width="100px" height="100px" src="images/chargeon.jpg" alt="Company Name"></a> <span class="headerText">Charge On !</span> </header> <section> <label>Enter Profile</label> <select id="profile" name="profile"> <option value="Profile1" selected="selected">Profile1</option> <option value="Profile2">Profile2</option> <option value="Profile3">Profile3</option> </select> <label>Enter Season</label> <select id="season" name="season"> <option value="Summer" selected="selected">Summer</option> <option value="Autumn">Autumn</option> <option value="Winter">Winter</option> <option value="Spring">Spring</option> </select> - 183 - Master Thesis <label>Enter Day</label> <select id="day" name="day"> <option value="monday" selected="selected">Monday</option> <option value="tuesday">Tuesday</option> <option value="wednesday">Wednesday</option> <option value="thursday">Thursday</option> <option value="friday">Friday</option> <option value="saturday">Saturday</option> <option value="sunday">Sunday</option> </select> <label>Enter Field</label> <select id="field" name="field"> <option value="otp" selected="selected">OTP</option> <option value="solar_power">Solar Power</option> <option value="charging_cost">Charging Cost</option> <option value="dcr">DCR</option> </select> <label>Enter Time</label> <input name="time" id="time" placeholder="Enter time"></input> </select> <button name="submit_day_field" onclick="loadBarGraph()">Enter</button> <div id="resultDiv"> <h2 id="titleResult"></h2> <img alt="Result charge image" id="imgResult" width="200px" height="200px"> </div> <!-- <label>Enter Time</label> <input type="text" id="time" name="time" placeholder="Time"> <button name="submit_time">Predict</button> --> </section> <script src="js/d3.v3.4.8.js"></script> <script src="js/d3.tip.v0.6.3.js"></script> <script> var margin = {top: 40, right: 20, bottom: 30, left: 100}, width = 760 - margin.left - margin.right, height = 300 - margin.top - margin.bottom; var formatPercent = d3.format(""); var x = d3.scale.ordinal() .rangeRoundBands([0, width], .1); var y = d3.scale.linear() .range([height, 0]); var xAxis = d3.svg.axis() .scale(x) .orient("bottom"); - 184 - Master Thesis var yAxis = d3.svg.axis() .scale(y) .orient("left") .tickFormat(formatPercent); var tip = d3.tip() .attr('class', 'd3-tip') .offset([-10, 0]) .html(function(d) { return "<strong>OTP:</strong> <span style='color:red'>" + d.OTP + "</span>"; }) function loadBarGraph () { var elem = document.getElementsByTagName("svg")[0]; if(elem != undefined) { elem.parentNode.removeChild(elem); } var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); svg.call(tip); var profileElem = document.getElementById("profile"); var profileValue = profileElem.options[profileElem.selectedIndex].value; var seasonElem = document.getElementById("season"); var seasonValue = seasonElem.options[seasonElem.selectedIndex].value; var dayElem = document.getElementById("day"); var dayValue = dayElem.options[dayElem.selectedIndex].value; var fieldElem = document.getElementById("field"); var fieldValue = fieldElem.options[fieldElem.selectedIndex].value var timeElem = document.getElementById("time"); var timeValue = timeElem.value; var fileName = 'data/' + profileValue + '/' + seasonValue + '/output' + dayValue + '.csv'; d3.csv(fileName, type, function(error, data) { var timeValueToCheck = undefined; var titleText = ''; var imageName = ''; if(isNaN(timeValue)) { alert("Please enter only number !"); return; } else if(data.length < timeValue) { alert("Invalid time !"); return; } else if(timeValue != undefined && timeValue != ''){ timeValueToCheck = data[timeValue-1].OTP; - 185 - Master Thesis console.log(timeValueToCheck) if(timeValueToCheck > 99999) { titleText = 'Emergency'; imageName = 'stop.jpg'; //alert('Emergence'); // Show stop.jpg } else if(timeValueToCheck > 6.5) { titleText = 'Charge'; imageName = 'EV_Green.jpg'; //alert('Charge'); // Show EV_Green.jpg } else if(timeValueToCheck > 3.5) { titleText = 'Hold'; imageName = 'EV_Yellow.jpg'; //alert('Hold'); // Show EV_Yellow.jpg } else { titleText = 'Do not charge'; imageName = 'EV_Red.jpg'; //alert('Do not charge'); // Show EV_Red.jpg } // Set the title and image in the result div var imagePath = 'images/'; document.getElementById('titleResult').innerHTML = titleText; document.getElementById('imgResult').src = imagePath + imageName; } x.domain(data.map(function(d) { return d.Time; })); y.domain([0, d3.max(data, function(d) { return d.OTP; })]); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + height + ")") .call(xAxis) .append("text") .attr("transform", "rotate(0)") .attr("x", 35) .attr("y", 30) .attr("dx", ".71em") .style("text-anchor", "end") .text("Time"); svg.append("g") .attr("class", "y axis") .call(yAxis) .append("text") .attr("transform", "rotate(-90)") .attr("y", -30) .attr("dy", ".71em") .style("text-anchor", "end") .text("OTP"); svg.selectAll(".bar") .data(data) .enter().append("rect") - 186 - Master Thesis .attr("class", "bar") .attr("x", function(d) { return x(d.Time); }) .attr("width", x.rangeBand()) .attr("y", function(d) { return y(d.OTP); }) .attr("height", function(d) { return height - y(d.OTP); }) .on('mouseover', tip.show) .on('mouseout', tip.hide) }); } function type(d) { d.OTP = +d.OTP; return d; } </script> </body> - 187 - Master Thesis D. Solar Power Extraction Code Matlab Code for extracting selected information from data received from NREL. %% Import the data prompt = 'Enter Season:'; daycheck = input(prompt,'s'); z1 = 'Summer'; z2 = 'Autumn'; z3 = 'Winter'; z4 = 'Spring'; zc1 = strcmp(daycheck,z1); zc2 = strcmp(daycheck,z2); zc3 = strcmp(daycheck,z3); zc4 = strcmp(daycheck,z4); if zc1 == 1 display ('Its Summer') [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Code\Summer_30th&Orchard_week1.xlsx','Sheet1','B2:K169'); %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Month1 = data(:,1); DayID = data(:,2); Hour1 = data(:,3); BeamIrradianceWm2 = data(:,4); DiffuseIrradianceWm2 = data(:,5); AmbientTemperatureC = data(:,6); PlaneofArrayIrradianceWm2 = data(:,7); CellTemperatureC = data(:,8); DCArrayOutputW = data(:,9); ACSystemOutputW = data(:,10); %% Clear temporary variables clearvars data raw; elseif zc2 == 1 display ('Its Autumn') [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Code\Autumn_30th&Orchard_week1.xlsx','Sheet1','B2:K169'); %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Month1 = data(:,1); DayID = data(:,2); Hour1 = data(:,3); - 188 - Master Thesis BeamIrradianceWm2 = data(:,4); DiffuseIrradianceWm2 = data(:,5); AmbientTemperatureC = data(:,6); PlaneofArrayIrradianceWm2 = data(:,7); CellTemperatureC = data(:,8); DCArrayOutputW = data(:,9); ACSystemOutputW = data(:,10); %% Clear temporary variables clearvars data raw; elseif zc2 == 3 display ('Its Winter') [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Code\Winter_30th&Orchard_week1.xlsx','Sheet1','B2:K169'); %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Month1 = data(:,1); DayID = data(:,2); Hour1 = data(:,3); BeamIrradianceWm2 = data(:,4); DiffuseIrradianceWm2 = data(:,5); AmbientTemperatureC = data(:,6); PlaneofArrayIrradianceWm2 = data(:,7); CellTemperatureC = data(:,8); DCArrayOutputW = data(:,9); ACSystemOutputW = data(:,10); %% Clear temporary variables clearvars data raw; elseif zc4 == 1 display ('Its Spring') [~, ~, raw] = xlsread('D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\Code\Spring_30th&Orchard_week1.xlsx','Sheet1','B2:K169'); %% Create output variable data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names Month1 = data(:,1); DayID = data(:,2); Hour1 = data(:,3); BeamIrradianceWm2 = data(:,4); DiffuseIrradianceWm2 = data(:,5); AmbientTemperatureC = data(:,6); PlaneofArrayIrradianceWm2 = data(:,7); CellTemperatureC = data(:,8); DCArrayOutputW = data(:,9); ACSystemOutputW = data(:,10); %% Clear temporary variables clearvars data raw; end - 189 - Master Thesis %% figure(01) subplot(2,2,1) bar(BeamIrradianceWm2) xlabel('Time (0-24)'); ylabel('Irradiance (W/m2)'); grid on; figure(01) subplot(2,2,2) plot(AmbientTemperatureC) xlabel('Time (0-24)'); ylabel('Temperature(C)'); grid on; figure(01) subplot(2,2,3) bar(DCArrayOutputW) xlabel('Time (0-24)'); ylabel('DC Output(W)'); grid on; figure(01) subplot(2,2,4) bar(ACSystemOutputW) xlabel('Time (0-24)'); ylabel('AC Output(W)'); grid on; prompt = 'Enter day:'; daycheck = input(prompt,'s'); d1 = 'Monday'; d2 = 'Tuesday'; d3 = 'Wednesday'; d4 = 'Thursday'; d5 = 'Friday'; d6 = 'Saturday'; d7 = 'Sunday'; dc1 = strcmp(daycheck,d1); dc2 = strcmp(daycheck,d2); dc3 = strcmp(daycheck,d3); dc4 = strcmp(daycheck,d4); dc5 = strcmp(daycheck,d5); dc6 = strcmp(daycheck,d6); dc7 = strcmp(daycheck,d7); if dc1 == 1 display ('Its Monday') TwentyFourPlaneofArrayIrradianceWm2 = ones(1,24); for n = 1:24 TwentyFourPlaneofArrayIrradianceWm2(n) = PlaneofArrayIrradianceWm2(n) ; - 190 - Master Thesis end TwentyFourACSystemOutputW = ones(1,24); for n = 1:24 TwentyFourACSystemOutputW(n) = ACSystemOutputW(n) ; end TwentyFourDCArrayOutputW = ones(1,24); for n = 1:24 TwentyFourDCArrayOutputW(n) = DCArrayOutputW(n) ; end elseif dc2 == 1 display ('Its Tuesday') TwentyFourPlaneofArrayIrradianceWm2 = ones(1,24); for n = 1:24 TwentyFourPlaneofArrayIrradianceWm2(n) = PlaneofArrayIrradianceWm2(n+24) ; end TwentyFourACSystemOutputW = ones(1,24); for n = 1:24 TwentyFourACSystemOutputW(n) = ACSystemOutputW(n+24) ; end TwentyFourDCArrayOutputW = ones(1,24); for n = 1:24 TwentyFourDCArrayOutputW(n) = DCArrayOutputW(n+24) ; end elseif dc3 == 1 display ('Its Wednesday') TwentyFourPlaneofArrayIrradianceWm2 = ones(1,24); for n = 1:24 TwentyFourPlaneofArrayIrradianceWm2(n) = PlaneofArrayIrradianceWm2(n+48) ; end TwentyFourACSystemOutputW = ones(1,24); for n = 1:24 TwentyFourACSystemOutputW(n) = ACSystemOutputW(n+48) ; end TwentyFourDCArrayOutputW = ones(1,24); for n = 1:24 TwentyFourDCArrayOutputW(n) = DCArrayOutputW(n+48) ; end elseif dc4 == 1 display ('Its Thursday') TwentyFourPlaneofArrayIrradianceWm2 = ones(1,24); for n = 1:24 TwentyFourPlaneofArrayIrradianceWm2(n) = PlaneofArrayIrradianceWm2(n+72) ; end TwentyFourACSystemOutputW = ones(1,24); for n = 1:24 TwentyFourACSystemOutputW(n) = ACSystemOutputW(n+72) ; end TwentyFourDCArrayOutputW = ones(1,24); for n = 1:24 TwentyFourDCArrayOutputW(n) = DCArrayOutputW(n+72) ; end - 191 - Master Thesis elseif dc5 == 1 display ('Its Friday') TwentyFourPlaneofArrayIrradianceWm2 = ones(1,24); for n = 1:24 TwentyFourPlaneofArrayIrradianceWm2(n) = PlaneofArrayIrradianceWm2(n+96) ; end TwentyFourACSystemOutputW = ones(1,24); for n = 1:24 TwentyFourACSystemOutputW(n) = ACSystemOutputW(n+96) ; end TwentyFourDCArrayOutputW = ones(1,24); for n = 1:24 TwentyFourDCArrayOutputW(n) = DCArrayOutputW(n+96) ; end elseif dc6 == 1 display ('Its Saturday') TwentyFourPlaneofArrayIrradianceWm2 = ones(1,24); for n = 1:24 TwentyFourPlaneofArrayIrradianceWm2(n) = PlaneofArrayIrradianceWm2(n+120) ; end TwentyFourACSystemOutputW = ones(1,24); for n = 1:24 TwentyFourACSystemOutputW(n) = ACSystemOutputW(n+120) ; end TwentyFourDCArrayOutputW = ones(1,24); for n = 1:24 TwentyFourDCArrayOutputW(n) = DCArrayOutputW(n+120) ; end elseif dc7 == 1 display ('Its Sunday') TwentyFourPlaneofArrayIrradianceWm2 = ones(1,24); for n = 1:24 TwentyFourPlaneofArrayIrradianceWm2(n) = PlaneofArrayIrradianceWm2(n+144) ; end TwentyFourACSystemOutputW = ones(1,24); for n = 1:24 TwentyFourACSystemOutputW(n) = ACSystemOutputW(n+144) ; end TwentyFourDCArrayOutputW = ones(1,24); for n = 1:24 TwentyFourDCArrayOutputW(n) = DCArrayOutputW(n+144) ; end end %% Export data % Create output array to export PlaneofArrayIrradianceWm2output = [TwentyFourPlaneofArrayIrradianceWm2(1) TwentyFourDCArrayOutputW(1) TwentyFourACSystemOutputW(1);TwentyFourPlaneofArrayIrradianceWm2(2) TwentyFourDCArrayOutputW(2) TwentyFourACSystemOutputW(2);TwentyFourPlaneofArrayIrradianceWm2(3) TwentyFourDCArrayOutputW(3) - 192 - Master Thesis TwentyFourACSystemOutputW(3);TwentyFourPlaneofArrayIrradianceWm2(4) TwentyFourDCArrayOutputW(4) TwentyFourACSystemOutputW(4);TwentyFourPlaneofArrayIrradianceWm2(5) TwentyFourDCArrayOutputW(5) TwentyFourACSystemOutputW(5);TwentyFourPlaneofArrayIrradianceWm2(6) TwentyFourDCArrayOutputW(6) TwentyFourACSystemOutputW(6);TwentyFourPlaneofArrayIrradianceWm2(7) TwentyFourDCArrayOutputW(7) TwentyFourACSystemOutputW(7);TwentyFourPlaneofArrayIrradianceWm2(8) TwentyFourDCArrayOutputW(8) TwentyFourACSystemOutputW(8);TwentyFourPlaneofArrayIrradianceWm2(9) TwentyFourDCArrayOutputW(9) TwentyFourACSystemOutputW(9);TwentyFourPlaneofArrayIrradianceWm2(10) TwentyFourDCArrayOutputW(10) TwentyFourACSystemOutputW(10);TwentyFourPlaneofArrayIrradianceWm2(11) TwentyFourDCArrayOutputW(11) TwentyFourACSystemOutputW(11);TwentyFourPlaneofArrayIrradianceWm2(12) TwentyFourDCArrayOutputW(12) TwentyFourACSystemOutputW(12);TwentyFourPlaneofArrayIrradianceWm2(13) TwentyFourDCArrayOutputW(13) TwentyFourACSystemOutputW(13);TwentyFourPlaneofArrayIrradianceWm2(14) TwentyFourDCArrayOutputW(14) TwentyFourACSystemOutputW(14);TwentyFourPlaneofArrayIrradianceWm2(15) TwentyFourDCArrayOutputW(15) TwentyFourACSystemOutputW(15);TwentyFourPlaneofArrayIrradianceWm2(16) TwentyFourDCArrayOutputW(16) TwentyFourACSystemOutputW(16);TwentyFourPlaneofArrayIrradianceWm2(17) TwentyFourDCArrayOutputW(17) TwentyFourACSystemOutputW(17);TwentyFourPlaneofArrayIrradianceWm2(18) TwentyFourDCArrayOutputW(18) TwentyFourACSystemOutputW(18);TwentyFourPlaneofArrayIrradianceWm2(19) TwentyFourDCArrayOutputW(19) TwentyFourACSystemOutputW(19);TwentyFourPlaneofArrayIrradianceWm2(20) TwentyFourDCArrayOutputW(20) TwentyFourACSystemOutputW(20);TwentyFourPlaneofArrayIrradianceWm2(21) TwentyFourDCArrayOutputW(21) TwentyFourACSystemOutputW(21);TwentyFourPlaneofArrayIrradianceWm2(22) TwentyFourDCArrayOutputW(22) TwentyFourACSystemOutputW(22);TwentyFourPlaneofArrayIrradianceWm2(23) TwentyFourDCArrayOutputW(23) TwentyFourACSystemOutputW(23);TwentyFourPlaneofArrayIrradianceWm2(24) TwentyFourDCArrayOutputW(24) TwentyFourACSystemOutputW(24)]; filepath = 'D:\Thesis_Last Month\MatlabCodes\Customer\SolarPower\'; if zc1 == 1 season = 'Summer\'; elseif zc2 == 1 season = 'Autumn\'; elseif zc3 == 1 season = 'Winter\'; elseif zc4 == 1 season = 'Spring\'; end - 193 - Master Thesis if dc1 == 1 day = 'outputmonday'; elseif dc2 == 1 day = 'outputtuesday'; elseif dc3 == 1 day = 'outputwednesday'; elseif dc4 == 1 day = 'outputthursday'; elseif dc5 == 1 day = 'outputfriday'; elseif dc6 == 1 day = 'outputsaturday'; elseif dc7 == 1 day = 'outputsunday'; end filepath_xls_final = sprintf('%s%s%s%s.xls', filepath, season, day); header ={'PlaneofArrayIrradianceWm2','DCArrayOutputW','ACSystemOutputW'}; % header locations xlswrite(fullfile(filepath_xls_final),header,'Sheet1') % offset location for values considering headers xlswrite(fullfile(filepath_xls_final),PlaneofArrayIrradianceWm2output,'Sheet1','A2') %% figure(01) subplot(2,2,1) bar(BeamIrradianceWm2) xlabel('Time (0-24)'); ylabel('Irradiance (W/m2)'); grid on; figure(01) subplot(2,2,2) plot(AmbientTemperatureC) xlabel('Time (0-24)'); ylabel('Temperature(C)'); grid on; figure(01) subplot(2,2,3) bar(DCArrayOutputW) xlabel('Time (0-24)'); ylabel('DC Output(W)'); grid on; figure(01) subplot(2,2,4) bar(ACSystemOutputW) xlabel('Time (0-24)'); ylabel('AC Output(W)'); grid on; - 194 - Master Thesis figure(02) subplot(2,2,1) plot(TwentyFourPlaneofArrayIrradianceWm2) xlabel('Time (0-24)'); ylabel('Irradiance (W/m2)'); grid on; figure(02) subplot(2,2,2) bar(TwentyFourDCArrayOutputW) xlabel('Time (0-24)'); ylabel('DC Output(W)'); grid on; figure(02) subplot(2,2,3) bar(TwentyFourACSystemOutputW) xlabel('Time (0-24)'); ylabel('AC Output(W)'); grid on;
Abstract (if available)
Abstract
As the transportation industry gears up for a positive transformation towards the introduction of electric vehicles and associated systems, the larger implications of this transformation needs to be studied. The introduction of electric vehicles would cause a ripple effect in multiple industries. The utility needs to be able to support this change, as it would have to potentially provide the power that will drive this change. There have been major developments in the power grid as well with respect to adopting improving technologies. Smart systems are being put in place, which help us to regulate and channelize the flow of power to better suit our needs. Due to the massive scale of the grid, the changes might take a longer time duration to come to effect. When these systems are in place, much like how we are connected across distances through internet we would have the capabilities to connect to multiple objects and devices for different purposes and solutions. However, just being connected does not provide solutions, rather an intelligent protocol of communication leads to better solutions. The introduction of EVs might have adverse effects on the power grid if the charging cycles for these EVs is not regulated. The power grid faces different demands and actual grid loads throughout the day, but they do follow a common pattern. If the power demand is plotted on a curve, we can observe peaks and lows, which repeat over time. This information can be utilized to direct the power that would be utilized for charging EVs. With the introduction of distributed power generation system, individual homeowners can have solar panel installations and provide power sufficient for their usage as well as source it to the grid. This brings into account a dynamic factor, which needs to be accounted for when the grid plans the dispatch of power to customers. Now it is easy to notice the number of nodes and systems that are in play in such a setup. The key to have all these systems function well together is a strong link of communication. A step ahead of setting up a communication channel in between the systems is to automate the entire setup. That would truly help us to utilize the resources at hand to their complete capabilities. Through this thesis, I intend to propose a system that would attempt to provide a solution for this communicating in between these intelligent distributed systems. To implement this system on a large scale the method to compute and communicate needs to be as simplistic as possible. Such a simplistic method would not be limited by the operating platform or the hardware in use. This is the central idea upon which the entire system is based upon. A simple, multi-platform, easy-to-use interface that can be scaled up in quick time and be equally efficient in delivering the desired output. The modularity of the systems allows the integration of multiple sub-systems like EVs, distributed power generation as well as distributed energy storage.
Linked assets
University of Southern California Dissertations and Theses
Conceptually similar
PDF
Distribution system reliability analysis for smart grid applications
PDF
Electric vehicle integration into the distribution grid: impact, control and forecast
PDF
System stability effect of large scale of EV and renewable energy deployment
PDF
The dynamic interaction of synchronous condensers, SVC, STATCOM and superconducting magnetic energy storage on electric vehicles
PDF
USC microgrid assessment study
PDF
An adaptive distance protection scheme for power systems with SFCL
PDF
Environmental effects from a large-scale adoption of electric vehicle technology in the City of Los Angeles
PDF
Reinforcement learning in hybrid electric vehicles (HEVs) / electric vehicles (EVs)
PDF
Demand response management in smart grid from distributed optimization perspective
PDF
Smart buildings: employing modern technology to create an integrated, data-driven, intelligent, self-optimizing, human-centered, building automation system
PDF
Data-driven aggregated fractal dynamic load modeling for early warning of voltage collapse
PDF
High-performance distributed computing techniques for wireless IoT and connected vehicle systems
PDF
USC microgrid development conceptual plan
PDF
Predictive real-time assessment for power grid monitoring and situational awareness using synchrophasors with partial PMU observability
PDF
Integration of energy-efficient infrastructures and policies in smart grid
PDF
Curvature analysis of the power grid: congestion, congestion management, and line tripping cascade anticipation
PDF
A function-based methodology for evaluating resilience in smart grids
PDF
A joint framework of design, control, and applications of energy generation and energy storage systems
PDF
Optimization strategies for robustness and fairness
PDF
Computationally efficient design of optimal strategies for passive and semiactive damping devices in smart structures
Asset Metadata
Creator
Manjrekar, Tanay
(author)
Core Title
Utility – customer interface strategy and user application for electric vehicles and distributed generation management
School
Viterbi School of Engineering
Degree
Master of Science
Degree Program
Electrical Engineering
Publication Date
04/25/2016
Defense Date
03/24/2016
Publisher
University of Southern California
(original),
University of Southern California. Libraries
(digital)
Tag
autonomous EV charging,distributed energy integration,distributed generation management,Electric vehicles,OAI-PMH Harvest,smart EV charging,user application for electric vehicles
Format
application/pdf
(imt)
Language
English
Contributor
Electronically uploaded by the author
(provenance)
Advisor
Beshir, Mohammed (
committee chair
), Jonckheere, Edmond (
committee member
), Maby, Edward (
committee member
)
Creator Email
tanaymanjrekar@gmail.com,tmanjrek@usc.edu
Permanent Link (DOI)
https://doi.org/10.25549/usctheses-c40-242460
Unique identifier
UC11278883
Identifier
etd-ManjrekarT-4371.pdf (filename),usctheses-c40-242460 (legacy record id)
Legacy Identifier
etd-ManjrekarT-4371.pdf
Dmrecord
242460
Document Type
Thesis
Format
application/pdf (imt)
Rights
Manjrekar, Tanay
Type
texts
Source
University of Southern California
(contributing entity),
University of Southern California Dissertations and Theses
(collection)
Access Conditions
The author retains rights to his/her dissertation, thesis or other graduate work according to U.S. copyright law. Electronic access is being provided by the USC Libraries in agreement with the a...
Repository Name
University of Southern California Digital Library
Repository Location
USC Digital Library, University of Southern California, University Park Campus MC 2810, 3434 South Grand Avenue, 2nd Floor, Los Angeles, California 90089-2810, USA
Tags
autonomous EV charging
distributed energy integration
distributed generation management
smart EV charging
user application for electric vehicles