traitecoevo / plant

Trait-Driven Models of Ecology and Evolution :evergreen_tree:
https://traitecoevo.github.io/plant
53 stars 20 forks source link

Optimisation (min or max) routine required for leaf-level water use model #336

Closed itowers1 closed 2 years ago

itowers1 commented 2 years ago

Hi team!

For the leaf-level water use model, we need to optimise a profit function such that the canopy stem water potential (psi_can) is found which maximises profit.

The profit function, in a simple notation, is as follows:

Profit(psi_can) = Benefit(psi_can) - Cost(psi_can)

There are different numerical methods, but we're leaning towards Golden-section search (https://en.wikipedia.org/wiki/Golden-section_search) or Brent's method (https://en.wikipedia.org/wiki/Brent%27s_method).

GSL code for minimisation can be found here (https://www.gnu.org/software/gsl/doc/html/min.html), and the GSL code more broadly, here (https://www.gnu.org/software/gsl/).

itowers1 commented 2 years ago

Manual solution for Golden-section search implemented, appears to work at this point.