Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
1

Propagation of uncertainty

asked 11 years ago

TobiMarg gravatar image

updated 11 years ago

Is there any simple method in sage to do a calculation with uncertainties? Something like this: (10±2)(3±1)=(30±18). Or with a more "sophisticated" formula: (30±11.67) because of (10×3×(2/10)2+(1/3)2=11.67). Both ways are taken from here, but the second way is also described on wikipedia.


To do such calculations I have already seen a method using RIF's like the following:

R=RIF(8,12)*RIF(2,4)
R.str(error_digits=2); R.lower(); R.upper(); R.center()

Which outputs:

32.?16
16.0000000000000
48.0000000000000
32.0000000000000

But with as one can see the center result is 32 (16+482) instead of 30 (103). Also I think it is a bit complex, because one has to calculate the upper an lower limits before, instead of a simple thing like:

uncertain(10,2)

(And as last point, I think result with the question mark is not very nice)


If one of my calculations is wrong please let me know, because I am new to error calculations.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 11 years ago

tmonteil gravatar image

updated 11 years ago

Your approach with RIF is the right one.

You should understand that the product of the middles is usually not equal to the middle of the products, not every map is flat! Actually, the result 32±16 given by RIF is more accurate than your 30±18, since the interval [16,48] is strictly contained in the interval [12,48], and both are valid results.

The result using the "sophisticated" formula is wrong: the smallest product between 10±2 and 3±1 is 8×2=16, and is smaller than 3011.67=18.33. It uses a truncated Taylor estimation, so it can only be used to have a quick rough estimate of the error, not a guaranteed upper bound, see the Caveats and warnings section.

If you want to use custom functions instead of RIF defaults, you can define:

sage: uncertain = lambda value, error : RIF(value-error, value+error)
sage: value_error = lambda r : (r.center(), r.absolute_diameter()/2)

Then you can do:

sage: R = uncertain(10,2) * uncertain(3,1)
sage: value_error(R)
(32.0000000000000, 16.0000000000000)
Preview: (hide)
link

Comments

Thank you for your answer. To the second point (wrong method/calculation): I haven't read the whole Wikipedia article, because I got it first from the other site. Thanks for pointing that out. Also your "custom functions" are really nice.

TobiMarg gravatar imageTobiMarg ( 11 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 1,221 times

Last updated: Oct 26 '13