Closed rjhanes closed 4 years ago
in feedstockarray branch, prior to merging pull request
in master branch after merging pull request
this bug first appeared in commit d6ace32
sample results:
latest-commit
is with commodity sugar feedstock, latest-commit-local
is with corn stover feedstock (smoothed NPV deviation is the one with the floating point error)
latest-commit
is commodity sugar, latest-commit-local
is perennial (floating point error occurs earlier than with corn stover):
calculation structure:
@rjhanes, this was caused by the argument of the SQRT
function in smoothed NPV deviation
becoming very slightly negative due to round-of errors. In 3283715757cf34dba74d5a4def8e9075b8fbaea3, I added a guard against this. I also reviewed the code and found no other uses of SQRT
.
Please retest a couple of the problematic cases to verify that this change fixes all of them. (Because some of the round-off errors didn't appear on my Windows VM, I couldn't test every case you mentioned as being problematical. I mostly focused on testing the perennial case with RK4 auto.)
I verified that under default model settings, corn stover and generic perennial are both error-free
this bug appeared after solving issue #23 in branch feedstockarray