Пример #1
0
# -

M_sym = A_sym * K_sym
M_sym

import CompartmentalSystems.helpers_reservoir as hr
hr.out_fluxes_by_symbol(sv, M_sym)

# we create a dictionary for the outfluxrates (flux divided by dono pool content)
outflux_rates = {
    "r_" + str(key) + "_rh": value / key
    for key, value in hr.out_fluxes_by_symbol(sv, M_sym).items()
}
internal_flux_rates = {
    "r_" + str(key[0]) + "_2_" + str(key[1]): value / key[0]
    for key, value in hr.internal_fluxes_by_symbol(sv, M_sym).items()
}
from copy import deepcopy
all_rates = deepcopy(outflux_rates)
all_rates.update(internal_flux_rates)
all_rates

# +
# and one for the internal fluxrates
# -

old_par_dict = {
    beta_leaf: 0.3,
    beta_wood: 0.4,
    Theta_sat: 0.1,
    Theta_fc: 0.2,
Пример #2
0
K_sym=ImmutableMatrix(
    n,n,
    lambda i,j: Symbol("k_" + str(sv[i])) if i==j else 0
)
K_sym
# -

M_sym=A_sym*K_sym
M_sym

import  CompartmentalSystems.helpers_reservoir as hr
hr.out_fluxes_by_symbol(sv,M_sym)

# we create a dictionary for the outfluxrates (flux divided by dono pool content)
outflux_rates = {"r_"+str(key)+"_rh":value/key for key,value in hr.out_fluxes_by_symbol(sv,M_sym).items()}
internal_flux_rates = {"r_"+str(key[0])+"_2_"+str(key[1]):value/key[0] for key,value in hr.internal_fluxes_by_symbol(sv,M_sym).items()}
from copy import  deepcopy
all_rates=deepcopy(outflux_rates)
all_rates.update(internal_flux_rates)
all_rates

# +
# and one for the internal fluxrates
# -

old_par_dict = {
    beta_leaf: 0.6,
    beta_wood: 0.25,
    T_0: 2,
    E: 4,
    KM: 10,
Пример #3
0
def carbon_internal_fluxes_by_symbol_1(
    cm: CarbonCompartmentalMatrix,
    svt: CarbonStateVariableTuple
) -> CarbonInternalFluxesBySymbol:
    return CarbonInternalFluxesBySymbol(hr.internal_fluxes_by_symbol(svt,cm))
Пример #4
0
def nitrogen_internal_fluxes_by_symbol_1(
    cm: NitrogenCompartmentalMatrix,
    svt: NitrogenStateVariableTuple
) -> NitrogenInternalFluxesBySymbol:
    return NitrogenInternalFluxesBySymbol(hr.internal_fluxes_by_symbol(svt,cm))
Пример #5
0
def internal_fluxes_by_symbol_1(
    cm: CompartmentalMatrix,
    svt: StateVariableTuple
) -> InternalFluxesBySymbol:
    return InternalFluxesBySymbol(hr.internal_fluxes_by_symbol(svt,cm))