Error margins
|
11-09-2024, 09:05 PM
Post: #21
|
|||
|
|||
RE: Error margins
(10-27-2024 01:45 PM)Maximilian Hohmann Wrote: Hello, Interesting. A related idea is "inverval arithmetic". The basic idea is to have arithmetic on intervals Low...High, where you do computations on Low rounding down, and on High rounding up. Getting this right is quite difficult. Consider something as simple as the sin() function. Internally, this is implemented with a number of alternating additions and subtractions, and depending on the sign, figuring out how you need to setup your rounding is not a trivial problem. Also, since these functions are periodic, as soon as the input interval is wider than 2π, the only valid output is -1...1 which is not super useful. Digit cancellation is problematic. And so on. There is a reason error analysis in real life is hard ;-) Quote:Now wouldn't it be useful if the calculator could "propagate" that error through all the calculations done with data of this type and, combined with the other input data and their own error margins, give an end result that contains the total error margin? Again, this may already exist in some form, but I have yet so see it. DB48X,HP,me |
|||
11-11-2024, 10:18 AM
(This post was last modified: 11-12-2024 06:03 AM by Csaba Tizedes.)
Post: #22
|
|||
|
|||
RE: Error margins
(10-27-2024 01:45 PM)Maximilian Hohmann Wrote: Now wouldn't it be useful if the calculator could "propagate" that error through all the calculations done with data of this type and, combined with the other input data and their own error margins, give an end result that contains the total error margin? Hello, here is a full set of programs for HP-32SII for handling numbers with errors (for help for error propagation calculations) - written approx quarter century before I hope you're not ignored because it is full Hungarian just nJoy! Your problem solved - almost, because these routines for one-step operations only. https://drive.google.com/file/d/0B1AqWV7...TTMsEVUD4Q Csaba |
|||
11-11-2024, 11:41 AM
Post: #23
|
|||
|
|||
RE: Error margins
(11-09-2024 09:05 PM)c3d Wrote: Interesting. A related idea is "inverval arithmetic". The basic idea is to have arithmetic on intervals Low...High, where you do computations on Low rounding down, and on High rounding up. Packages for RPN x42 (uprop, see above), Python (uncertainties), Julia (Measurements.jl) are using same assumptions and simplifications as described in "Guide to the Expression of Uncertainty in Measurement" (GUM) and shortly summarized in https://en.wikipedia.org/wiki/Propagatio...lification. Your comment on sin function is true. Some comments in uncertainties/umath_core.py are insightful: Quote:######################################## (btw: sin is key of fixed_derivatives dictionary) Because db48x supports derivation and different datatypes, it would be a question how to define a custom data type, if 'uprop' needs to be programmed with RPL. |
|||
11-11-2024, 12:10 PM
Post: #24
|
|||
|
|||
RE: Error margins
(11-09-2024 09:05 PM)c3d Wrote: There is a reason error analysis in real life is hard ;-) We assumed *all* variables are independent, which may not be true. With complicated expression, assumption of independence may not hold. Example: x / x = 1, exactly, not possibly doubled x errors. Equivalent expressions may give very different estimated errors. lua> D = require'dual'.D lua> D.sum = D.sum2 -- quadrature sum lua> R1, R2 = D.new(3,4), D.new(5,6) lua> pprint(1/(1/R1+1/R2)) { 1.875, 1.7757590806469215 } lua> pprint(R1*R2/(R1+R2)) { 1.875, 3.764165951774709 } |
|||
11-11-2024, 12:46 PM
(This post was last modified: 11-11-2024 03:02 PM by raprism.)
Post: #25
|
|||
|
|||
RE: Error margins
(11-11-2024 12:10 PM)Albert Chan Wrote:(11-09-2024 09:05 PM)c3d Wrote: There is a reason error analysis in real life is hard ;-) Do you mean x/y = const+-0, because x and y are strictly correlated (+1)? Some mitigation might be to check for correlations (if derived from data sets in calc) with warnings, apply corrections for correlations. For the other example I would say that using multimeters and resistors with real life characteristics helps a lot ;-) Edit: With proper derivative calculations also for your example the result is 1.875+/-1.776 irrespective of expression variants. Simple to use tools/libraries with support of units and uncertainties are still great for quick calculations in labs. For more sophistication one could also use Monte Carlo simulations (see e.g. mcerp Python package). |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)