Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

the winds aloft

Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
03-30-2005 19:56
I have been surveying the winds in SL as returned by llWind(pos) and thought others might benefit from my findings. Please keep in mind that the following analysis was done with data from one spot on my land over a short period and may not be generalizable from hour to hour or sim to sim.

I seem to recall in some long ago version of SL that the winds would just shift from NW to SE with maybe a varied velocity. I am making a "manned" vehicle to be carried by the wind, so the question I had is are the winds sufficiently variable to use as a basis for movement. I have concluded they are. I have attached a plot showing 200 samples taken at 5 second intervals.

The Z component of the wind vector is always zero, and the winds measured at varying altitude are always identical. The line in the plot traces out the samples in time order. I made no corrections for 2 lost samples every 50 samples due to llEmail() delays. I have done some cursory statistics and found an absence of correlation between X & Y or X & T or Y & T. I've not done time series analysis or any concurrence plotting. I have noticed a strong skewness in the -X direction which I have seen go as low as -12. Otherwise, the other coordinate bounds are roughly (-12..6) for X and (-6..6) for Y. And yes, I sacrificed statisical rigor in this post for brevity.
Chage McCoy
Aerodrome Janitor
Join date: 23 Apr 2004
Posts: 336
03-30-2005 22:42
Thats very cool. maybe there will be a suitable means for you to bring a "live" report into SL in 1.6?
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
03-30-2005 22:53
Nice job!

/esc
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
03-30-2005 23:57
very cool Malachi. that might help a project i'm planning too.

can anybody please translate that like a weather report tho? something like "winds in SL are mainly from the NW with speeds generally steady between 5-10 meters per second with gusts up to 25 m" or whatever? i don't speak math. :D

i'm guessing on that graph the direction of a point from 0,0 is the wind direction (coming or going i dunno) and the distance from 0,0 is the speed?
_____________________
Zuzi Martinez: if Jeska was Canadian would she be from Jeskatchewan? that question keeps me up at nite.
Jeska Linden: That is by far the weirdest question I've ever seen.
Talena Wallaby
Registered User
Join date: 20 Mar 2005
Posts: 19
03-31-2005 00:07
From: Zuzi Martinez
can anybody please translate that like a weather report tho? something like "winds in SL are mainly from the NW with speeds generally steady between 5-10 meters per second with gusts up to 25 m" or whatever? i don't speak math. :D


Without scattering objects across every Sim in the game ... no, not really.

It is an interesting idea, though. May look into it if I can ever get llSetTimerEvent() to stop hating me. I at least would like to know the wind patterns of the few sims I regularly visit. Until this post I wasn't aware this command existed. Still working my way through LSL.
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
03-31-2005 03:38
Awesome work!!! Some of you may be interested in a little bit of data catching i did too.
The Thread
The Site
_____________________
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
03-31-2005 05:01
Thanks for the kind words folks; I'm glad this is of use. I'll try to addess some of the questions raised.

First of all, the return value of llWind() is underspecified as to units and interpretation. Following Cid's lead, and as most SL measurements are metric, meters per second seems to be a reasonable interpretation of the magnitude. However, m/s yields rather light winds as 1 m/s is equivalent to 2.24 miles per hour. Thus, the strongest wind I've recorded (not shown above) was about 12 m/s (or 28 mph) and that gust lasted less than a minute.

Zuzi is correct that the Euclidean distance from (0,0) to a point on the graph is the magnitude of the wind. As it was back in trig class, that means that the magnitude of one sample is sqrt(x^2 + y^2). For example, a point at (2,2) has a magnitude of 2.83 m/s (6.3 mph) which is a pretty mild breeze.

The other bit which isn't specified is the interpretation of direction. I'll defer to the meteorologists on this one for whom "wind NW at 5mph" means wind *from* the NW. Confounding this is that sim coordinates increase east to west but decrease from north to south at which point I give up trying to make the numbers make "sense" and just assert that (+X, +Y) is wind from the NE, (-X, +Y) is from the NW, etc.

