# Make a simple compartment model?

**URL:** <https://community.wolfram.com/t/make-a-simple-compartment-model/16241>\
**Category:** Questions\
**Tags:** biological-sciences, modeling\
**Created:** [June 26, 2020, 3:41am UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241 "2020-06-26T03:41:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohauckbaraullee001](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mohauckbaraullee001](https://community.wolfram.com/u/mohauckbaraullee001)\
**Post date:** [June 26, 2020, 3:41am UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241/1 "2020-06-26T03:41:06Z")

</div>

I am currently conducting undergraduate research at Miami Dade College. I am researching transmissions of aerosol particles specifically in influenza and want to create a mathematical model for that. I do not know where or how to start with this. I am very interested in using this software and I have seen some examples, but I am overwhelmed and not sure how to apply the tools built-in. Some of my main questions are how can I construct a model, can I use other templates from Wolfram in my research, and how to set parameters on the model?

---

<div class="post-metadata">

**Author:** ![rnachbar](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/rnachbar/32/10766_2.png) [@rnachbar](https://community.wolfram.com/u/rnachbar)\
**Post date:** [June 26, 2020, 9:16am UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241/2 "2020-06-26T09:16:06Z")

</div>

Try starting with the package used in my post [Epidemiological Models for Influenza and COVID-19](https://wolfram.discourse.group/t/15486/1) . It’s fairly easy to specify the compartments and the transitions as a set of rules, and then convert them to a system of ODEs.

---

<div class="post-metadata">

**Author:** ![mohauckbaraullee001](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mohauckbaraullee001](https://community.wolfram.com/u/mohauckbaraullee001)\
**Post date:** [June 27, 2020, 1:22pm UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241/3 "2020-06-27T13:22:15Z")

</div>

Thank you, I will give it a shot.

---

<div class="post-metadata">

**Author:** ![rnachbar](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/rnachbar/32/10766_2.png) [@rnachbar](https://community.wolfram.com/u/rnachbar)\
**Post date:** [June 27, 2020, 2:28pm UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241/4 "2020-06-27T14:28:37Z")

</div>

Great. Let me know if you have difficulties, and I’ll help out as time allows (I’m just embarking on a 3 week long virtual summer school as an instructor).

---

<div class="post-metadata">

**Author:** ![mohauckbaraullee001](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mohauckbaraullee001](https://community.wolfram.com/u/mohauckbaraullee001)\
**Post date:** [June 27, 2020, 8:26pm UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241/5 "2020-06-27T20:26:09Z")

</div>

Much appreciated, good luck with your class!!!

---

<div class="post-metadata">

**Author:** ![ebenpel8](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@ebenpel8](https://community.wolfram.com/u/ebenpel8)\
**Post date:** [August 8, 2021, 8:33am UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241/6 "2021-08-08T08:33:12Z")

</div>

The code is not working for me. Pls could you explain step by step what to do so it can design the compartmental models and convert is to set of ODE.  
Thanks.

---

<div class="post-metadata">

**Author:** ![steadymushaya](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@steadymushaya](https://community.wolfram.com/u/steadymushaya)\
**Post date:** [January 18, 2022, 4:03pm UTC](https://community.wolfram.com/t/make-a-simple-compartment-model/16241/7 "2022-01-18T16:03:01Z")

</div>

Hie Robert

I have downloaded your codes on Epidemiological Models for Influenza and COVID-19. After going through the codes I fell in love with Mathematica and would like to modify your codes.  
Unfortunately, I having your files are not running on my machine. I have Mathematica 12.3.

I downloaded the file CompartmentalModeling package and placed it in the same folder with other notebooks, is this the proper way to do it?

When I am modifying the codes do I have to alter the commands in CompartmentalModeling package?

Thank you
