Example #1
0
 def test_vegetation_carbon_input_tuple_2(self):
     Labile = Symbol("Labile")
     Leaf = Symbol("Leaf")
     Root = Symbol("Root")
     Wood = Symbol("Wood")
     gpp_to_labile = Symbol("gpp_to_labile")
     gpp_to_leaf = Symbol("gpp_to_leaf")
     gpp_to_root = Symbol("gpp_to_root")
     gpp_to_wood = Symbol("gpp_to_wood")
     d = {
         π™»πšŠπš‹πš’πš•πšŽ: gpp_to_labile,
         Leaf: gpp_to_leaf,
         𝚁𝚘𝚘𝚝: gpp_to_root,
         πš†πš˜πš˜πš: gpp_to_wood
     }
     u = InFluxesBySymbol(d)
     vcsv = VegetationCarbonStateVariableTuple((Labile, Leaf, Root, Wood))
     res = vegetation_carbon_input_tuple_2(u, vcsv)
     self.assertEqual(type(res), VegetationCarbonInputTuple)
Example #2
0
### Had to divide Respiration fluxes by state variables because the flux was not presented as a rate*state variable tuple.

t = TimeSymbol("t")

#    parameter_sets:
#        - "Original dataset of the publication":
#            values: {k_n: 0.5, omega: 0.8, epsilon_L: 0.35, epsilon_S: 0.1, epsilon_R: 0.55}
#            desc: Eastern US and Germany, cold broadleaf deciduous
#            doi: 10.1111/j.1365-2486.2004.00890.x

mvs = CMTVS(
    {
        BibInfo(  # Bibliographical Information
            name="CTEM",
            longName="Canadian Terrestrial Ecosystem Model",
            version="1",
            entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
            entryAuthorOrcid="0000-0002-0046-1160",
            entryCreationDate="21/1/2016",
            doi="10.1111/j.1365-2486.2004.00890.x",
            sym_dict=sym_dict),
        A,  # the overall compartmental matrix
        Input,  # the overall input
        t,  # time for the complete system
        x,  # state vector of the complete system
        #    VegetationCarbonInputScalar(u),
        # vegetation carbon partitioning.
        VegetationCarbonStateVariableTuple((C_L, C_S, C_R)),
    },
    bgc_md2_computers())
Example #3
0
            doi="10.5194/gmd-7-2015-2014",
            sym_dict=sym_dict),
        InFluxesBySymbol(h.combine(in_fl_c, in_fl_n)),
        OutFluxesBySymbol(h.combine(out_fl_c, out_fl_n)),
        InternalFluxesBySymbol(h.combine(internal_fl_c, internal_fl_n)),
        t,  # time for the complete system
        x,  # state vector of the complete system
        xc,  # state vector of the carbon sub system
        # from which the carbon fluxes and hence
        # the CarbonCompartMentalMatrix can be derived
        # (even though in this case it is given)
        # A_c,  # the carbon compartmental matrix
        # in_fl_c, #alternatively to the CarbonCompartmentalMatrix
        # out_fl_c,#
        # internal_fl_c,
        xn,  # state vector of the nitrogen sub system
        # from which the nitrogenfluxes and hence the nitrogen compartmental
        # matrix could be derived whence the computers for extraction the
        # nitrogen fluxes from the global fluxes have been implemented
        # NitrogenInFluxesBySymbol(in_fl_n),
        # NitrogenOutFluxesBySymbol(out_fl_n),
        # NitrogenInternalFluxesBySymbol(internal_fl_n),
        VegetationCarbonStateVariableTuple(
            (C_labile, C_bud, C_leaf, C_wood, C_root, C_labileRa)),
        # the following can be computed automatically
        # VegetationCarbonInputScalar(u),
        # vegetation carbon partitioning.
        # VegetationCarbonInputPartitioningTuple(b),
    },
    bgc_md2_computers())
Example #4
0
#    C_root: , #"g*m^{-2}"
#    C_wood: #"g*m^{-2}"
#})
#
#ntimes = NumericSimulationTimes(np.arange(, , ))

