CIRDLES / Squid

Squid3 is being developed by the Cyber Infrastructure Research and Development Lab for the Earth Sciences (CIRDLES.org) at the College of Charleston, Charleston, SC and Geoscience Australia as a re-implementation in Java of Ken Ludwig's Squid 2.5. - please contribute your expertise!
http://cirdles.org/projects/squid/
Apache License 2.0
12 stars 27 forks source link

some expressions need to be NU switched to work properly #725

Closed NicoleRayner closed 2 years ago

NicoleRayner commented 2 years ago

Using version 10.3

If I make an expression like "Ln(206/238)" and save it in custom expressions, the value shown in the "peek" is not the correct one (it just returns the value of the measured ratio). image If I make it "NU-switched" though, THEN it seems to take and actually do the required operation: image

I noticed this also happens (different values when NU switched) if I use other simple math functions/operations like exponent or addition involving ratios + uncertainties, I am not sure where the line is drawn such that the NU-switch is required for it to work. Is it only when the NU-switch becomes accessible (as not every expression gives you the option to do it).

bowring commented 2 years ago

@NicoleRayner - good catch. The math is correct under the hood, but the peek and reporting lookup had a bug for this special case introduced as a side-effect of an earlier fix for 'aliased' expressions. This is fixed in the next release v1.10.4.

Also, if you use Squid3 to write ln(["206/238"]), it calculates the log of the ratio and when NU-switched performs the Squid2-based interpolation math to generate a slightly different value - see. The NU switch is only available for expressions containing "ratios of interest", i.e. the ratios specified by the task and listed on the left of the expression manager under "Ratios with uncertainties". Squid3 usurped the meaning of "NU" for this purpose. Generally, the Squid2 excel tasks had the expressions with ratios of interest flagged with the NU switch true. Squid3 makes this an explicit choice with the NU switch.

So, as shown in the link above, these expressions have "ratios of interest" and can be "NU-switched" to generate uncertainties (with the switch off, only the value is calculated):

ln(["254/238"])  
ln(["206/238"])  
["206/238"]/["254/238"]^2
["238/196"]/["254/238"]^0.66  
(0.03446*["254/238"]+0.868)*["248/254"]