-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
341 lines (326 loc) · 16.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE html>
<html>
<head>
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href="https://www.w3schools.com/lib/w3.css" rel="stylesheet">
<script src="lib/jquery-3.1.1.min.js"></script>
<script src="lib/jquery.csv.js"></script>
<script src="wind/windPower.js" type="text/javascript"></script>
<script src="hydro/hydroPower.js" type="text/javascript"></script>
<script src="tidal/tidePower.js" type="text/javascript"></script>
<script src="data/dataReading.js" type="text/javascript"></script>
<script src="data/renewableCalc.js" type="text/javascript"></script>
<style>
#map {
height: 100%;
width: 70%;
}
#mapandbest {
height: 48%;
}
#page1 {
height: 150vh;
}
page2 {
height: 100vh;
}
#placetitle {
text-align: center;
}
#potentialenergyyearly {
border-radius: 25px;
background: #33cc33;
color: white;
font-size: xx-large;
padding: 20px;
width: auto;
height: 90px;
display: inline-block;
}
#satellitepic {
display: block;
margin: auto;
}
#title {
color: forestgreen;
}
#motto {
float: right;
vertical-align: bottom;
line-height: 150px;
}
#logoimg {
float: left;
}
#datasources {
padding: 30px;
font-size: 15px;
}
</style>
<title>EcoOptimiser</title>
</head>
<body>
<header>
<div class="w3-panel">
<img id="logoimg" src="images/logo.png">
<h2 id="motto">Finding the optimal locations for renewable energy</h2>
</div>
<div class="w3-bar w3-green">
<a class="w3-bar-item w3-button" onclick="loadMaps()">Map</a>
<a class="w3-bar-item w3-button" onclick="loadJustification()">Justification</a>
</div>
</header>
<div class="w3-panel" id="page1">
<div class="w3-cell-row" id="mapandbest">
<div class="w3-cell w3-panel w3-border" id="map"></div>
<div class="w3-cell w3-panel w3-border">
<h3>Optimal Locations for:</h3>
<div class="w3-cell-row">
<div class="w3-cell">
<button class="w3-button w3-hover-green w3-white w3-border w3-border-green w3-round-large" id="button0" onclick="changeButton(0,'green')">Wind</button>
</div>
<div class="w3-cell">
<div class="w3-cell w3-centre">
<button class="w3-button w3-hover-blue w3-white w3-border w3-border-blue w3-round-large" id="button1" onclick="changeButton(1,'blue')">Hydro-Electric</button>
</div>
</div>
<div class="w3-cell">
<button class="w3-cell w3-button w3-white w3-hover-grey w3-border w3-border-grey w3-round-large" id="button2" onclick="changeButton(2,'grey')">Tidal</button>
</div>
</div>
<div class="w3-panel" id="enList0" style="display:none">
<ul class="w3-ul">
<li class="w3-green">
<h4>Best Wind Locations</h4>
</li>
<li class="w3-hover-green" id="windLoc1" onclick="scrollTo('wind',1)"></li>
<li class="w3-hover-green" id="windLoc2" onclick="scrollTo('wind',2)"></li>
<li class="w3-hover-green" id="windLoc3" onclick="scrollTo('wind',3)"></li>
</ul>
</div>
<div class="w3-panel" id="enList1" style="display:none">
<ul class="w3-ul">
<li class="w3-blue">
<h4>Best Hydro-Electric Locations</h4>
</li>
<li class="w3-hover-blue" id="hydroLoc1" onclick="scrollTo('hydro',1)"></li>
<li class="w3-hover-blue" id="hydroLoc2" onclick="scrollTo('hydro',2)"></li>
<li class="w3-hover-blue" id="hydroLoc3" onclick="scrollTo('hydro',3)"></li>
</ul>
</div>
<div class="w3-panel" id="enList2" style="display:none">
<ul class="w3-ul">
<li class="w3-grey">
<h4>Best Tidal Locations</h4>
</li>
<li class="w3-hover-grey" id="tidalLoc1" onclick="scrollTo('tidal',1)"></li>
<li class="w3-hover-grey" id="tidalLoc2" onclick="scrollTo('tidal',2)"></li>
<li class="w3-hover-grey" id="tidalLoc3" onclick="scrollTo('tidal',3)"></li>
</ul>
</div>
</div>
</div>
</div>
<div class="w3-container" id="page2">
<h1 id="placetitle"></h1>
<table class="w3-table">
<tr>
<td width="40%"><p id="potentialenergyyearly"></p></td>
<td width="60%"><p id="potentialenergytext" style="padding-top: 8vh"></p></td>
</tr>
<tr>
<td><img id="houseIcon" src="images/house.jpg" style="height: 25vh"></td>
<td><p id="energyInHouses" style="padding-top: 12vh"></p></td>
</tr>
<tr>
<td><img id="oilIcon" src="images/oil.jpg"></td>
<td><p id="energyInOil" style="padding-top: 9vh"></p></td>
</tr>
</table>
<div class="w3-cell-row">
<div class="w3-cell>">
<img id="satellitepic" class="w3-image w3-panel">
</div>
<div class="w3-cell">
<p id="datasources"></p>
</div>
</div>
</div>
<div class="w3-panel" style="display:none" id="justification">
<h3>Wind</h3>
<h4>Data Sources</h4>
<p>Click <a href="http://windeis.anl.gov/guide/basics/">here</a> to go to the rensmart website, this is where all wind data was collected from for the United Kingdom. <a href="http://www.rensmart.com/Weather/WindArchive#monthlyLayer">Reuk.co.uk</a> was also used to calculate an estimate for the amount of energy produced in a year by an industrial size wind turbine at the location specified. The Wind Energy Development Programmatic was also used to determine the optimal conditions for wind power to produce a sufficient amount of energy.
</p>
<h4>Calculations</h4>
<p>
To predict the total amount of energy in a year a single wind turbine at the location specified, the following constants and assumptions were used from national averages:
<br>
<br>
Size: Large (Industrial)<br>
Diameter of rotation: 60 metres<br>
Industrial size blade<br>
Cut in speed: 5 metres per second<br>
Cut out speed: 14 metres per second<br>
Cost of Turbine: £2-3.3 million<br>
Efficiency: 30%
</p>
<h3>Hydro</h3>
<h4>Data Sources</h4>
<p>
Click <a href="http://nrfa.ceh.ac.uk/data/search">here</a> to go to the National River Flow Archive (NRFA) website, this is where all river flow data was collected from for the United Kingdom. The longitude and latitude of the locations are not available therefor the grid reference variable for each record were used to calculate the longitude and latitude. The NRFA website also sourced the method for determining whether a river was viable for a hydroelectric dam to be constructed upon it. <a href="http://www.reuk.co.uk/wordpress/hydro/calculation-of-hydro-power">Reuk.co.uk</a> provided a formula to estimate the total energy produced in a year by a hydroelectric dam on a river at the specified location.
</p>
<h4>Calculations</h4>
<p>
To predict the total amount of energy in a year a hydroelectric dam could produce at the location specified, the following constants and assumptions were used from national averages:
<br><br>
Energy Per Year (KWh) = E * R * H * g * 60 * 60 * 24 * 365
<br><br>
E = Efficiency = 80%<br>
R = River Flow<br>
H = Falling Height = 50m<br>
g = Accelration Due to Gravity = 9.81 m/s^2<br>
<br>
</p>
<h3>Tidal</h3>
<h4>Data Sources</h4>
<p>
Click <a href="http://www.ceda.ac.uk">here</a> to go to the Centre of Environmental Data Analysis (CEDA), this is where all tidal data was collected from for the United Kingdom. You cannot view the data used unless you request access from CEDA for specific data. <a href="https://en.wikipedia.org/wiki/Tidal_barrage">Wikipedia</a> has a very descriptive and technical article on how to harness tidal power, it also provides the a formula to estimate the amount of energy produced by a tidal barrage.
</p>
<h4>Calculations</h4>
<p>
To predict the total amount of energy in a year a tidal barrage could produce at the location specified, the following constants and assumptions were used from national averages:
<br><br>
Energy Per Year (KWh) = 0.5 * A * p * g * h^2 * E
<br><br>
A = Horizontal area of basin = 1000m^2<br>
p = Density of sea water = 1025 kg/m^3<br>
g = Acceleration due to gravity = 9.81 m/s^2<br>
h = Vertical tidal range<br>
E = Efficiency<br>
<br>
</p>
</div>
<script>
var markers = [];
var buttonStatus = [0,0,0]
var map;
var bestWindLocations = [];
var bestTidalLocations = [];
var bestHydroLocations = [];
function initMap() {
var uk = {lat: 56.000, lng: -2.5478};
map = new google.maps.Map(document.getElementById('map'), {
zoom: 5,
center: uk
});
$(document).ready(function() {
$.ajax({
type: "GET",
url: "https://raw.githubusercontent.com/lun3x/EcoOptimiser/master/wind/windData.csv",
dataType: "text",
success: function(data) {
var windData = processData(data);
markers[0] = initWindPower(map, windData);
setMapOnAll(null,markers[0]);
bestWindLocations = getBestWindLocations(windData);
}
});
$.ajax({
type: "GET",
url: "https://raw.githubusercontent.com/lun3x/EcoOptimiser/master/hydro/hydroData.csv",
dataType: "text",
success: function(data) {
var hydroData = processData(data);
markers[1] = initHydroPower(map, hydroData);
setMapOnAll(null,markers[1]);
bestHydroLocations = getBestHydroLocations(hydroData);
}
});
$.ajax({
type: "GET",
url: "https://raw.githubusercontent.com/lun3x/EcoOptimiser/master/tidal/tideData.csv",
dataType: "text",
success: function(data) {
var tideData = processData(data);
markers[2] = initTidalPower(map, tideData);
setMapOnAll(null,markers[2]);
bestTidalLocations = getBestTidalLocations(tideData);
}
});
$.ajax({
type: "GET",
url: "https://raw.githubusercontent.com/lun3x/EcoOptimiser/master/wind/windLocs.csv",
dataType: "text",
success: function(data) {
var windFarmData = processData(data);
markers[3] = initWindFarms(map, windFarmData);
setMapOnAll(null,markers[3]);
}
});
});
document.getElementById('page2').style.display = "none";
}
function changeButton(num, colour){
if (buttonStatus[num] == 0) {
document.getElementById("button"+parseInt(num)).className = "w3-button w3-hover-"+colour+" w3-"+colour+" w3-border w3-border-"+colour+" w3-round-large";
document.getElementById("enList"+parseInt(num)).style.display = "block";
setMapOnAll(map,markers[num]);
if (num == 0) {
setMapOnAll(map,markers[3]);
}
}
else {
document.getElementById("button"+parseInt(num)).className = "w3-button w3-hover-"+colour+" w3-white w3-border w3-border- "+colour+" w3-round-large";
document.getElementById("enList"+parseInt(num)).style.display = "none";
setMapOnAll(null,markers[num]);
if (num == 0) {
setMapOnAll(null,markers[3]);
}
}
buttonStatus[num] = 1 - buttonStatus[num];
}
function setMapOnAll(map, markers) {
for (var i = 0; i < markers.length; i++) {
markers[i].setMap(map);
}
}
function scrollTo(enType, enNum){
var placeName = document.getElementById(enType + "Loc" + enNum).innerHTML;
var enData;
switch (enType) {
case "wind":
enData = bestWindLocations[enNum - 1]; // Take away 1 to get array value
document.getElementById("placetitle").className = "w3-green";
document.getElementById("potentialenergyyearly").className = "w3-green";
break;
case "tidal":
enData = bestTidalLocations[enNum - 1]; // Take away 1 to get array value
document.getElementById("placetitle").className = "w3-grey";
document.getElementById("potentialenergyyearly").className = "w3-grey";
break;
case "hydro":
enData = bestHydroLocations[enNum - 1]; // Take away 1 to get array value
document.getElementById("placetitle").className = "w3-blue";
document.getElementById("potentialenergyyearly").className = "w3-blue";
break;
}
fillInInfoPage(placeName, enType, enData);
document.getElementById('page2').style.display = "block";
$('html, body').animate({
scrollTop: $("#page2").offset().top
}, 750);
}
function loadMaps(){
document.getElementById("page1").style.display = "block";
document.getElementById("page2").style.display = "block";
document.getElementById("justification").style.display = "none";
}
function loadJustification(){
document.getElementById("page1").style.display = "none";
document.getElementById("page2").style.display = "none";
document.getElementById("justification").style.display = "block";
}
</script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCYw6rt-EzukvH3J9ms_Z7uPH9uA-G5TxM&callback=initMap"></script>
</body>
</html>