- #1

- 38

- 1

- Summary:
- I have data in terms of X, Y, and Z components. There is also a "Total" value for each set of X, Y, Z data. I see that SQRT(X^2 + Y^2 + Z^2) = Total. So I think "Total" is a vector magnitude. Now I have to use the data in a calculation: (the equation is "N dot N") but can't figure out the correct way to do it. If I (in Python) square "Total," the answer is different than if I do: X^2 + Y^2 + Z^2. Is it obvious to anyone whether I should use "Total" or "X^2 + Y^2 + Z^2"?

I have to perform a calculation on my data. Here is an example of data from just one time step (data from other time steps would appear as additional rows).

Total = SQRT(X

The calculation I have to do is: (N • N), where "N" is an average.

I tried doing this in Python and realized I don't understand what I have to do. The result is not the same when I use "Total" as when I use the components. For example,

np.average(X)**2 + np.average(Y)**2 + np.average(Z)**2

is not the same as

np.average(Total)**2

Can anyone help explain which is the most likely way to do it? The only information I have makes it unclear if "N" in the equation is "Total" (the vector magnitude) or (np.average(X)**2 + np.average(Y)**2 + np.average(Y)**2) and I have no idea if there's a way to tell from what I have asked. I'm not a mathematician.

X | Y | Z | Total | |

2 | 2 | 1 | 3 |

Total = SQRT(X

^{2}+ Y^{2}+ Z^{2}).The calculation I have to do is: (N • N), where "N" is an average.

I tried doing this in Python and realized I don't understand what I have to do. The result is not the same when I use "Total" as when I use the components. For example,

np.average(X)**2 + np.average(Y)**2 + np.average(Z)**2

is not the same as

np.average(Total)**2

Can anyone help explain which is the most likely way to do it? The only information I have makes it unclear if "N" in the equation is "Total" (the vector magnitude) or (np.average(X)**2 + np.average(Y)**2 + np.average(Y)**2) and I have no idea if there's a way to tell from what I have asked. I'm not a mathematician.

Last edited: