示例#1
0
    att: the bud (from which the leaf grows) has to have a kz
        one of the above + time dependant:
            constant across type: r.setKx([[kz1, kz2, kr3]], [[age1, age2, age3]])
            by type: r.setKxTables([[[kz1, kz2, kr3],[kza, kzb, krc]]], [[[age1, age2, age3], [agea, ageb, agec]]])
            by type and subtype: r.setKxTables([[[kz1, kz2, kr3],[kza, kzb, krc]],[[kz1, kz2, kr3],[kza, kzb, krc]]],
                    [[[age1, age2, age3], [agea, ageb, agec]],[[age1, age2, age3], [agea, ageb, agec]]])
"""

r.setKr([[kr],[kr_stem],[gs]]) 
r.setKx([[kz]])
r.airPressure = p_a
# p_out = r.get_outer_matpot_matix(p_s, p_a) #create matrix to have p_a outer pressure for stem/leaves and p_s outer pressure for roots.
leavenodes = r.get_nodes_index(4) #only takes for nodes of leaves

# Numerical solution 
r.node_ind = r.get_nodes_index(4)
r.seg_ind = r.get_segments_index(4)
rx = r.solve_dirichlet(sim_time=0., value=p0, sxc=0., sxx=[p_s], cells=True) #water matric pot given per segment
print("Transpiration", r.collar_flux(simtime, rx, [p_s], [], True),"cm3/day")

fluxes = r.segFluxes(simtime, rx, [p_s], False, True)  # cm3/day
print(fluxes)
print()

# plot results 
plt.plot(rx, nodes[:, 2] , "r*")
plt.xlabel("Xylem pressure (cm)")
plt.ylabel("Depth (cm)")
plt.title("Xylem matric potential (cm)")
plt.show()
示例#2
0
        by type and subtype: r.setKx([[kz, kz2], [kza, kzb], [kzd, kzf]])
    att: the bud (from which the leaf grows) has to have a kz
        one of the above + time dependant:
            constant across type: r.setKx([[kz1, kz2, kr3]], [[age1, age2, age3]])
            by type: r.setKxTables([[[kz1, kz2, kr3],[kza, kzb, krc]]], [[[age1, age2, age3], [agea, ageb, agec]]])
            by type and subtype: r.setKxTables([[[kz1, kz2, kr3],[kza, kzb, krc]],[[kz1, kz2, kr3],[kza, kzb, krc]]],
                    [[[age1, age2, age3], [agea, ageb, agec]],[[age1, age2, age3], [agea, ageb, agec]]])
"""

r.setKr([[kr], [kr_stem], [gs]])
r.setKx([[kz]])
r.airPressure = p_a

# Numerical solution
r.seg_ind = seg_tips  # segment indices for Neumann b.c.
r.node_ind = node_tips
rx = r.solve_neumann(sim_time=simtime, value=0, sxx=[p_s],
                     cells=True)  #water matric pot given per segment
fluxes = r.radial_fluxes(simtime, rx, [p_s], k_soil, True)  # cm3/day
r.summarize_fluxes(fluxes, simtime, rx, [p_s], k_soil,
                   True)  #r.segFluxes(simtime, rx, p_out, False)  # cm3/day

# plot results
plt.plot(rx, nodes[:, 2], "r*")
plt.xlabel("Xylem pressure (cm)")
plt.ylabel("Depth (cm)")
plt.title("Xylem matric potential (cm)")
plt.show()

plt.plot(fluxes, nodes[1:, 2], "r*")
plt.xlabel("Fluxes")