As for weather reports the wind changes too often to report any useful trends, but also given the low wind speeds one can say "light and variable" and always be correct. Alternately, you could play a frantic Bill Murray in Groundhog Day (although Robin Williams does frantic better). For example, looking at the graph - which begins at around (3, -2) - the fourth sample is ~2.8 m/s from the SE and then 30 seconds later has shifted to be 2.8 m/s from from the NE and a couple minutes later is from the SW. RL wind is a little more constant than that.

For Talena, you are welcome to my "windsock" script which is a whopping ~20 lines or so. It does, however, poll the sim every 5 seconds which isn't wildly demanding, but I only run it for short durations out of consideration for my sim-mates.

Finally, I did do qualitative analysis (stat-speak for "I looked at the graph";) for 1st order recurrence plotting for both X & Y values and noticed no particular order to the data. Recurrence ploting of the 1st order is graphing P \sub n against P \sub n+1.

I might fiddle around with the numbers and see if viewing them as semi-logarithmic velocities make more sense, but with the rapid shifting, I don't expect it matters.
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
03-31-2005 05:06
From: Malachi Petunia
Thanks for the kind words folks; I'm glad this is of use. I'll try to addess some of the questions raised.

First of all, the return value of llWind() is underspecified as to units and interpretation. Following Cid's lead, and as most SL measurements are metric, meters per second seems to be a reasonable interpretation of the magnitude. However, m/s yields rather light winds as 1 m/s is equivalent to 2.24 miles per hour. Thus, the strongest wind I've recorded (not shown above) was about 12 m/s (or 28 mph) and that gust lasted less than a minute.

Keep watching the wind I've gotten some wild numbers before, upwards of 25 m/s! Now thats something to be wind surfing around in :cool: .
_____________________
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
03-31-2005 07:01
thanks Malachi that makes it alot clearer. time to bust out the instruments.
_____________________
Zuzi Martinez: if Jeska was Canadian would she be from Jeskatchewan? that question keeps me up at nite.
Jeska Linden: That is by far the weirdest question I've ever seen.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
03-31-2005 10:54
I've built a few toys "just for fun", including a wind guage (a simple stick that points in the direction of the wind, and stretches to shwo how far the air moves in a second), and an anemometer. It seems that SL wind is more variable and less strong than RL wind, and I think this could amke something like a boat or a hot air balloon difficult. Maybe we should reconsider the lack of consistency though, because SL "days" are, what, 4 times faster than RL days, right? Or is it six? So maybe if you scale your time by four, the wind smooths out to much more "sane" values.
Kali Dougall
Purple and Spikey
Join date: 5 Feb 2005
Posts: 98
03-31-2005 11:18
From: Lex Neva
Maybe we should reconsider the lack of consistency though, because SL "days" are, what, 4 times faster than RL days, right? Or is it six? So maybe if you scale your time by four, the wind smooths out to much more "sane" values.

I read a SF story once wherein people could go through a procedure not dissimilar to hibernation to make themselves experience time at a different rate. People who experienced a realtime minute as just one second would, of course, have far less than the usual time to react to gravity's whims. Thus they perceived gravity as actually being higher, and had to live in microgravity in order to get around.

So, similarly, if we have wind that kicks up to 100m/s in-game, we could consider that we're accelerating time by 4 (or whatever it is) and that a person who was "really" in the SL world, at a normal rate of time, would experience 25m/s. Other than that, I guess you could say this post is barely relevant.
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
04-01-2005 09:35
Proves what even the Lindens have said: Wind is WAY too erratic and variable to be useful for much.
_____________________
~ Tiger Crossing
~ (Nonsanity)
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-01-2005 09:59
From: Tiger Crossing
Proves what even the Lindens have said: Wind is WAY too erratic and variable to be useful for much.

Eh, it's just a global, cell-based randomizer. If all else fails, write your own. :D
_____________________
---
Coos Yellowknife
Registered User
Join date: 25 Jul 2004
Posts: 27
Need some help
04-01-2005 15:58
I am trying to add in wind data to one of my flying bird project. Basicly I want to control the speed it moves based on if it is flying into the wind then I want to slow it down. if it hasa tail wind speed it up some.