mvs=MVarSet({
    BibInfo(# Bibliographical Information
        name="CABLE",
        longName="CSIRO Atmosphere Biosphere Land Exchange", 
        version="1",
#        basedOn = "CASA'" # Fung et al. (2005) -> Need to look it up
        entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
        entryAuthorOrcid="0000-0002-0046-1160",
        entryCreationDate="14/3/2016",
        doi="10.5194/bg-7-2261-2010",
        sym_dict=sym_dict
        
    ),
    A,  # the overall compartmental matrix
    Input,  # the overall input
    t,  # time for the complete system
    x,  # state vector of the complete system
    VegetationCarbonInputScalar(u),
    # vegetation carbon partitioning.
    VegetationCarbonInputPartitioningTuple(b),
    VegetationCarbonStateVariableTuple((C_leaf, C_root, C_wood)),
#    np1
})

Example #5
0
        #        modApproach: process based,
        #        partitioningScheme: fixed,
        #        claimedDynamicPart: "no",
        #        spaceScale: global,
        #        #    unit: "1Β°",
        #        timeResolution: monthly,
        #        #    unit: month^{-1},
        #        bibtex: "@article{Luo2012TE,
        #                 address = {Berkeley},
        #                 author = {Yiqi Luo and Ensheng Weng and Yuanhe Yang},
        #                 booktitle = {Encyclopedia of Theoretical Ecology},
        #                 editor = {Alan Hastings and Louis Gross},
        #                 pages = {219-229},
        #                 publisher = {University of California Press},
        #                 title = {Ecosystem Ecology},
        #                 year = {2012}
        #                }",
        #
        #        abstract: "Ecosystem ecology is a subdiscipline of ecology that focuses on exchange of energy and materials between organisms and the environment. The materials that are commonly studied in ecosystem ecology include water, carbon, nitrogen, phosphorus, and other elements that organisms use as nutrients. The source of energy for most ecosystems is solar radiation. In this entry, material cy-cling and energy exchange are generally described before the carbon cycle is used as an example to illustrate our quantitative and theoretical understanding of ecosystem ecology.",
        sym_dict=sym_dict),
    A,  # the overall compartmental matrix
    Input,  # the overall input
    t,  # time for the complete system
    x,  # state vector of the complete system
    VegetationCarbonInputScalar(u),
    # vegetation carbon partitioning.
    VegetationCarbonInputPartitioningTuple(b),
    VegetationCarbonStateVariableTuple((C_f, C_w, C_r)),
    np1
})
Example #6
0
            entryAuthorOrcid="0000-0003-0009-4169",
            entryCreationDate="12/4/2018",
            doi="",
            sym_dict=sym_dict
            #        bibtex= "@incollection{Luo2012TE,
            #                 Address = {Berkeley},
            #                 Author = {Yiqi Luo and Ensheng Weng and Yuanhe Yang},
            #                 Booktitle = {Encyclopedia of Theoretical Ecology},
            #                 Date-Added = {2015-05-05 15:20:40 +0000},
            #                 Date-Modified = {2015-05-05 15:20:40 +0000},
            #                 Editor = {Alan Hastings and Louis Gross},
            #                 Pages = {219-229},
            #                 Publisher = {University of California Press},
            #                 Title = {Ecosystem Ecology},
            #                 Year = {2012}}
            #                 abstract = {"Ecosystem ecology is a subdiscipline of ecology that focuses on exchange of energy and materials between organisms and the environment. The materials that are commonly studied in ecosystem ecology include water, carbon, nitrogen, phosphorus, and other elements that organisms use as nutrients. The source of energy for most ecosystems is solar radiation. In this entry, material cy-cling and energy exchange are generally described before the carbon cycle is used as an example to illustrate our quantitative and theoretical understanding of ecosystem ecology."}",
        ),
        B,  # the overall compartmental matrix
        Input,  # the overall input
        #InFluxesBySymbol()
        t,  # time for the complete system
        x,  # state vector of the complete system
        VegetationCarbonInputScalar(u),
        VegetationCarbonInputPartitioningTuple(b),
        VegetationCarbonStateVariableTuple((C_foliage, C_roots, C_wood)),
        np1,
        nsv1,
        ntimes
    },
    bgc_md2_computers())
Example #7
0
    W_s: 100,
    W_r: 100,
    W_C: 45,
    W_N: 30
})
ntimes = NumericSimulationTimes(np.arange(0, 150, 25))
#ntimes = NumericSimulationTimes(np.arange(0, 1, 0.001)) #Fixme: There were 2 in the yaml file, not sure which one works best

