def calc_HCO3t(O2t, CO2t, HCO3_init = 0, O2_init = 0, CO2_init = 0, PQ = 1):
    """
    Estimate the [HCO3-] at a given time during light illumination
    Physiol. Plant, 90, 1994, Badger eat 1994, equation(8)
    this estimation is based on n(HCO3- extracellular) >> n(HCO3- cellular)
    Parameters
    ----------
    O2t : float or array
        [O2] at timepoint(s) t.
    CO2t : float or array
        [CO2] at timepoint(s) t.
    HCO3_init : float, optional
        Initial (dark before turning on light) HCO3- concentration.
    O2_init : float, optional
        Initial [O2]. The default is 0.
    CO2_init : float, optional
         Initial [CO2]. The default is 0.
    PQ : float, optional
        photosynthetic quotient. ∆O2 = ∆DIC * PQ. The default is 1.
        
    Returns
    -------
    HCO3t : [HCO3-] at given time t, as one point or an array

    """
    HCO3t = HCO3_init + CO2_init - (O2t - O2_init)/PQ - CO2t
    #here the PQ is assumed as 1, at the begining of a light period, the PQ is 
    #harder to estimate due to the relative higher DIC uptake and lower O2 
    #evolution. At steady state, the value will be closer to true value.
    return HCO3t