I have looked on the Wiki and it gives a cool way to get the wind speed. It also says objects seem to be unaffected by the wind unless an avitar is setting on it. So I need to add it in the script as I thought I would need to. What I have been trying to figure out is the direction the wind is "coming from" I am not sure how to do the coding of the math part to get the direction in Degrees from North. (This could be used to make wind vains ect.)

Thank you for your help in advance. :)

Coos
Kali Dougall
Purple and Spikey
Join date: 5 Feb 2005
Posts: 98
04-01-2005 16:32
Well, llWind returns a velocity, and a velocity tells you both speed and direction.

Windspeed: llVecMag(llWind())
Wind direction: llVecNorm(llWind())

For direction, the normalized vector has a magnitude of 1; so, for instance, wind blowing due north will be <0, 1, 0>. The rest is trig. Hopefully that helps.
Coos Yellowknife
Registered User
Join date: 25 Jul 2004
Posts: 27
Yes I was wondering what other commad to use.
04-01-2005 19:36
I knew about the llVecMag command from the Wiki. :) I just was not sure about the normalising part. Now all I have to do is remember trig. It was 25 years ago I had it for collage class. have not needed it much sence lol. What is that saying oh ya "Use itor loose it" How true that is! It is mostly gone. Oh well

Thank you for the help! :)
Talena Wallaby
Registered User
Join date: 20 Mar 2005
Posts: 19
04-01-2005 22:18
From: Coos Yellowknife
I knew about the llVecMag command from the Wiki. :) I just was not sure about the normalising part. Now all I have to do is remember trig. It was 25 years ago I had it for collage class. have not needed it much sence lol. What is that saying oh ya "Use itor loose it" How true that is! It is mostly gone. Oh well

Thank you for the help! :)


There, done for you. If you have any questions then ask or IM me ingame.

Not commented very well, unfortunately. Never have liked commenting my code.

I'll write a script that checks the wind over a period of time and stores that information for use in statistical analysis once I understand XML-RPC (the Wiki's pretty much worthless in this regard I've found), since llEmail() delays the script too much (20 seconds if I recall correctly, and I'd want to update at least every 5 seconds).

It should be reasonably easy to set up a prim that tracks a sim's weather. The only question is the speed of the XML-RPC calls. If they don't delay the script too much then it can be exported offworld in a timely manner and handled offworld (I definitely wouldn't want to crunch all the data in a sim).
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
04-03-2005 23:11
Tal, use a function to put duplicate statements in, like all those ifs:

CODE

// Spits out the wind direction into local chat. Touch to have it spit out the direction again.

windDirection()
{
vector wind = llWind(ZERO_VECTOR);
// store value of llWind at the current location
float angle = llAtan2(wind.y, wind.x);
// get the angle of the wind
float degree = angle * RAD_TO_DEG;
// turn it into degrees because radians hurt my head

if (degree > -22.5 && degree <= 22.5)
{
llSay(0, "Wind is out of the West");
}
else if (degree > 22.5 && degree <= 67.5)
{
llSay(0, "Wind is out of the Southwest");
}
else if (degree > 67.5 && degree <= 112.5)
{
llSay(0, "Wind is out of the South");
}
else if (degree > 112.5 && degree <= 157.5)
{
llSay(0, "Wind is out of the Southeast");
}
else if ( (degree > 157.5 && degree <= 180) || (degree >= -180 && degree <= -157.5) )
{
llSay(0, "Wind is out of the East");
}
else if (degree > -157.5 && degree <= -112.5)
{
llSay(0, "Wind is out of the Northeast");
}
else if (degree > -112.5 && degree <= -67.5)
{
llSay(0, "Wind is out of the North");
}
else if (degree > -67.5 && degree <= -22.5)
{
llSay(0, "Wind is out of the Northwest");
}
//llSay(0, "wind.x=" + (string)wind.x + " wind.y=" + (string)wind.y + " degree =" + (string)degree);
// left in for debugging so you can verify that things are going right
}

default
{
state_entry()
{
windDirection();
}

touch_start(integer num)
{
windDirection();
}
}