WXforum.net
May 20, 2013, 01:25:57 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6609  •  Posts: 178313  •  Topics: 18104
Please welcome TargY, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: calculate average wind direction?  (Read 6024 times)
0 Members and 1 Guest are viewing this topic.
m77
Forecaster
*****
Offline Offline

Posts: 752



WWW
« 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
Logged

click to visit the Maiden Erlegh School Weather Station. Weatherlink ip, Vantage Vue, weather display, WXSIM, WU=IWOKINGH4, WOW=14014920
KeithBC
Senior Contributor
****
Offline Offline

Posts: 160




« 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.
Logged
m77
Forecaster
*****
Offline Offline

Posts: 752



WWW
« 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 » Logged

click to visit the Maiden Erlegh School Weather Station. Weatherlink ip, Vantage Vue, weather display, WXSIM, WU=IWOKINGH4, WOW=14014920
KeithBC
Senior Contributor
****
Offline Offline

Posts: 160




« 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 » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.092 seconds with 18 queries.
anything