Accuracy and error analysis (was Re: [Maxima] primes)
Subject: Accuracy and error analysis (was Re: [Maxima] primes)
From: Doug Stewart
Date: Fri, 13 May 2005 10:44:25 -0500
>I think Robert is correct - the useful thing to do is impliment it in a
>way that is useful for physical quantities, and warn when those
>quantities get small enough that precision issues start getting to be
>within a couple orders of magnitude of the quantities involved. For
>physical measurements the price of calculating error propagation MUST
>be paid, at least at the macroscopic error level - it is integral to
>getting a meaningful answer. As long as numerically induced errors are
>small relative to measurement error it's probably a moot point. There
>might even be some experimental way to evaluate the numerical error
>associated with a particular calculation - I'll have to check into it -
>
>
here is one way to do the Numerical error estimation of measurement error.
This is Octave code
r1=75.1
r2=99.3
r3=300
y=[ 0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
];
% the .05 is the +-5% error in the measurement
% If your measurement is accurate to 1% then use 0.01
for k=1:8
r11=r1+r1*.05*(-1)^y(k,1);
r22=r2+r2*.05*(-1)^y(k,2);
r33=r3+r3*.05*(-1)^y(k,3);
%r(k)=1/(1/(r11)+1/(r22)+1/(r33));
r(k)=r11*r22*r33;
end
range=max(r)-min(r)
rt=r1*r2*r3
range/2
rt*0.15
This code adds and subtracts the % error to each input and calculates
all possible combinations and then takes the largest and smallest
answers and gets a range.
This example is trivial because we know the total will be the sum of the
3 input ranges 5%+5%+5%=15%.
But for some complex formulas this would is the way that I get a handle
on the range of significant digits.
I have a book by D. C. Bard that I used in university
An Introduction to Measurement Theory and Experimental Design
I see that you can still get it on the Internet.
Doug Stewart
>but that's most likely the practical limit. Anyway, it's quite a ways
>down the line before such things become relevant - I've still got a
>fair bit of work on the unit package itself to do.
>
>CY
>
>_
>