mvs = MVarSet({
    BibInfo(  # Bibliographical Information
        name="",
        longName="",
        version="1",
        entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
        entryAuthorOrcid="0000-0002-0046-1160",
        entryCreationDate="29/7/2015",
        doi="10.1093/oxfordjournals.aob.a088273",
        sym_dict=sym_dict),
    A,  # the overall compartmental matrix
    Input,  # the overall input
    t,  # time for the complete system
    x,  # state vector of the complete system
    VegetationCarbonInputScalar(b),
    # vegetation carbon partitioning.
    VegetationCarbonInputPartitioningTuple(u),
    VegetationCarbonStateVariableTuple((W_N, W_C, W_p, W_s, W_r)),
    np1,
    nsv1,
    ntimes
})
Example #8
0
#    # time_unit=day
#)
#nsv1 = NumericStartValueDict({
#    F: , #"Mg/ha"
#    W: , #"Mg/ha"
#    R: #"Mg/ha"
#})
#
#ntimes = NumericSimulationTimes(np.arange(, , ))

mvs = MVarSet({
    BibInfo(  # Bibliographical Information
        name="G'DAY",
        longName="Generic Decomposition and Yield",
        version="1",
        entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
        entryAuthorOrcid="0000-0002-0046-1160",
        entryCreationDate="27/1/2016",
        doi="10.2307/1942099",
        sym_dict=sym_dict),
    A,  # the overall compartmental matrix
    Input,  # the overall input
    t,  # time for the complete system
    x,  # state vector of the complete system
    VegetationCarbonInputScalar(u),
    # vegetation carbon partitioning.
    VegetationCarbonInputPartitioningTuple(b),
    VegetationCarbonStateVariableTuple((F, W, R)),
    #    np1
})
Example #9
0
            entryAuthor="Carlos A. Sierra",
            entryAuthorOrcid="0000-0003-0009-4169",
            entryCreationDate="12/4/2018",
            doi="",
            sym_dict=sym_dict
            #        bibtex= "@incollection{Luo2012TE,
            #                 Address = {Berkeley},
            #                 Author = {Yiqi Luo and Ensheng Weng and Yuanhe Yang},
            #                 Booktitle = {Encyclopedia of Theoretical Ecology},
            #                 Date-Added = {2015-05-05 15:20:40 +0000},
            #                 Date-Modified = {2015-05-05 15:20:40 +0000},
            #                 Editor = {Alan Hastings and Louis Gross},
            #                 Pages = {219-229},
            #                 Publisher = {University of California Press},
            #                 Title = {Ecosystem Ecology},
            #                 Year = {2012}}
            #                 abstract = {"Ecosystem ecology is a subdiscipline of ecology that focuses on exchange of energy and materials between organisms and the environment. The materials that are commonly studied in ecosystem ecology include water, carbon, nitrogen, phosphorus, and other elements that organisms use as nutrients. The source of energy for most ecosystems is solar radiation. In this entry, material cy-cling and energy exchange are generally described before the carbon cycle is used as an example to illustrate our quantitative and theoretical understanding of ecosystem ecology."}",
        ),
        B,  # the overall compartmental matrix
        Input,  # the overall input
        t,  # time for the complete system
        x,  # state vector of the complete system
        VegetationCarbonInputScalar(u),
        VegetationCarbonInputPartitioningTuple(b),
        VegetationCarbonStateVariableTuple((x_1, x_2, x_3)),
        np1,
        nsv1,
        ntimes
    },
    bgc_md2_computers())
Example #10
0
A = CompartmentalMatrix(diag(-1 / tau_il, -1 / tau_is, -1 / tau_ir))
t = TimeSymbol("t")

#model_run_data:
#    parameter_sets:
#        - "Tropical evergreen trees":
#            values: {a_il: 0.25,a_is: 0.5,a_ir: 0.25}

mvs = CMTVS(
    {
        BibInfo(  # Bibliographical Information
            name="IBIS",
            longName="Integrated Biosphere Simulator",
            version="1",
            entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
            entryAuthorOrcid="0000-0002-0046-1160",
            entryCreationDate="26/1/2016",
            doi="10.1029/96GB02692 ",
            #further_references=BibInfo(doi=""),
            sym_dict=sym_dict),
        A,  # the overall compartmental matrix
        Input,  # the overall input
        t,  # time for the complete system
        x,  # state vector of the complete system
        VegetationCarbonInputScalar(u),
        # vegetation carbon partitioning.
        VegetationCarbonInputPartitioningTuple(b),
        VegetationCarbonStateVariableTuple((C_il, C_is, C_ir)),
    },
    bgc_md2_computers())
