The BioCro C++ Library
eC4photo.cpp
Go to the documentation of this file.
1#include <cmath>
2#include "eC4photo.h"
3#include "../framework/constants.h" // for celsius_to_kelvin, ideal_gas_constant
4
5double eC4photoC(
6 double QP,
7 double TEMP,
8 double CA,
9 double OA,
10 double VCMAX,
11 double VPMAX,
12 double VPR,
13 double JMAX)
14{
15 const double gs = 3 * 1e-3;
16 /* mol m-2 s-1 physical conductance to CO2 leakage*/
17 /* const double gammaStar = 0.000193 */
18 const double gammaStar = 0.0002239473;
19 /* half the reciprocal of Rubisco specificity */
20 /* const double go = 0.047 * gs at 25 C */
21 const double alpha = 0.01; /* alpha in the notes*/
22 const double Kp = 80; /* mu bar */
23 const double theta = 0.7;
24 const double R = physical_constants::ideal_gas_constant * 1e-3; // kJ K^-1 mol^-1
25
26 /* ADDING THE TEMPERATURE RESPONSE FUNCTION */
27 const double Ep = 47.1; /* Activation energy of PEPc kj/mol */
28 const double Erb = 72; /* Activation energy of Rubisco kj/mol */
29 /* const double Q10bf = 1.7 */
30 const double EKc = 79.43;
31 const double EKo = 36.38;
32 const double Q10cb = 1.7;
33
34 const double Ko2 = 532.9; /* mbar at 25 C */
35 const double Kc2 = 1020; /* mu bar at 25 C */
36
37 double Vcmax, Vpmax;
38 double Kc, Ko;
39 double Aj, Ac, A;
40
41 double Ca = CA;
42 double Oa = OA;
43 double Vcmax1 = VCMAX;
44 double Vpmax1 = VPMAX;
45 double Vpr = VPR;
46 double Jmax1 = JMAX;
47
48 double Idir = QP;
49 double AirTemp = TEMP;
50
51 double Q10p = exp(Ep * (1 / (R * 298.15) - 1 / (R * (AirTemp + conversion_constants::celsius_to_kelvin))));
52 double Q10rb = exp(Erb * (1 / (R * 298.15) - 1 / (R * (AirTemp + conversion_constants::celsius_to_kelvin))));
53 double Q10Kc = exp(EKc * (1 / (R * 298.15) - 1 / (R * (AirTemp + conversion_constants::celsius_to_kelvin))));
54 double Q10Ko = exp(EKo * (1 / (R * 298.15) - 1 / (R * (AirTemp + conversion_constants::celsius_to_kelvin))));
55
56 Vcmax = Vcmax1 * Q10rb;
57 Kc = Kc2 * Q10Kc;
58 Ko = Ko2 * Q10Ko;
59 Vpmax = Vpmax1 * Q10p;
60 double Jmax_at_25 = Jmax1 * pow(Q10cb, (AirTemp - 25) / 10);
61
62 double Cm = 0.4 * Ca;
63 double Om = Oa;
64
65 double RL = 0.08;
66 double Rm = 0.5 * RL;
67
68 /* Light limited */
69 double I2 = (Idir * 0.85) / 2;
70 double J = (Jmax_at_25 + I2 - sqrt(pow(Jmax_at_25 + I2, 2) - 4 * theta * I2 * Jmax_at_25)) / 2 * theta;
71 double Aj0 = 0.4 * J - Rm + gs * Cm;
72 double Aj1 = (1 - 0.4) * J / 3 - RL;
73
74 if (Aj0 < Aj1) {
75 Aj = Aj0;
76 } else {
77 Aj = Aj1;
78 }
79
80 /* Other part */
81 double Vp = (Cm * Vpmax) / (Cm + Kp);
82 if (Vpr < Vp) {
83 Vp = Vpr;
84 }
85
86 /* Alternative formula */
87 double Ko1 = Ko * 1e3;
88 double Om1 = Om * 1e3;
89
90 double a1 = 1 - alpha / 0.047 * Kc / Ko1;
91 double b1 = -((Vp - Rm + gs * Cm) + (Vcmax - RL) +
92 gs * (Kc * (1 + Om1 / Ko1)) + ((alpha / 0.047) * (gammaStar * Vcmax + RL * Kc / Ko1)));
93 double c1 = (Vcmax - RL) * (Vp - Rm + gs * Cm) - (Vcmax * gs * gammaStar * Om1 + RL * gs * Kc * (1 + Om1 / Ko1));
94
95 double c3 = pow(b1, 2) - 4 * a1 * c1;
96 if (c3 < 0) {
97 c3 = 0;
98 }
99 double Ac0 = (-b1 - sqrt(c3)) / 2 * a1;
100
101 double AcLCO2 = (Cm * Vpmax / (Cm + Kp)) - Rm + gs * Cm;
102
103 if (Ac0 < AcLCO2) {
104 Ac = Ac0;
105 } else {
106 Ac = AcLCO2;
107 }
108
109 if (Aj < Ac) {
110 A = Aj;
111 } else {
112 A = Ac;
113 }
114
115 return A;
116}
double eC4photoC(double QP, double TEMP, double CA, double OA, double VCMAX, double VPMAX, double VPR, double JMAX)
Definition: eC4photo.cpp:5