LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging Vectors

Are there functions that input a vector, break it down to it's component vectors and back again?? My application involves averaging wind speed and direction. I want to average 60 one second wind vectors by averaging the components and then converting the averaged components back to a single vector of wind speed and direction. Thanks in advance for the help.

 

ssmith@bnl.gov

0 Kudos
Message 1 of 20
(4,527 Views)

Am I understanding your question correctly:
You want to resolve a vector into an x-component and a y-component.

You want to average all the x's, and all the y's, then build them back into a vector?

Cory K
0 Kudos
Message 2 of 20
(4,524 Views)
maybe something like this?
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 3 of 20
(4,520 Views)

You need first to decide about the repesentation of you vectors. You could make a cluster of the componente, or and array where by index 0 will be the first component, index 1 the second component and so on, or if you stick to 2D you could use complex numbers for the vector representation.

 

Please find attach an example for averaging 3D-vectors based on the first method a cluster of the components.

 

 

0 Kudos
Message 4 of 20
(4,497 Views)

Cory--

            That is exactly what I want to do.

 

S

0 Kudos
Message 5 of 20
(4,493 Views)
I would recommend to combine the two arrays into a complex (CDB) 1D array. The averaged vector is simply Sum/N.
Message 6 of 20
(4,481 Views)
First the single vector must be broken down into it's component vectors and then averaged.
0 Kudos
Message 7 of 20
(4,424 Views)

altenbach wrote:
I would recommend to combine the two arrays into a complex (CDB) 1D array. The averaged vector is simply Sum/N.

 

Hi Christian,

 

I recently had to do some averaging of vectors in three-space and resorted to using complex to do this. As I was doing my code I was thinking "how would Christian have done this?".

 

Do you have Nuggets of wisdom you could share regarding vectors with more tahn two components.

 

Curious,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 20
(4,421 Views)
You can input a vector into this complex array and vector avaeraging will be done correctly??
0 Kudos
Message 9 of 20
(4,415 Views)

Hi,

 

do you think LabView will calc an average incorrectly?? Smiley Wink

 

For real:

Many (most basic) functions are polymorph an can take (nearly) any kind of data...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 20
(4,390 Views)