Example #1
0
 def test_vegetation_carbon_input_tuple_1(self):
     for name in ("a_L", "a_S", "a_R"):
         var(name)
     u = VegetationCarbonInputScalar(sympify(1))
     b = VegetationCarbonInputPartitioningTuple((a_L, a_S, a_R))
     res_1 = u * b
     print(type(res_1))
Example #2
0
    def test_creation(self):
        a, b, c = symbols('a b c')
        In = VegetationCarbonInputPartitioningTuple((a, b))
        self.assertEqual(type(In), VegetationCarbonInputPartitioningTuple)

        J = In.subs({b: c})
        self.assertEqual(type(J), VegetationCarbonInputPartitioningTuple)

        In = VegetationCarbonInputPartitioningTuple((1, 1))
        self.assertEqual(type(In), VegetationCarbonInputPartitioningTuple)

        M = Matrix((1, 1))
        In = VegetationCarbonInputPartitioningTuple(M)
        self.assertEqual(type(In), VegetationCarbonInputPartitioningTuple)

        I1 = ImmutableMatrix(2, 1, [1, 3])
        I2 = ImmutableMatrix(2, 1, [1, 3])
        In = VegetationCarbonInputPartitioningTuple((I1+I2))
        self.assertEqual(type(In), VegetationCarbonInputPartitioningTuple)
        self.assertEqual(In[0, 0], 2)
        self.assertEqual(In[1, 0], 6)
Example #3
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 #4
0
 def test_immutability(self):
     T = VegetationCarbonInputPartitioningTuple([1, 0, 1, 0])
     with self.assertRaises(TypeError):
         T[1] = 1
Example #5
0
            #        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),
        CM,  # 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_1, b_2, b_3)),
        VegetationCarbonStateVariableTuple((x_1, x_2, x_3)),
        np1,
        nsv1
    },
    bgc_md2_computers())