Operation of the micro-grid trading simulator 1. First the user has to copy a text file (should be named as mg1.txt) in the program folder. This text file contains the hourly generation/demand data of a microgrid (tabseparated values) for one day (i.e. 24 time-steps). Units are assumed as kWh. The data should be in a format like: 80.00 23.00 82.00 22.00 80.00 23.00 81.00 24.00 As an alternate option, the user can simply edit the already available mg1.txt file in the program folder with its own microgrid data. 2. The data is stored in an array ‘mg[0] [48]’. 3. The user is asked for required number of dummy microgrids, say N. on the basis of user input, the program generates N number of array from mg[1] [48], mg[2] [48],… mg[N] [48]. At this moment, program is designed so it could generate up to 1000 microgrids. With little modification in the program, it could generate more. 4. The user is prompted for variability in size of dummy microgrids from the given microgrid: (1-low, 2-medium, 3-high) - If ‘low’: the program generates a random number Vs. (Vs = 0.5~1.5) - If ‘medium’: the program generates a random number Vs (Vs = 0.3~3.0) - If ‘high’: the program generates a random number Vs (Vs = 0.1~10.0) 5. The user is asked if the impact of equipment failure is to be considered: (yes/no) - If ‘yes’: the program generates a number ‘eff’ i.e. either ‘0’ or ‘1’. (eff = 0.0 or eff = 1.0).. The Code has been modified in a way so it does not generate ‘0’ very often. - If ‘no’: the program always takes (eff = 1.0) 6. The user is asked if the intermittence of renewable energy sources is to be considered: (yes/no) - If ‘yes’: the program generates a random number ‘ref’. (ref = 0.7~1.0) - If ‘no’: the program always takes (ref = 1.0) 7. The user is asked for the national grid electricity price in pence/kWh. It is given the name ‘ngsp’. 86 8. The user is asked for the microgrid electricity price in pence/kWh. It is given the name ‘mgsp’. 9. The user is asked if the day/night price plan is to be considered (yes/no). The program folder contains two more files, dnp0.txt and dnp1.txt. These correspond to day/night price plans. - If ‘yes’: the program makes an array ‘dnp[24]’ taking input from dnp1.txt. - If ‘no’: the program makes an array ‘dnp[24]’ taking input from dnp0.txt. 10. Once the program has taken the required data from the user, it will generate values for each dummy microgrid in the mg[N][48] array in the following manner: mg[N][0]=mg[0][0] x vs x eff x ref mg[N][2]=mg[0][2] x vs x eff x ref mg[N][46]=mg[0][46] x vs x eff x ref Supply data of dummy grids mg[N][1]=mg[0][1] x vs mg[N][3]=mg[0][3] x vs Mg[N][47]=mgone[47] x vs Demand data of dummy grids 11. Now after all dummy microgrid arrays have been generated, a two dimensional array is generated which is trade[gn][gh], where gn corresponds to grid number and 87 gh corresponds to hour of the day. It is calculated by taking the difference of demand and supply in each hour in a grid. trade [gn][gh] = (mg[gn][(gh*2)-2])-(mg[gn][(gh*2)-1]) 12. If ‘trade [gn][gh]>0’, its value is added in the available electricity pool (exp) whose initial value is ‘0.0’ in every hour. 13. A random number ‘traderand’ is generated and if (trade[traderand][gh])<0), then the randomly selected grid’s demand shall be met from the pool. If the pool can not satisfy its demand, then its demand will be met from the national grid.