Readme: Xylem Network on Matlab

This post is meant as a guide to the Github code used in the research article published in Plant, Cell, & Environment. Access the code by clicking here.


There is a need to combine newly acquired knowledge on plant hydraulic tissue anatomy, physiology, and whole tissue hydraulic function. This model was developed to do just that for flowering plant xylem. In the following, user-defined Matlab classes are colored in blue. Details and assumptions not necessary to use the model are in italics.

In this model, a xylem network is composed of 2 elements: conduits and inter-conduit connections (ICCs). The modeled conduits are made of linear stacks of conduit elements (CEs) that have the same size and diameter. ICCs are common wall areas between conduits and, in other words, they represent the wall area that joins two conduits. This wall area is occupied by pit membranes and each membrane has hundreds of perforations called pores. In real plants, pit membranes are a porous medium formed by the stacking of tortuous filaments. The cavities or pores inside these pit membrane porous media allow the movement of water. For simplicity, pit membrane pores in this application are modeled as circular openings on an otherwise impermeable sheet, the pit membrane.

The model places the above defined elements on a grid of nodes. The rows (vertical direction) is reserved from conduits and CEs whereas the columns and the depths are reserved to ICCS. As such, the spacing of nodes in the vertical direction corresponds to physical distances representing conduit lengths. The column or depth spacing are virtual because when two conduits are joined, their walls touch and there’s no physical spacing between them. But to aid visualization of generated model xylem networks, these distances are retained. The figure below shows a two-dimensional example of a model xylem network

Example of a model xylem network. The conduits are vertical and colored black whereas ICCs are in red.

The process of network generation is described in more detail in a published article ( If you would like the PDF of that article please send me an email.

With the model generated, oen can:

  • Simulate the porous-medium hydraulic properties of the network
  • Simulate the process of embolism spread (as shown in the GIF below)
  • Analyse the nodes of the model network as a graph with edges defined either as CEs or ICCs
  • Analyse the conduits of the model network as nodes of a graph and ICCs as its edges.
GIF of the new flowering plant xylem network model showing the process of cavitation. Black vertical lines are vessels and red horizontal lines are intervessel connections (IVCs). \Delta P is the pressure difference between the water and the atmosphere. As the pressure difference increases, emboli propagate embolizing some vessels (cyan) and isolating others (magenta).

How to use

The following scripts a user may use to take advantage of the model without knowing its inner workings:

XylemNetIni.m: initializes a xylem network, pertinent parameters can be changed in that script. The detailed descriptions of parameters are included as comments in the code.

VCGen.m: allows you to compute the vulnerability curve associated with the generated xylem network.

Some recipes

Here we run the script to generate a three-dimensional xylem network


As written in the script, the xylem network is saved in a variable called ‘sim’ which we can visualize as follows

A three dimensional model xylem network. Again, black lines are conduits aligned in the vertical direction and red lines are ICCs.

Much can be learned from viewing each conduit as a node. This is especially important for studying the dynamics of embolism spread in the network. This particular network is saved as a xylem network property called ‘gCav’.

With this view, one might ask what is the number of neighboring conduits. In mathematical parlance, one would be asking about the degree distribution of the conduit network. We can extract a histogram plot of the probability density of the conduit degrees as follows

histogram(degree(sim.gCav), 'Normalization', 'pdf')
xlabel('conduit degree')
Degree distribution of the conduits shown in the above 3D visualization. The degree of a conduit is the number of other conduits it neighbors.

One might expect, in a randomly generated network of diffuse porous xylem, that the degree of a conduit is proportional to its length. We can inspect this relation as such

xlabel("conduit length (cm)")
ylabel("conduit degree")

One can similarly inspect the diameter of individual conduits as well as the conductive properties of the ICCs. Of interest for the physiological ecology of trees are the hydraulic properties of the network as a whole (the larger scale). To do this, we apply a (virtual) vertical pressure difference at the bottom and top of the network. Here, we’re going to apply a 1 MPa pressure difference.

[Fi,Fo,Ktot,~,~,~] = ...
compute_hydraulics(sim.gCond, 1e6, 0,...
 {sim.Dcross(1,:), sim.Dcross(2,:), sim.Dcross(3,:), sim.Dcross(4,:)})

%sim.Dcross stores the conduit diameters at four equidistant cross-sections of the network

The inlet flow (Fi) and outlet flow (Fo) are Fi = Fo = 0.0051 m3/s.
The conductance, defined as the flow rate divided by the pressure difference is K = 5.1e-09 m3/MPa/s.

One can generate a vulnerability to embolism curve (VC) too. The results of the below script are saved in a struct called mVC

plot(mVC.Pressures, mVC.PLC * 100)
xlabel("Pressure (MPa)")
ylabel("Percent loss of conductance (%)")

Please reach out to me using the email in the contact page. I would love to discuss what else is possible to model and inspect.

Published by Assaad Mrad

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: