System yielding incorrect values for Ottawa 20-30 sand standard
Opened this issue · 4 comments
When the settling tube system was first set up, in 2018, a mass-produced sand standard was analyzed. Results agreed with known grain size of the standard (20-30 ASTM is roughly 0.5 phi). However, when this standard was run again in 2019 and in 2020, the program yielded dramatically incorrect grain sizes (see figure). It is unclear why this is the case. It might be related to code tweaks done in 2019. @NWRichmond, do you have any ideas? I have read through the code and am stumped. I think the fundamental issue is related to how elapsed time is communicated or calculated -- the first arrival of grains on the weigh-plate recorded in "data_mass_timeseries" is earlier than the actual time it took for grains to hit the weigh-plate (as measured with a stop watch).
So sorry for the delay, @DrKatAllen! I just saw this issue.
Are you able to use the original code (from this repository) with the Ottawa 20-30 sand to reproduce the 2018 analysis? If so, then this would suggest that 2019 code tweaks may have introduced a bug. If not, then there could be equipment-related issues at play.
If you are able to reproduce the 2018 analysis with the original code from this repository, then if you push the 2019 code to GitHub, we can look at the diff between the two versions of the code code, which should make a bug a lot easier to spot.
To run the diff, we'll want the locally-changed (2019+) code to exist either as a fork of this repo, or as a non-master
branch. Once that code is pushed to GitHub, I can look at the diff and try to identify any likely candidates for the timer issues you described.
Hi @NWRichmond! No problem. Sorry for the even longer delay on my end in replying.
I would like to try to reproduce the 2018 analysis with the original code from this repository, as you suggest, but I don't know how. The code stored in "Legacy" is the old visual basic code, and I'm not sure how to access/find the 2018 code in an unaltered form. I'm a totally wet-behind-the-ears user of GitHub (and my Matlab skills are rusty and not very good to begin with), so either step by step instructions or a quick zoom-guided session would be deeply appreciated, if/when you have time time.
I've been doing some digging ... grain size results for standards are reasonable (in agreement with sieved and/or previously measured values) up until August 29, 2018. Somewhere between edits made on September 3, 2018 and February 4, 2019 is where the bug was introduced. My suspicion is that it's something within the function "collectMass" or "runSettlingTube," though I haven't been able to ferret it out yet. You did change the sampling interval from 0.2 to 0.1 seconds, but that was updated and propagated through all the code as "samplingInterval," so that shouldn't matter. (I changed it back to 0.2 and still had the same issue.)
I still think that somehow our timer is off by a factor of 2. Matlab's perception or record of time is consistently off. For example, when I tell it to collect data for 1 minute, it actually collects data for 2 minutes according to my stopwatch. This is why all our grains are detected as falling faster and being larger than they actually are. I'll do as you suggest and try to add my altered/commented code as a fork or non-master branch. Thanks.
@DrKatAllen I just created two Releases to make it easier (hopefully) to use different versions of the SedSettle code without needing to interact with git.
The Releases are:
- v1.0.0-rc.2018
- corresponds to 1f7295d, which was committed on Sep 17, 2018
- v1.0.0-rc.2019
- corresponds to 2c6b111, which was committed on Feb 4, 2019
If you go to visit either of those Release pages and download the zip
file:
, that should be an easy way to get up & running with the SedSettle code at a certain point in time.