Vector/Phasor Addition

  • Thread starter Thread starter kai sinclair
  • Start date Start date
  • Tags Tags
    Vector addition
AI Thread Summary
The discussion focuses on calculating vector addition using a weight-averaged formula that incorporates a bias factor, ##X_n##, derived from initial angles ##\theta_n## and magnitudes ##M_n##. The user seeks a more straightforward method to compute ##X_n## without relying on the cumbersome ##\tan^{-1}## method. Various approaches to vector addition are explored, including converting polar coordinates to rectangular coordinates and summing the x and y components independently, which is deemed more efficient and less error-prone. The conversation emphasizes the importance of using robust mathematical techniques to ensure accuracy in vector calculations, particularly in programming and engineering contexts. Overall, the thread highlights the complexities involved in vector addition and the search for more efficient computational methods.
kai sinclair
Messages
29
Reaction score
1
TL;DR Summary
potentially new way to calculate θₜ
so I've made some progress to this endeavour and come up with this to calculate Vector Addition; a weight averaged with a bias

$$\frac { \sum_{n=1}^{N} \theta_{n} \cdot M_{n}{}^{X_n}} {\sum_{n=1}^{N} M_{n}{}^{X_n}}=\theta_{t}$$

I do have a round about way to figure out the Bias, ##X_n##, but it's a pain in the poo and requires the ##\tan^{-1}## method, so currently I'm wondering if I could get some help figuring out how to directly calculate ##X_n## just from the inputs of ##\theta_n## and ##M_n##, where ##\theta_n## is the initial Angle and ##M_n## is the initial Magnitude

here's a example I know:

##V_1## = 10 units at +15° from reference

##V_2## = 70 units at +90° from reference

$$\frac { 15 \cdot 10^{0.91723...} + 90 \cdot 70^{1.01152...} } { 10^{0.91723...} +70^{1.01152...} } = 82.42022...$$

from this how do I get

##X_1## = 0.917232306788...
and
##X_2## = 1.011526736693...
 
Last edited:
Engineering news on Phys.org
I'm not seeing what you're trying to do here. What are these ##X_i## quantities and where did they come from in your example?
 
Nugatory said:
I'm not seeing what you're trying to do here. What are these ##X_i## quantities and where did they come from in your example?
I would love to show you my work step by step but LaTeX is being annoying,

but in short how to I calculate ##X_n## from only ##\theta_n## and ##M_n##
 
The geometric way to add two vectors is to place them tip to end creating two sides of a triangle and then measure the angle relative to your reference angle and length of the third side.

In rectangular coordinates, we would convert each vector into x, y components and add them together to get the resultant vector sum.

It would seem in your case, you are doing something different.

What is the context of your problem you’re trying to solve? Is it related to navigation or engineering or some novel way to do vector addition?
 
jedishrfu said:
The geometric way to add two vectors is to place them tip to end creating two sides of a triangle and then measure the angle relative to your reference angle and length of the third side.

In rectangular coordinates, we would convert each vector into x, y components and add them together to get the resultant vector sum.

It would seem in your case, you are doing something different.

What is the context of your problem you’re trying to solve? Is it related to navigation or engineering or some novel way to do vector addition?

I understand that the industry standard is the following formula, it's just my pattern recognition is saying there's a better way

$$ \tan^{-1} \left( \frac { \sum_{n=1}^N {M_n \cdot \sin( \theta_n)} } {\sum_{n=1}^N {M_n \cdot \cos( \theta_n)} } \right)$$

so the main thing I'm trying to do at the moment is finding a way to figure out what the Bias, ##X_n##, just from the initial inputs of ##\theta_n## and ##M_n##
 
Nugatory said:
where did they come from in your example?
lets take a crack at this again

this is the initial form of my Formula, and does not get the right answer only gets into the ball park

$$\frac { \sum_{n=1}^N {\theta_n \cdot M_n} } { \sum_{n=1}^N {M_n} } \approx \theta_t$$


