Error propagation when using modulus operator

Click For Summary

Discussion Overview

The discussion revolves around error propagation when using the modulo operator in calculations involving angles, specifically in the context of the arctangent function and its subsequent transformation to a desired range. Participants explore the implications of these operations on the calculation of uncertainties associated with the angle.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant questions the validity of their equation for the uncertainty in theta, ## \sigma_{\theta} ##, which is derived from the ratio of two variables A and B.
  • There is a concern about whether the transformation of theta from the range ##[-\pi,\pi]## to ##[0,2\pi]## necessitates adjustments to the uncertainty calculation.
  • Another participant raises a general question regarding the propagation of error when A is zero, leading to a potential division by zero in the uncertainty formula.
  • Some participants discuss the implications of negative values for A on the uncertainty calculation, questioning the physical meaning of negative uncertainties.
  • A later reply clarifies that the arctangent function naturally restricts theta to the interval ##(-\pi/2, \pi/2)##, and that the modulo operation is used to adjust the angle to the desired range.
  • There is a mention of using software to compute angles based on the signs of A and B, which adds complexity to the error analysis.
  • Participants express uncertainty about the impact of series expansion errors in the functions used for computing theta and whether these can be considered negligible compared to the errors in A and B.

Areas of Agreement / Disagreement

Participants express differing views on the validity of the uncertainty calculations and the implications of using the modulo operator. There is no consensus on how to handle the case when A is zero, and the discussion remains unresolved regarding the treatment of negative uncertainties and the significance of series expansion errors.

Contextual Notes

Limitations include potential misunderstandings of the mathematical expressions due to LaTeX formatting issues, as well as unresolved questions about the assumptions behind the error propagation formulas and the conditions under which they apply.

TheCanadian
Messages
361
Reaction score
13
Sorry if the answer is very simple, but I just had a question regarding error propagation when using a modulo operator in intermediate steps. For example, I have ## \theta = arctan(\frac {A}{B}) ## and then I do ## \theta ## % ##2\pi## (modulo ##2\pi##). This gives me an answer between ## [0,2\pi] ## instead of ##[-\pi,\pi]##. This new answer in this new range is the answer I want. Now, when I calculate ## \sigma_{\theta} ##, I get:

## \sigma_{\theta} = \frac{A/B * \sqrt{ (\sigma_{A}/A)^2 + (\sigma_{B}/B)^2}}{1 + (A/B)^2} ##

Firstly, I just want to confirm: is there anything wrong with my equation for ## \sigma_{\theta} ##?

Secondly, since I change theta itself from ##[-\pi,\pi]## to ## [0,2\pi] ##by arithmetic operations, is there any modifications to ## \sigma_{\theta} ## in this case?

