Photosyn highly sensitive to negative g0 when using gsmodel = BallBerry

Issue #51 resolved
Kevin Wolz
created an issue

When using Phyosyn with gsmodel = BallBerry, supplying negative g0 often produces the following warning and results in NaNs in the output. It seems that the warning is being thrown from within the QUAD functions.

Photosyn(gsmodel = "BallBerry", g1 = 9, g0 = -0.03)

works fine, but the following does not:

Photosyn(gsmodel = "BallBerry", g1 = 9, g0 = -0.04)
 Ci ALEAF  GS ELEAF  Ac       Aj   Ap   Rd VPD Tleaf  Ca PPFD Patm
1 NA   NaN NaN   NaN NaN 13.80673 3000 0.92 1.5    25 400 1500  100
Warning message:
In sqrt(B * B - 4 * A * C) : NaNs produced

Comments (5)

  1. Kevin Wolz reporter

    Hah, the idea of negative g0 is a recurring philosophical conversation in our lab! Negative g0 is absolutely nonsensical, but our models are just empirical relationships not mechanistic models, so we tend to lie in the camp of not constraining g0 to be positive or fixing it to 0.

    Philosophy aside, the data supplied to Photosyn above are fits of actual leaves that came out of fitBB. I feel that if fitBB can produce a fit, then Photosyn should be able to run with it. Currently, fitBB does not have the capacity to constrain g0 to be positive, so fit fitg0 = TRUE, then this error situation is possible.

    I would suggest either (1) fixing the QUAD functions so this error is avoided, or (2) if philosophy prevails, then, when fitg0=TRUE in fitBB, constraining g0 to to be positive using nls options.

    I have no idea what's going on in those QUAD functions yet, but happy to take a look. Option 2 is likely simpler to implement, but also does change default functionality, which as you said is not good. A third option would be to add a new input to fitBB (posg0), which toggles the constraint of g0 to be positive. By default, posg0 can be FALSE, thereby not impacting default function behavior.

  2. Kevin Wolz reporter

    By the way, I have absolutely no experience with protocol on git repositories - sorry if re-opening this thread was not the right thing to do!

  3. Remko Duursma repo owner

    I disagree with this completely : a negative g0 is physically impossible and completely meaningless, not to mention the important fact that a solution to the quadratic simply does not exist when conductance < 0 (so fixing QUADP is not an option).

    It is important to separate the empirical nature of fitting the Ball-Berry model, and the strict biophysical constraints in the actual model. If empirical fittings can produce non-sensical results (which they can), it does not imply that the biophysical model should allow nonsense.

    There is a wider issue of negative g0 in fittings, and actually I am of the opinion we should not estimate g0 from regression (in fact I am working on a paper where I argue that).

  4. Log in to comment