avoid symbolic gradient derivation at Esat_slope

Issue #5 closed
Thomas Wutzler created an issue

Currently, the gradient of the Esag~Tair relationship is computed on each function call by symbolically computing the derivative of the relationship.

This relationship does not change with the inputs. Hence, I suggest to replace it by the code of the derivate:
L172: (https://bitbucket.org/juergenknauer/bigleaf/src/master/R/meteorological_variables.r#lines-172))

Delta <- eval(D(expression(a * exp((b * Tair) / (c + Tair))),name="Tair"))

by

Delta <- a * (exp((b * Tair)/(c + Tair)) * (b/(c + Tair) - (b * Tair)/(c + Tair)^2))

If ok with @juergenknauer, I can commit this change by directly editing in bitbucket web-interface.

Comments (3)

  1. Juergen Knauer repo owner

    Thanks @Thomas Wutzler for the suggestion. I am happy with your suggestion of committing this directly.

  2. Log in to comment