Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

How can I output ten minutes moving average every one minute?


StrongerLiu Feb 23, 2010 06:44 PM

Dear Sir:
How can I output ten minutes moving average every one minute? I use cr-1000, but when I config a ten minutes moving average item, it always output every ten minutes. Can I output it every one minute? Sorry for my poor english, thanks!
Mars Liu


wlcable Feb 23, 2010 07:07 PM

Check out the function AvgRun, I think it is close to what you are looking for.


StrongerLiu Feb 24, 2010 03:04 AM

Sorry, I make a mistake. I want to output ten minutes Resultant wind every minute not only wind speed average.It's include vector calculate. so avgRun can't do that. how can do that? thanks!


IslandMan Feb 24, 2010 10:47 AM

The way I've done this in the past is to calculate it manually taking the individual sine and cosine values from the wind direction input and generating the averages.

Something along these lines:
'10M WD Sine
SinWdir10 = Sin(Wdir10)
'10M WD Cosine
CosWdir10 = Cos(Wdir10)
'Average 10M WD Sine
AvgRun (AvgSinWdir10,1,SinWdir10,180)
'Average 10M WD Cosine
AvgRun (AvgCosWdir10,1,CosWdir10,180)

'Calculate 15 Minute Running Avg for Wind Direction
AvgWdir10 = ATN(AvgSinWdir10/AvgCosWdir10)
If AvgCosWdir10 < 0 Then
AvgWdir10 = 180 + AvgWdir10
elseif AvgSinWdir10 < 0 Then
AvgWdir10 = 360 + AvgWdir10
Endif

IslandMan


StrongerLiu Mar 1, 2010 08:35 AM

Dear IslandMan:
It works, thanks!
I have another question. How about "standard deviation of wind direction"? I also want to output ten minutes standard deviation of wind direction every minute, thanks!
Mars Liu


IslandMan Mar 1, 2010 12:03 PM

Mars,
Here is the Sigma code using the averages.
e10 = SQR (1-((AvgSinWdir10^2)+(AvgCosWdir10^2)))
Sigma10 = ASIN (e10*(1+(0.1547*(e10^3))))
As I recall, this is straight from the CR1000 manual.

Glad I was able to help.
IslandMan

Log in or register to post/reply in the forum.