# Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Build, visualize, analyze, and simulate compartmental models

Contributed by: rnachbar@wolfram.com

Compartmental models are a convenient way to describe and analyse processes that involve the movement of items from one place or state to another. The items can be people, money, molecules, ideas, …. The compartmental model itself is just a representation of the information or data, and can be converted into other mathematical representations, such as differential equations, for analysis. Compartmental models are used frequently in the fields of chemical reactions, systems biology, ecology, epidemiology, pharmacokinetics, and many more.

To install this paclet in your Wolfram Language environment,
evaluate this code:

`PacletInstall["RobertNachbar/CompartmentalModeling"]`

To load the code after installation, evaluate this code:

`Needs["RobertNachbar`CompartmentalModeling`"]`

The CompartmentalModeling paclet is intended to support compartment models in general.

The Transition is the fundemental object from which compartmental models are built in Wolfram Language; it describes the movement of items from one place to another or the change of state of one item to another.

Domain-specific functionality is provided for dynamic transmission models in epidemiology and for systems biology models (including chemical reaction kinetics); support for pharmacokinetics is planned.

Version 12.1 or newer of the Wolfram Language is required.

Write a transition for the infection of a susceptible individual for an SIR epidemiology model:

In[1]:= |

Out[1]= |

Write a transition for a reaction for a reaction network model:

In[2]:= |

Out[2]= |

Write a transition for the absorption of a drug from the gut into the blood stream for a pharmacokinetics model:

In[3]:= |

Out[3]= |

Generate the reactions for an enzyme catalyzed reaction:

In[4]:= |

Out[4]= |

Draw the compartmental model graph of a simple reaction network:

In[5]:= |

Out[5]= |

Draw the compartmental model graph of an SEIR epidemiology model:

In[6]:= |

Out[6]= |

Draw the compartmental model graph of a pharmacokinetics model:

In[7]:= |

Out[7]= |

Generate the Michaelis-Menten kinetic law for an enzyme catalyzed reaction with a competitive inhibitor:

In[8]:= |

Out[8]= |

Add transitions to an SEIR epidemiology model for vital demographics:

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

Compute the ODEs, stoichiometric matrix, reaction rates, and other model data for a reaction network model:

In[11]:= |

Out[11]= |

Compute the ODEs, force of infection, and other model data for an age-stratified SEIR epidemiology model:

In[12]:= |

Out[13]= |

In[14]:= |

Out[14]= |

In[15]:= |

Out[15]= |

- Wolfram Language built-in symbols
- Learn More »

- 1.9.1 – 20 February 2023
- 1.9.0 – 27 January 2023
- 1.8.3 – 18 May 2022
- 1.8.2 – 23 April 2022
- 1.8.0 – 04 February 2022