Author Topic: calculate average wind direction?  (Read 10467 times)

0 Members and 1 Guest are viewing this topic.

Offline m77

  • Forecaster
  • *****
  • Posts: 813
calculate average wind direction?
« on: August 18, 2010, 12:57:36 PM »
i saw that NOAA use arctan(u/v) to do this,

http://www.ndbc.noaa.gov/wndav.shtml

but can anyone run me through a basic eg please?

thanks
Weatherlink ip, Vantage Vue,

Offline KeithBC

  • Senior Contributor
  • ****
  • Posts: 162
Re: calculate average wind direction?
« Reply #1 on: August 18, 2010, 01:37:37 PM »
You have to do a vector addition to get the average direction.

Break down each individual wind speed/direction vector into an East-West component and a North/South component.  Assuming the direction is given in degrees clockwise from north, the north-south component is the cosine of the direction angle times the speed; the east/west component is the sine of the direction times the speed.
Cns = cos(Dir)*Spd
Cew = sin(Dir)*Spd

Add up all the north-south components.  Then separately, add up all the east/west components.

The average direction is the arctan of the east/west components divided by the north south components.
Dir = arctan(sum(Cew) / sum(Cew))

Gotchas to watch out for: Degrees versus radians.  Wind directions are usually given in degrees.  Trig functions are usually in radians.  Arctan functions usually get confused about quadrants.  If you have an arctan function that takes two parameters (rise and run), use it rather than one that takes a single value.  The two parameters  are then the east/west sum and the north/south sum.

Offline m77

  • Forecaster
  • *****
  • Posts: 813
Re: calculate average wind direction?
« Reply #2 on: August 18, 2010, 02:39:53 PM »
Ok so what if I get a north west 5mph and also a north east at 10 mph?

Can you please show me how to work that one?

i get 0.958 ????
« Last Edit: August 19, 2010, 02:52:09 AM by m77 »
Weatherlink ip, Vantage Vue,

Offline KeithBC

  • Senior Contributor
  • ****
  • Posts: 162
Re: calculate average wind direction?
« Reply #3 on: August 22, 2010, 01:17:51 PM »
Vector 1: NW @ 5
NS1 = 5 * cos(315) = 3.54
EW1 = 5 * sin(315) = -3.54

Vector 2: NE @ 10
NS2 = 10 * cos(45) = 7.07
EW2 = 10 * sin(45) = 7.07

Add components:
TotalNS = NS1 + NS2 = 3.54 + 7.07 = 10.61
TotalEW = EW1 + EW2 = -3.54 + 7.07 = 3.54

Compute resultant vector:
Average Direction = atan(TotalEW / TotalNS) = atan(3.54 / 10.61) = 18.43

Note that I have given all angles in degrees.  In practice, you would have to convert to and from radians, since trig functions invariably use radian measure.  Also, a standard atan function will produce a quadrantal ambiguity that you will have to resolve yourself.  Some Microsoft products have an ATAN2 function which takes the rise and run separately, and can therefore resolve the ambiguity itself.  When I did this example in Excel, I used ATAN2(10.61, 3.54).

To be mathematically rigorous, you should divide the TotalNS and TotalEW by 2, since you want an average, not a total.  However, if you are only interested in the direction, you would be dividing both the numerator and denominator by the same amount, which is an unnecessary step.  The true vector average (with the division by 2) would only be necessary if you wanted a magnitude to go along with the direction.  In the case of wind, the result would be meaningless.

[edit]If the atan function returns a negative result, add 360 degrees to get a compass direction.
« Last Edit: August 22, 2010, 01:41:38 PM by KeithBC »

Offline phanindra

  • Member
  • *
  • Posts: 1
Re: calculate average wind direction?
« Reply #4 on: January 07, 2014, 12:06:43 AM »
Hi KeithBC,

Firstly thank you for sparing your time..

I am having similar problem with the wind direction and current direction average..

I am applying same concept to both the parameters wind and current.. can it be done..??

please let me know the answer..as I am working on my M.Tech(Ocean Science) project..

I am having wind( & current) speed and direction with an interval of 1 hour daily for three years..
now I want daily average of both the wind(&current) direction, to observe the seasonal variations there after.

Online SLOweather

  • Administrator
  • Forecaster
  • *****
  • Posts: 2694
    • http://www.sloweather.com
Re: calculate average wind direction?
« Reply #5 on: January 07, 2014, 12:32:52 PM »
I had an identical thread recently. Old Tele Man posted a dirrerent solution there:

Quote
Use the "signed-complement" value technique, ie: "...how many degrees left(-) or right(+) of True North (0║)..." for each reading, not its actual value:

-(360║-315║) = -45║ x 5 = -225║, where n = 5
        -(0-45) = +45║ x 5 = +225║, where n = 5; total n = 5+5 = 10

AVG║ = (-225║ + 225║)/10 = (0║/10) = 0║ [ NOTE: do error checking for ZERO-value BEFORE performing division by number of samples (n = 10) ]

Offline KeithBC

  • Senior Contributor
  • ****
  • Posts: 162
Re: calculate average wind direction?
« Reply #6 on: January 07, 2014, 02:00:00 PM »
Hi KeithBC,

Firstly thank you for sparing your time..

I am having similar problem with the wind direction and current direction average..

I am applying same concept to both the parameters wind and current.. can it be done..??

please let me know the answer..as I am working on my M.Tech(Ocean Science) project..

I am having wind( & current) speed and direction with an interval of 1 hour daily for three years..
now I want daily average of both the wind(&current) direction, to observe the seasonal variations there after.
The solution is just a general vector addition.  It has nothing to do with wind per se.  It applies any time you are averaging several directions. 

While a vector addition makes sense for the average direction, it does not make sense for an average speed, at least in the context of wind or ocean currents.  If you have a wind from the east at 60 and another from the west at 50, the average direction would be from the east, but the average speed would not be 10, which is what a vector addition would give you.  For speeds, you need to average the speeds as a straight numerical average, separately from the direction vectors.