so first find a Corrective Power to this using

$$\frac { \ln \left( \tan^{-1} \right) } { \ln \left( \text{Formula} \right) } = \text{Corrective Power (Cp)}$$

so now

$$\left( \frac { \sum_{n=1}^N {\theta_n \cdot M_n} } { \sum_{n=1}^N {M_n} } \right)^{Cp} = \theta_t$$

now let

$$\frac { \sum_{n=1}^N {\theta_n \cdot M_n^{X_n} } } { \sum_{n=1}^N {M_n^{X_n} } } = \theta_t = \left( \frac { \sum_{n=1}^N {\theta_n \cdot M_n} } { \sum_{n=1}^N {M_n} } \right)^{Cp}$$

with this being true then these two must also be true

$$\sum_{n=1}^N {\theta_n \cdot M_n^{X_n} } = \left( \sum_{n=1}^N {\theta_n \cdot M_n} \right)^{Cp}$$
and
$$\sum_{n=1}^N {M_n^{X_n} } = \left( \sum_{n=1}^N {M_n} \right)^{Cp}$$

to go forward we need to give values, so
##V_1## = 10 units at +15° from reference
##V_2## = 70 units at +90° from reference

using the first two formulas in this post you get a ##Cp = 1.005016629538...##, feel free to check for yourself

but now we have

$$15 \cdot 10^{X} +90 \cdot 70^{Y} = \left( 15 \cdot 10 +90 \cdot 70 \right)^{1.0052} = 6740.170217486580...$$

and

$$10^{X} + 70^{Y} = \left( 10 +70 \right)^{1.0052} = 81.778112865544...$$


then we can simplify the Numerator by Dividing by the HCF of 15

$$\frac {15 \cdot 10^{X} +90 \cdot 70^{Y} } {15} = \frac {6740.170217486580...} {15}$$

$$10^{X} + 6 \cdot 70^{Y} = 449.344681165772...$$

now cross subtract to remove ##10^X##

$$\left( 10^{X} + 6 \cdot 70^{Y} \right) - \left( 10^{X} + 70^{Y} \right) = 449.344681165772... -81.778112865544...$$

$$5 \cdot 70^{Y} = 367.566568300228...$$

divide by 5

$$\frac {5 \cdot 70^{Y} } {5} = \frac {367.566568300228...} {5}$$

$$70^{Y} = 73.513313660046...$$

take the ##\ln##

$$Y \cdot \ln \left( 70 \right) = \ln \left( 73.513313660046... \right)$$

isolate Y

$$\frac {Y \cdot \ln \left( 70 \right)} {\ln \left( 70 \right)} = \frac {\ln \left( 73.513313660046... \right)} {\ln \left( 70 \right)}$$

$$Y = 1.011526736693...$$


now with Y we can solve for X

$$10^{X} + 70^{1.011526736693...} = 10^{X} +73.513313660046... = 81.778112865544...$$

Isolate for X

$$10^{X} +73.513313660046... - 73.513313660046... = 81.778112865544... - 73.513313660046...$$

$$10^{X} = 8.264799205498...$$
take the ##\ln##
$$X \cdot \ln \left( 10 \right) = \ln \left( 8.264799205498... \right)$$
Isolate for X again
$$\frac {X \cdot \ln \left( 10 \right)} {\ln \left( 10 \right)} = \frac {\ln \left( 8.264799205498... \right)} {\ln \left( 10 \right)}$$
$$X = 0.917232306788$$
 
Last edited:
I don't believe corrective real powers are the way to go, even if you can make it work.
Real powers of real numbers involve a Log(), a multiply, and an Exp() for each data point. You need two different powers, so you must evaluate a total of four transcendental functions per vector point.

