LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging Vectors

What I need is specific VI names not general info, if there are any. Or do I have to, using math trig VIs, do the vector math one step at a time??

 

ssmith

0 Kudos
Message 11 of 20
(945 Views)
Are your vectors in 2D or 3D? What is your LabVIEW version?
Message Edited by altenbach on 08-17-2009 11:03 AM
0 Kudos
Message 12 of 20
(937 Views)

Here is a Snippet.

 

Average_Vectors_code.png 

 

 I take two 1-d arrays of doubles that have the U and V vector components. I convert to complex find the total and divide by the number of components. then I divide to find the average and then convert the complex back to polar to get the Uavg and Vavg values.

 

I think this will do 3d but I have not thought about to hard or tested either.

 

AverageVectors_3d.png

 

 

Ben

 

 

 

 

Message Edited by Ben on 08-17-2009 01:12 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 20
(933 Views)

I have version 8.6. The vector is wind speed and wind direction. It has not yet been resolve into it's u and v components. This is the first part of the problem. Then averaging the u and v components is the middle. The last part, and again difficult part is merging the u and v  components back into a speed and direction vector.

 

ssmith

0 Kudos
Message 14 of 20
(917 Views)

But Ben!

 

Those look rubes. Why not just average each vector seperately?

 

Good point. Lets just call those two VIs a test to see if Ican create a snippet.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 20
(916 Views)

Wind speed is "r" and the direction is theta.

 

The example above is the answer to your question turned inside out.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 20
(913 Views)

Correct! Once the single vector is resolved into it's components each component is averaged. Then you take the average of the u and v and then then construct back to a single vector.

 

ssmith

0 Kudos
Message 17 of 20
(912 Views)

ssmith490D wrote:

Correct! Once the single vector is resolved into it's components each component is averaged. Then you take the average of the u and v and then then construct back to a single vector.

 

ssmith


 

Aggreed.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 18 of 20
(909 Views)
If you are starting with magnitude and direction, why not use Polar to Complex, use Ben's code to average, then Complex to Polar to return average magnitude and direction.
0 Kudos
Message 19 of 20
(894 Views)

Because until now I didn't have the info you just gave me! (The name of the vi) LOL! Thanks alot. I'll try it and let you know.

 

ssmith

0 Kudos
Message 20 of 20
(887 Views)