Thirdly, this is just a general error propagation question (sorry, I'm a novice), but if you have constant noise (i.e. a constant error), in the computation of A/B such that ## \sigma_A = \sigma_B = 2 ##, then you have ## \sigma_{A/B} = \frac{A}{B}\sqrt{ (2/A)^2 + (2/B)^2}##, but if A = 0, then A/B = 0, but in that case, the denominator in the square root for error goes to infinity but the numerator still has 0...so how does one approach computing the error in such as case? Is ## \sigma_{A/B} = \frac{1}{B}\sqrt{ (2)^2}## valid in such a case (I just multiplied by A/A)?

Please let me know if I have any mistakes. Any advice is appreciated!
 
Last edited:
Physics news on Phys.org
TheCanadian said:
Sorry if the answer is very simple, but I just had a question regarding error propagation when using a modulo operator in intermediate steps. For example, I have ## \theta = arctan(\frac {A}{B}) ## and then I do ## \theta % 2\pi ##. This gives me an answer between ## [0,2\pi] ## instead of ##[-\pi,\pi]##. This new answer in this new range is the answer I want. Now, when I calculate ## \sigma_{\theta} ##, I get:

## \sigma_{\theta} = \frac{A/B * \sqrt{ (\sigma_{A}/A)^2 + (\sigma_{B}/B)^2}}{1 + (A/B)^2} ##

Firstly, I just want to confirm: is there anything wrong with my equation for ## \sigma_{\theta} ##?

Secondly, since I change theta itself from ##[-\pi,\pi]## to ## [0,2\pi] ##by arithmetic operations, is there any modifications to ## \sigma_{\theta} ## in this case?

Thirdly, this is just a general error propagation question (sorry, I'm a novice), but if you have constant noise (i.e. a constant error), in the computation of A/B such that ## \sigma_A = \sigma_B = 2 ##, then you have ## \sigma_{A/B} = \frac{A}{B}\sqrt{ (2/A)^2 + (2/B)^2}##, but if A = 0, then A/B = 0, but in that case, the denominator goes to infinity but the numerator still has 0...so how does one approach computing the error in such as case?

Please let me know if I have any mistaken. Any advice is appreciated!
Part of your LaTeX is broken, and I can't figure out how to correct it. In the next-to-last paragraph you have this: \frac{A/B * \sqrt{ (2/A)^2 + (2/B)^2}, which is malformed, due to missing several braces. What is it supposed to be? Should it agree with what you have in the 2nd paragraph?
 
Mark44 said:
Part of your LaTeX is broken, and I can't figure out how to correct it. In the next-to-last paragraph you have this: \frac{A/B * \sqrt{ (2/A)^2 + (2/B)^2}, which is malformed, due to missing several braces. What is it supposed to be? Should it agree with what you have in the 2nd paragraph?
I believe I fixed it. Is the error still appearing?
 
Mark44 said:
Part of your LaTeX is broken, and I can't figure out how to correct it. In the next-to-last paragraph you have this: \frac{A/B * \sqrt{ (2/A)^2 + (2/B)^2}, which is malformed, due to missing several braces. What is it supposed to be? Should it agree with what you have in the 2nd paragraph?

Also, if A < 0, then wouldn't ##σ_{A/B}## be negative, too? How exactly does that make sense (if I didn't mess up the formula).
 
TheCanadian said:
I believe I fixed it. Is the error still appearing?
It looks OK now.

TheCanadian said:
Sorry if the answer is very simple, but I just had a question regarding error propagation when using a modulo operator in intermediate steps. For example, I have ## \theta = arctan(\frac {A}{B})## and then I do ##\theta % 2\pi## (modulo 2πi). This gives me an answer between [0,2π] instead of [−π,π] . This new answer in this new range is the answer I want.
I'm not sure if this is valid. Since ##\theta = arctan(A/B)##, ##\theta## will naturally be an angle in the interval (−π/2, π/2), as that is the principal domain for the tangent function, to make it one-to-one, and thus invertible. Also, because you're taking the arctan of A/B, B can't be zero (implying that ##\theta## is −π/2 or π/2.
TheCanadian said:
Now, when I calculate ## \sigma_{\theta} ##, I get:

## \sigma_{\theta} = \frac{A/B * \sqrt{ (\sigma_{A}/A)^2 + (\sigma_{B}/B)^2}}{1 + (A/B)^2} ##

Firstly, I just want to confirm: is there anything wrong with my equation for ##\sigma_{\theta}## ?
 
Mark44 said:
It looks OK now.

I'm not sure if this is valid. Since ##\theta = arctan(A/B)##, ##\theta## will naturally be an angle in the interval (−π/2, π/2), as that is the principal domain for the tangent function, to make it one-to-one, and thus invertible. Also, because you're taking the arctan of A/B, B can't be zero (implying that ##\theta## is −π/2 or π/2.

Ahh yes. Sorry, this was done using a software package. Essentially, based on the sign of A and B, it will compute the angle for the proper quadrant in the interval [-##\pi##,##\pi##] and if B == 0, then there is an extra statement saying it is simply equal to −π/2 (or π/2). It is a simple arithmetic operation (e.g. +- 2##\pi##) depending on the sign of A and B. Based on this additional information, is there anything I should be looking into in my procedure? Errors in the functions themselves should be considered since they're based on series expansions, but is it wrong to assume these errors are also negligible for errors on A or B being approximately 2 (i.e. ##\sigma_{A (or B)} ≈ 2##, so much higher than the errors on the series expansions)?
 
Last edited:

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 22 ·
Replies
22
Views
2K
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
20
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K