If you convert each polar vector to rectangular, that takes the x=r·cos(t) and y=r·sin(t), which only involves evaluating two transcendental functions, so it should be faster. Most FPUs are able to evaluate sin(t) and the cos(t) in parallel, at the same time, which makes it faster again.

Without additional code, Atan( y/x ) will only resolve 180° for the final theta.
The Atan2( y, x ) function will resolve the full 360° circle for the final theta.
 
Baluncore said:
If you convert each polar vector to rectangular, that takes the x=r·cos(t) and y=r·sin(t), which only involves evaluating two transcendental functions, so it should be faster. Most FPUs are able to evaluate sin(t) and the cos(t) in parallel, at the same time, which makes it faster again.


Without additional code, Atan( y/x ) will only resolve 180° for the final theta.
The Atan2( y, x ) function will resolve the full 360° circle for the final theta.
I am unaware of this method, please elaborate

Baluncore said:
I don't believe corrective real powers are the way to go, even if you can make it work.
Real powers of real numbers involve a Log(), a multiply, and an Exp() for each data point. You need two different powers, so you must evaluate a total of four transcendental functions per vector point.
So you think this is going to get needlessly complicated?
 
kai sinclair said:
I am unaware of this method, please elaborate
Be more specific. Which method, to do what?

Summing vectors involves summing the x and y coordinates independently. That is done as if the coordinate pairs were complex numbers. The sum of the two orthogonal coordinates is the resultant vector.

The Atan(/), or Atan2(,), function gives the resultant vector direction from the sums.
https://en.wikipedia.org/wiki/Atan2

kai sinclair said:
So you think this is going to get needlessly complicated?
I don't believe I have ever seen a reference to the technique before, and you have a million mathematicians ahead of you.
 
  • #10
Baluncore said:
Be more specific. Which method, to do what?

Summing vectors involves summing the x and y coordinates independently. That is done as if the coordinate pairs were complex numbers. The sum of the two orthogonal coordinates is the resultant vector.

The Atan(/), or Atan2(,), function gives the resultant vector direction from the sums.
https://en.wikipedia.org/wiki/Atan2
so is what your talking about this formula?

$$ \tan^{-1} \left( \frac { \sum_{n=1}^N {M_n \cdot \sin( \theta_n)} } {\sum_{n=1}^N {M_n \cdot \cos( \theta_n)} } \right)$$
 
  • #11
kai sinclair said:
so is what your talking about this formula?
Yes, but tan-1(y/x) is Atan(y/x) and it gives you the slope of the line as an angle, not the direction of the vector, there is a difference.
https://en.wikipedia.org/wiki/Atan2#Illustrations
 
  • #12
Baluncore said:
Yes, but tan-1(y/x) is Atan(y/x) and it gives you the slope of the line as an angle, not the direction of the vector, there is a difference.
https://en.wikipedia.org/wiki/Atan2#Illustrations
can you show me how that would work with this given example

##V_1## = 10 units at +15° from reference
##V_2## = 70 units at +90° from reference
 
  • #13
kai sinclair said:
can you show me how that would work with this given example
Inputs.
V1 = 10 units at +15° from reference
V2 = 70 units at +90° from reference

Convert polar to rectangular.
x1 = 10 * cos( 15° ) = 9.659
y1 = 10 * sin( 15° ) = 2.588
V1 = ( 9.659, 2.588 )

x2 = 70 * cos( +90° ) = 0.0
y2 = 70 * sin( +90° ) = 70.0
V2 = ( 0.0, 70.0 )

Sum the orthogonal coordinates separately.
Sum_x = 9.659 + 0.0 = 9.659
Sum_y = 2.588 + 70.0 = 72.588
The vector sum is; (9.659, 72.588)

Angle theta = Atan2( 72.588, 9.659 ) = +82.42° from reference.
Magnitude = √( 9.659² + 72.588² ) = 73.228 units.
 
  • #14