Example #11
0
        #         π™»πš’πšπšπšŽπš›: πšπš’πš›πšŽβŽ―πšŽπš–βŽ―πš•πš’πšπšπšŽπš› + πš‘πšŽπšπš›πšŽπšœπš™βŽ―πš•πš’πšπšπšŽπš›,
        #         πš‚πš˜πš’πš•: πšπš’πš›πšŽβŽ―πšŽπš–βŽ―πšœπš˜πš– + πš‘πšŽπšπš›πšŽπšœπš™βŽ―πšœπš˜πš–
        #     }
        # ),
        InternalFluxesBySymbol(
            {
                (Symbol(name_tup[0]),Symbol(name_tup[1])): sum([ Symbol(flux) for flux in val])
                for name_tup, val in ms.horizontal_structure.items()
            }
        ),
        # direct description would be
        # InternalFluxesBySymbol(
        #     {
        #         (π™»πšŠπš‹πš’πš•πšŽ, π™»πšŽπšŠπš): πš•πšŠπš‹πš’πš•πšŽβŽ―πšπš˜βŽ―πšπš˜πš•πš’πšŠπš›,
        #         (π™»πšŠπš‹πš’πš•πšŽ, π™»πš’πšπšπšŽπš›): πšπš’πš›πšŽβŽ―πš•πšŠπš‹πš’πš•πšŽβŽ―πšπš˜βŽ―πš•πš’πšπšπšŽπš›,
        #         (π™»πšŽπšŠπš, π™»πš’πšπšπšŽπš›): πšπš’πš›πšŽβŽ―πšπš˜πš•πš’πšŠπš›βŽ―πšπš˜βŽ―πš•πš’πšπšπšŽπš› + πš•πšŽπšŠπšβŽ―πšπš˜βŽ―πš•πš’πšπšπšŽπš›,
        #         (πš†πš˜πš˜πš, πš‚πš˜πš’πš•): πšπš’πš›πšŽβŽ―πš πš˜πš˜πšβŽ―πšπš˜βŽ―πšœπš˜πš– + πš πš˜πš˜πšβŽ―πšπš˜βŽ―πšœπš˜πš’πš•πšŒ,
        #         (𝚁𝚘𝚘𝚝, π™»πš’πšπšπšŽπš›): πšπš’πš›πšŽβŽ―πš›πš˜πš˜πšβŽ―πšπš˜βŽ―πš•πš’πšπšπšŽπš› + πš›πš˜πš˜πšβŽ―πšπš˜βŽ―πš•πš’πšπšπšŽπš›,
        #         (π™»πš’πšπšπšŽπš›, πš‚πš˜πš’πš•): πšπš’πš›πšŽβŽ―πš•πš’πšπšπšŽπš›βŽ―πšπš˜βŽ―πšœπš˜πš– + πš•πš’πšπšπšŽπš›βŽ―πšπš˜βŽ―πšœπš˜πš–
        #     }
        # ),
        t,  # time symbol
        x,  # state vector of the complete system
        # VegetationCarbonInputScalar(gpp), # ? not sure see ticket
        # vegetation carbon partitioning.
        # VegetationCarbonInputPartitioningTuple(b),
        VegetationCarbonStateVariableTuple((Labile, Leaf, Root, Wood)),
    },
    bgc_md2_computers()
)
Example #12
0
        Phi_0: 2500,  #"MJ*m*^{-2}*year^{-1}" 
        omega: 5,  #"m*^2*kg^{-1}"
        gamma_r: 2,  #"kg^{-1}"
        gamma_f: 0.5
    },  #"kg^{-1}"
    func_dict=frozendict({}))

mvs = MVarSet({
    BibInfo(  # Bibliographical Information
        name="",
        longName="",
        version="1",
        entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
        entryAuthorOrcid="0000-0002-0046-1160",
        entryCreationDate="29/7/2015",
        doi="10.1093/treephys/12.2.119",
        sym_dict=sym_dict),
    #
    # the following variables constitute the compartmental system:
    #
    A,  # the overall compartmental matrix
    Input,  # the overall input
    t,  # time for the complete system
    x,  # state vector of the complete system
    VegetationCarbonInputScalar(u),
    # vegetation carbon partitioning.
    VegetationCarbonInputPartitioningTuple(b),
    VegetationCarbonStateVariableTuple((F, R, W)),
    np1
})
Example #13
0
    },
    #Q_i: 1 when light is highly available (See sup. material 1, pg 17)
    func_dict=frozendict({}))

