COMPASS-DOE / grossMethane

analysis code for paired data sets of laboratory-incubations of gross methane flux and associated field net methane and CO2 flux rates
1 stars 1 forks source link

'Fix' model (assuming mistakes in vF&H equation) #2

Closed bpbond closed 2 years ago

bpbond commented 2 years ago

This was really bugging me :)

Hi @kendalynnm - this PR (i) cleans up the code so it's more robust as a base to go forward, but more importantly (ii) changes the von Fischer and Hedin (2002) Equation 11 to correct for what I think are two mistakes:

The model fit now looks better:

optim

Note that the model passes exactly through the first timepoint. That's because that point is taken as t=0, so the various P and k values cancel out, producing the same observed value (AP{0}) every time.

bpbond commented 2 years ago

Two more graphs, kind of interesting. Here's the progress of the optimizer:

p1

And here are the different models it tried:

all