Forecasting
Computing a Weighted Average Wind Speed and Wind Direction Across Multiple Weather Stations
"Often when we are developing weather variables to support day-ahead power and gas forecasting, we introduce wind speed as a standalone explanatory variable or as a contributing term in a wind chill formula. An example of the latter is the following wind chill temperature formula:
Where temperature is in degrees Fahrenheit (oF) and wind speed is in miles per hour (mph).
The above formula is straightforward to compute when you have data from one weather station, but what is the correct wind speed to use in the wind chill formula when the wind speed data are derived from a weighted average of two or more weather stations? It turns out that a simple average of the wind speeds across the weather stations can yield misleading results.
Consider two weather stations: the first station is reporting wind blowing 20 mph with a wind direction of North East (45o) and the second station reports wind blowing 20 mph with a wind direction of North West (315o). A simple average of the two winds speeds is 20 mph. While it is tempting to use the 20 mph as the wind speed for the weighted average of the two stations, it would not accurately represent what is truly happening. Specifically, the 20 mph wind blowing North East would be working against the 20 mph wind blowing North West, leaving a weighted average wind speed of 14.14 mph.
We can extend this idea to wind direction. Let’s say we know that the load impact of storms flowing in from the North West have different signature from storms flowing in from the North East. We would like to use this information by interacting the wind speed variable with a wind direction variable. In the above example, the weighted average wind direction would be 180o (computed as [45o + 315o]/2). In other words, the weighted average wind direction would be due South, which is wrong. In reality, the weighted average wind direction is due North (0o).
How did we derive the true weighted average wind speed and wind direction? Below are the steps to take to compute a weighted average wind speed and wind direction. The calculations will use the wind speed and wind direction data in the following table.
Step 1. Convert Wind Direction in Degrees to Wind Direction in Radians.
The formula for converting wind direction from Degrees to Radians is:
Where, is the numerical constant Pi.
The results of the conversion from Degrees to Radians is shown in the following table.
Step 2. For each station, compute the East-West and North-South Vector
The East-West Vector is computed as:
The North-South Vector is computed as:
Here, the weather stations are indexed by (s) and the time interval is indexed by (i). You would compute the East West and North South Vectors separately for each hour of wind speed and wind direction data.
The result of this step is presented in the following table.
Step 3. Compute a Weighted Sum of the East-West and North-South Vectors
The weighted sum of the East-West Vector is computed as:
The weighted sum of the North-South Vector is computed as:
Where, is the user inputted weather station weight for weather station (s). These calculations assume that the sum of the weather station weights equals 1.0. If not, then the weights need to be normalized to 1.0 prior to this step. In this example, each station is assigned a weight of 25%.
The result of this step is shown below.
Step 4. Compute the Weighted Average Wind Speed
The weighted Average Wind Speed is then computed as:
For this example, the Weighted Average Wind Speed is 10.32.
Step 5. Compute the Weighted Average Wind Direction
The computation of the weighted average wind direction is as follows.
a. First compute the Arctangent given the East-West and North-South Vectors from Step 3 above.
If the NorthSouthVectorWeightedSum is not equal to 0.0 then:
If the NorthSouthVectorWeightedSum = 0.0 then:
This alternative formula controls for possible errors associated with dividing by 0.0. The result of this sub-step is -0.38.
b. Now a correction is made if the North-South Vector Weighted Sum is Negative:
The result of this sub-step is 2.77 Radians.
c. Next the Wind Direction in Radians is converted to Degrees:
The result is a weighted average Wind Direction of 158.44 Degrees."
Kesalahan terjadi ketika Memproses Template.
The following has evaluated to null or missing:
==> authorContent.contentFields [in template "44616#44647#114455" at line 9, column 17]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: contentFields = authorContent.content... [in template "44616#44647#114455" at line 9, column 1]
----
1<#assign
2 webContentData = jsonFactoryUtil.createJSONObject(author.getData())
3 classPK = webContentData.classPK
4/>
5
6<#assign
7authorContent = restClient.get("/headless-delivery/v1.0/structured-contents/" + classPK + "?fields=contentFields%2CfriendlyUrlPath%2CtaxonomyCategoryBriefs")
8contentFields = authorContent.contentFields
9categories=authorContent.taxonomyCategoryBriefs
10authorContentData = jsonFactoryUtil.createJSONObject(authorContent)
11friendlyURL = authorContentData.friendlyUrlPath
12authorCategoryId = "0"
13/>
14
15<#list contentFields as contentField >
16 <#assign
17 contentFieldData = jsonFactoryUtil.createJSONObject(contentField)
18 name = contentField.name
19 />
20 <#if name == 'authorImage'>
21 <#if (contentField.contentFieldValue.image)??>
22 <#assign authorImageURL = contentField.contentFieldValue.image.contentUrl />
23 </#if>
24 </#if>
25 <#if name == 'authorName'>
26 <#assign authorName = contentField.contentFieldValue.data />
27 <#list categories as category >
28 <#if authorName == category.taxonomyCategoryName>
29 <#assign authorCategoryId = category.taxonomyCategoryId />
30 </#if>
31 </#list>
32 </#if>
33 <#if name == 'authorDescription'>
34 <#assign authorDescription = contentField.contentFieldValue.data />
35
36 </#if>
37
38 <#if name == 'authorJobTitle'>
39 <#assign authorJobTitle = contentField.contentFieldValue.data />
40
41 </#if>
42
43</#list>
44
45<div class="blog-author-info">
46 <#if authorImageURL??>
47 <img class="blog-author-img" id="author-image" src="${authorImageURL}" alt="" />
48 </#if>
49 <#if authorName??>
50 <#if authorName != "">
51 <p class="blog-author-name">By <a id="author-detail-page" href="/w/${friendlyURL}?filter_category_552298=${authorCategoryId}"><span id="author-full-name">${authorName}</span></a></p>
52 <hr />
53 </#if>
54 </#if>
55 <#if authorJobTitle??>
56 <#if authorJobTitle != "">
57 <p class="blog-author-title" id="author-job-title" >${authorJobTitle}</p>
58 <hr />
59 </#if>
60 </#if>
61 <#if authorDescription??>
62 <#if authorDescription != "" && authorDescription != "null" >
63 <p class="blog-author-desc" id="author-job-desc">${authorDescription}</p>
64 <hr />
65 </#if>
66 </#if>
67</div>
The following has evaluated to null or missing: ==> authorContent.contentFields [in template "44616#44647#114455" at line 9, column 17] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: contentFields = authorContent.content... [in template "44616#44647#114455" at line 9, column 1] ----
1<#assign
2 webContentData = jsonFactoryUtil.createJSONObject(author.getData())
3 classPK = webContentData.classPK
4/>
5
6<#assign
7authorContent = restClient.get("/headless-delivery/v1.0/structured-contents/" + classPK + "?fields=contentFields%2CfriendlyUrlPath%2CtaxonomyCategoryBriefs")
8contentFields = authorContent.contentFields
9categories=authorContent.taxonomyCategoryBriefs
10authorContentData = jsonFactoryUtil.createJSONObject(authorContent)
11friendlyURL = authorContentData.friendlyUrlPath
12authorCategoryId = "0"
13/>
14
15<#list contentFields as contentField >
16 <#assign
17 contentFieldData = jsonFactoryUtil.createJSONObject(contentField)
18 name = contentField.name
19 />
20 <#if name == 'authorImage'>
21 <#if (contentField.contentFieldValue.image)??>
22 <#assign authorImageURL = contentField.contentFieldValue.image.contentUrl />
23 </#if>
24 </#if>
25 <#if name == 'authorName'>
26 <#assign authorName = contentField.contentFieldValue.data />
27 <#list categories as category >
28 <#if authorName == category.taxonomyCategoryName>
29 <#assign authorCategoryId = category.taxonomyCategoryId />
30 </#if>
31 </#list>
32 </#if>
33 <#if name == 'authorDescription'>
34 <#assign authorDescription = contentField.contentFieldValue.data />
35
36 </#if>
37
38 <#if name == 'authorJobTitle'>
39 <#assign authorJobTitle = contentField.contentFieldValue.data />
40
41 </#if>
42
43</#list>
44
45<div class="blog-author-info">
46 <#if authorImageURL??>
47 <img class="blog-author-img" id="author-image" src="${authorImageURL}" alt="" />
48 </#if>
49 <#if authorName??>
50 <#if authorName != "">
51 <p class="blog-author-name">By <a id="author-detail-page" href="/w/${friendlyURL}?filter_category_552298=${authorCategoryId}"><span id="author-full-name">${authorName}</span></a></p>
52 <hr />
53 </#if>
54 </#if>
55 <#if authorJobTitle??>
56 <#if authorJobTitle != "">
57 <p class="blog-author-title" id="author-job-title" >${authorJobTitle}</p>
58 <hr />
59 </#if>
60 </#if>
61 <#if authorDescription??>
62 <#if authorDescription != "" && authorDescription != "null" >
63 <p class="blog-author-desc" id="author-job-desc">${authorDescription}</p>
64 <hr />
65 </#if>
66 </#if>
67</div>