mvs = CMTVS(
    {
        BibInfo(  # Bibliographical Information
            name="aDGVM",
            longName="",
            version="",
            #       modApproach= "individuals based"
            entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
            entryAuthorOrcid="0000-0002-0046-1160",
            entryCreationDate="17/7/2015",
            doi="10.1111/j.1365-2486.2008.01838.x",
            sym_dict=sym_dict),
        B,  # the overall compartmental matrix
        Input,  # the overall input
        t,  # time for the complete system
        x,  # state vector of the complete system
        VegetationCarbonInputScalar(u),
        # vegetation carbon partitioning.
        VegetationCarbonInputPartitioningTuple(b),
        VegetationCarbonStateVariableTuple((B_L, B_R, B_S)),
        # fixme mm 01-20-2022 the parameterization is incomplete error: The
        # following free symbols: {gamma_f, gamma_r, gamma_w} of the
        # expression: {gamma_f, gamma_r, gamma_w} are not arguments.
        #np1,
    },
    bgc_md2_computers())
Example #14
0
x = StateVariableTuple((C_L, C_R, C_stem))
u = F_Cgrowth
beta = (alpha_L, alpha_R, alpha_stem)
alpha_L = 1 - (alpha_R + alpha_stem)
Input = InputTuple(u * ImmutableMatrix(beta))
B = CompartmentalMatrix([[-(k_L + (m_stem / C_stem)), 0, 0],
                         [0, -(k_R + (m_stem / C_stem)), 0], [0, 0, -m_stem]])

mvs = CMTVS(
    {
        BibInfo(  # Bibliographical Information
            name="HAVANA",
            longName=
            "Hydrology and Vegetation-dynamics Algorithm for Northern Australia",
            version="1",
            entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
            entryAuthorOrcid="0000-0002-0046-1160",
            entryCreationDate="",
            doi="10.5194/bg-13-761-2016",
            sym_dict=sym_dict),
        B,  # the overall compartmental matrix
        Input,  # the overall input
        t,  # time for the complete system
        x,  # state vector of the complete system
        #    VegetationCarbonInputScalar(u),
        # vegetation carbon partitioning.
        #    VegetationCarbonInputPartitioningTuple(beta),
        VegetationCarbonStateVariableTuple((C_L, C_R, C_stem)),
    },
    bgc_md2_computers())
Example #15
0
# of sum(Iv) where Iv is the input to the vegetation pools (VegetationCarbonInputTuple)
# my take would actually be:
#u = VegetationCarbonInputScalar(
#    Piecewise((GPP,NPP<0),(NPP,NPP>=0))
#)
#b = VegetationCarbonInputPartitioningTuple(
#    (
#        Piecewise((Allo_fact_leaf-R_leaf/GPP,NPP<0),(Allo_fact_leaf,NPP>=0)),
#        Piecewise((Allo_fact_stem-R_stem/GPP,NPP<0),(Allo_fact_stem,NPP>=0)),
#        Piecewise((Allo_fact_roots-R_roots/GPP,NPP<0),(Allo_fact_roots,NPP>=0))
#    )
#)
#Input = InputTuple(b*u)
Input = InputTuple((a_L, a_S, a_R))

vcsvt = VegetationCarbonStateVariableTuple((C_leaf, C_stem, C_roots))
A = CompartmentalMatrix([[-(r_n + r_w + r_t), 0, 0],
                         [0, -(1 / (Y_stem * 365)), 0],
                         [0, 0, -(1 / (Y_roots * 365))]])
t = TimeSymbol("t")

mvs = CMTVS(
    {
        BibInfo(  # Bibliographical Information
            name="ISAM",
            longName="Integrated Science Assessment Model",
            version="",
            entryAuthor="VerΓ³nika Ceballos-NΓΊΓ±ez",
            entryAuthorOrcid="0000-0002-0046-1160",
            entryCreationDate="3/5/2018",
            doi="10.1111/j.1365-2486.2004.00890.x",