예제 #1
0
    def test_creation(self):
        a, b, c = symbols('a b c')

        u = VegetationCarbonInputScalar(a)
        self.assertEqual(type(u), VegetationCarbonInputScalar)

        v = u.subs({a: b})
        self.assertEqual(type(v), VegetationCarbonInputScalar)

        u = VegetationCarbonInputScalar(1)
        self.assertEqual(type(u), VegetationCarbonInputScalar)
예제 #2
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))
예제 #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
})

예제 #4
0
#mvs.graph()
# -

mvs.get_InputTuple()

mvs.computable_mvar_types()

mvs.get_OutFluxesBySymbol()

it = mvs.get_VegetationCarbonInputTuple()
#mvs.get_InFluxesBySymbol()
#VegetationCarbonInputPartitioningTuple([tc/b for tc in it])

# +

VegetationCarbonInputScalar(sum(it))
# -

[t for t in mvs.provided_mvar_types]

# +
#for var in mvs.computable_mvar_types():
#    mvs.render(var)
# -

mvs.get_VegetationCarbonInputPartitioningTuple()

importlib.invalidate_caches()
mod2 = importlib.import_module(
    'bgc_md2.models.Haverd2016Biogeosciences.source')
mvs2 = mod2.mvs