NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".

Try It in NetLogo Web


This model seeks to recapitulate population dynamics and productivity observed within a bioreactor producing xanthan gum, an important natural polysaccharide. Industrial bioreactors utilize _Xanthomonas campestris_ to produce xanthan gum to be used as a thickener and stabilizer in food, pharmaceutical, and cosmetic products.

Microbes within a substrate-limited environment experience competition, which constrains their population size. Additionally, there is the possibility the reactor becomes contaminated, which can reduce product yield or fully out-compete _X. campestris_. Other factors impacting the overall efficiency of the process include the increasing viscosity as xanthan gum accumulates, making it more difficult for microbes to acquire nutrition.


Different substrates can be explored, with varying energetic value to the cells. The model can simulate batch, fed-batch, or continuous culture conditions. The environment represents the medium conditions inside the bioreactor:

* Substrate available (green patches)
* Substrate depleted (gray patches)

There are up to two types of microbe represented:

* _X. campestris_ (yellow bug)
* Unknown contaminant (red wheel)

_X. campestris_ and the contaminant enact the following behaviors:

1. Cells move within the environment, as we are assuming the reactor is well-mixed.
-As cells move and time passes, the cells use energy for maintenance metabolism.
-When viscosity is considered, it takes more time to gather enough substrate for reproduction.
2. Cells eat substrate, giving themselves energy and depleting the medium.
-Contaminants could have varying levels of fitness, and thus could be more or less effective at converting substrate to energy, which is their budget for maintenance and reproduction.
3. Cells reproduce themselves when they have enough energy.
-In this model, reproduction is accompanied by xanthan gum production.
4. Cells die when they run out of energy.

This can be used as a closed batch or the observer can tamper with the environment by adding more substrate or perhaps contaminating the bioreactor while taking a sample.


1. You can set the initial population size of _X. campestris_ using the slider labeled "num-Xanthomonas"

2. Decide whether this reaction will start off contaminated using the "Contamination?" switch
-If you decide to contaminate the reactor, you can adjust the initial number of contaminating agents using the slider labeled "num-contaminants". If you choose to contaminate a batch mid-reaction, this slider also controls the number of contaminating agents that are inoculated when clicking the "Contaminate" button.
-The contaminant's fitness advantage can be adjusted using the "Contaminant-advantage" slider. This controls the contaminant's ability to utilize substrate for reproduction, relative to _X. campestris_. Note that you can also put the contaminant's metabolic efficiency to be equal to or less than that of _X. campestris_.

3. Setting the "Continuous-feed" switch to on will simulate a continuous culture reactor by continuously providing substrate. Note that this does not always ensure the microbe community does not die out.

4. The "substrate-quality" slider controls how much nutrition a patch receives upon setup and subsequent feedings, which can occur when running Continuous-feed and whenever you push the button labeled "Add Substrate".

5. The "show-energy?" slider allows the user to toggle whether turtles display their current energy value.

6. The "Viscosity?" switch allows users to account for the increasing viscosity of the medium as xanthan gum accumulates. Switching it off allows the user to consider bioreactors where the population is not affected by the product or a situation in which the product is continuously removed.

7. Click "Setup"

8. Click "Go". The model can be paused by pressing "Go" again.

Varying the above parameters will simulate various reactor operating conditions and microbial metabolic variations.


* As you vary the parameters above, take note of the final biomass and xanthan gum produced.
* When substrate is limited we see exponential growth in _X. campestris_, followed by a decline as substrate becomes more depleted.
* Poorer substrates result in lower overall xanthan gum production.
* Contamination substantially reduces overall xanthan gum production.
* Viscous conditions prevent microbes from utilizing all the substrate available, which leads to waste.

There are three graphs:
1. Population fluctuation over time
-This tracks the number of viable microbes currently in the reactor, where yellow represents Xanthomonas and red is the contaminant.
-Note that the Biomass monitor tracks the number of cells that have ever lived.
2. Substrate
-in a batch model you will see the rate of substrate consumption increase, then decrease as the substrate is depeted by the growing population of microbes.
3. Xanthan gum produced


* Move the ticks slider to "slower". Right-click any microbe and choose "inspect" from the pop-up menu. It is easiest to click on a microbe when the model is paused. You can then watch the microbe wander around ant track its energy level as it moves, eats, and reproduces.

* Set the "Continuous-feed?" switch to "On". Right click any patch and choose "inspect" from the pop-up menu. You can now watch the nutritious content of that patch fluctuate as microbes eat and as substrate is replenished. Change the "substrate-quality" slider and see how this affects the nutrient cycling on a patch.

* Run multiple iterations. Use the data obtained to compare to existing logistic equations for batch cultures.


There are different types of microbial interactions possible. You can expand this model by including a contaminant with a more direct effect on _X. camperis_. This can include predatory microbes or phages. You could also program the contaminant organism to perform other disruptive behavior, such as forming biofilms that obstruct thorough mixing of the culture. The expectation is that this would limit _X. camperis_ access to resources and lead to early culture death and lower product yields.

You could also incorporate multiple substrates, rather than having one substrate on a slider. In culture, it is observed that microbes will first consume their preferred substrate (e.g. glucose) before metabolizing a secondary sugar, such as sucrose. When the preferred substrate is depleted, there is a lag in population growth before the microbes resume exponential growth. This delay is believed to be caused by the amount of time it takes the microbes to build the enzymes they need to break down the second substrate.


Ginovart, M., & Prats, C. (2012). A Bacterial Individual-Based Virtual Bioreactor to Test Handling Protocols in a NetLogo Platform. Mathematical Modeling, 7(1).

Wilensky, U. 1999. NetLogo. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.

Wilensky, U. (2005). NetLogo Wolf Sheep Predation (System Dynamics) model. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.


To cite the model itself:

Sanderlin, V. (2017). Xanthan Gum Bioreactor 2017.

To cite the NetLogo software:

Wilensky, U. (1999). NetLogo. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

The author can be contacted at

(back to the NetLogo User Community Models)