NPZD Model

python, javascript, bokeh, numpy

One of the simplest ecosystem models one can make for an ocean model is a (N)utrient-(P)hytoplankton-(Z)ooplankton-(D)etritus model. It gets coupled to the ocean model physics to respond to things like solubility (temperature) changes, mixing, and upwelling.

I wanted to make an interactive version of an NPZD model from an assignment in my Biogeochemical Oceanography class, based on the great Sarmiento & Gruber textbook. Here I used bokeh, a package for making interactive python visualizations. You can move the sliders to play around with initial conditions and other parameters in the model.

This is a simple one-box model, so the generalized nutrient (which could be thought of as nitrate) is conserved. The top panel shows how the nutrient, phytoplankton, zooplankton, and detritus (zooplankton poop and dead phytoplankton) populations change over time. The bottom panel shows this in a different view, highlighting that the total nutrient is conserved.

The extended description and code can be found in my Jupyter notebook here. You can view the full HTML page here, if the inset on this page is difficult to navigate on your device.