If you sketch the triangle it can be solved using, first, the cos rule to find ther unknown length of side:-
a^2 = b^2 +c^2 - 2 bc cos A
Then apply the sin rule to find a second angle:-
a/sin A = b/sin B = c/sinC
 
  • #15
tech99 said:
If you sketch the triangle it can be solved using, ...
The problem with the cosine and sine rule technique for vector arithmetic, is that there are too many opportunities to get a sign wrong, and when you do, it can be very hard to resolve, especially when embedded in a spreadsheet. When in a hall of mirrors, it is wise to fear trigonometric geometry.

The addition of any number of vectors, by the summation of the rectangular(x,y) components, does not suffer from the need to draw a sketch. The signs look after themselves. It is numerically robust, and so can be used without fear, for computer graphics and navigation.

Programming vector arithmetic, becomes simpler and more reliable, when the vectors are stored in the rectangular(x,y) form, rather than in the polar(r,θ) form.

In some limited cases, phasors may be better stored and processed in polar(r,θ) form, but then the robust vector arithmetic routines, cannot be applied directly.
 
  • #16
Baluncore said:
Magnitude = √( 9.659² + 72.588² ) = 73.228 units.
just a note one this one, do you know of this formula for it?

$$\sum_{n=1}^N {M_n \cdot \cos(\theta_n - \theta_t)} = M_t$$
 
  • #17
kai sinclair said:
do you know of this formula for it?
It does make sense.
Given a chain of added vectors, and knowing the direction of the total, all vectors making up the chain can be rotated, by subtracting the direction of the total. The cosine then resolves the magnitude of all the individual vectors along the real x-axis, giving the magnitude of the total.
To use that technique, you must economically first find the direction of the total.
 
  • #18
true, but as you can see there's less Trig involved which has two advantages, easier to calculate, even for computers and because it has less Trig, and importantly no Trig powers the error rate is a lot further down in the decimals, not usually a concern in most cases but if you need high precision might be useful
 
  • #19
I think the only advantage is that it avoids the one final evaluation of a square root, but accuracy there is not usually critical. The cost is the evaluation of another cosine for each vector input.

An alternative would be to take the earlier sums of the x and y components, and rather than evaluating an angle with Atan2(y,x), normalise the result to a unit length vector. The conjugate of that unit vector can then be complex multiplied by the input vectors, (only the real half being needed), rotating them onto the x-axis, avoiding all the angle subtractions and cosine evaluations.
 
  • #20
kai sinclair said:
$$\frac { \sum_{n=1}^{N} \theta_{n} \cdot M_{n}{}^{X_n}} {\sum_{n=1}^{N} M_{n}{}^{X_n}}=\theta_{t}$$
I have never seen something like this formula before. The most similar formula to this formula which I have met before is $$ \theta_t\approx\frac{\sum_{n=1}^{N}\theta_n\cdot M_n}{\sum_{n=1}^{N}M_n} $$ which is applicable in the case of very small values of angles ## \theta_t ## and ## \theta_n\,(n=1,2,…,N) ## in radians (the small-angle approximation).
 
  • #21
Gavran said:
I have never seen something like this formula before. The most similar formula to this formula which I have met before is $$ \theta_t\approx\frac{\sum_{n=1}^{N}\theta_n\cdot M_n}{\sum_{n=1}^{N}M_n} $$ which is applicable in the case of very small values of angles ## \theta_t ## and ## \theta_n\,(n=1,2,…,N) ## in radians (the small-angle approximation).
yes, the Weighted Average kind of works on small scales, low difference in ##\theta_n## mainly, and low ish difference in ##M_n##, if you add in a Bias, ##X_n##, then it corrects itself

my current goal is to calculate ##X_n## just from the given initial inputs of ##\theta_n## and ##M_n##
 

Similar threads

Replies
2
Views
1K
3
Replies
100
Views
11K
Replies
42
Views
12K
Replies
125
Views
19K
Replies
83
Views
12K
Back
Top