Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Propagation of uncertainty

Is there any simple method in sage to do a calculation with uncertainties? Something like this: $10\pm2 * 3\pm1 = 30\pm18$. Or with a more sophisticated formula: $30\pm11.67\quad(10 \times 3 \times \sqrt{(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$ ($\frac{16+48}{2}$) instead of $30$ ($10*3$). 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)

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

Propagation of uncertainty

Is there any simple method in sage to do a calculation with uncertainties? Something like this: $10\pm2 $(10\pm2) * 3\pm1 (3\pm1) = 30\pm18$. (30\pm18)$. Or with a more sophisticated formula: $30\pm11.67\quad(10 $(30\pm11.67)$ because of $(10 \times 3 \times \sqrt{(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$ ($\frac{16+48}{2}$) instead of $30$ ($10*3$). 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)

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

Propagation of uncertainty

Is there any simple method in sage to do a calculation with uncertainties? Something like this: $(10\pm2) * (3\pm1) = (30\pm18)$. Or with a more sophisticated "sophisticated" formula: $(30\pm11.67)$ because of $(10 \times 3 \times \sqrt{(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$ ($\frac{16+48}{2}$) instead of $30$ ($10*3$). 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)

PS:


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