<p>I would recommend looking into Python's plotting utilities, for example <a href="https://matplotlib.org/tutorials/introductory/pyplot.html" rel="nofollow noreferrer">here</a>.</p>

<p>I would recommend specifically looking at the examples that plot mathematical functions.</p>

<p>The basic idea is that you create a function that computes your equation based on the different parameters as inputs (<span class="math-container">$a, a_{max}, l_{max}$</span>) and then you can plug in a range of values for each parameter and plot e.g. with <span class="math-container">$a_{max}$</span> on the x axis, then different lines showing a range of values for <span class="math-container">$l_{max}$</span>, or whatever makes sense for you.</p>

<p>e.g. </p>

<pre><code>import numpy as np
import matplotlib.pyplot as plt

def fn(a, amax, lmax):
  return lmax/2 + (a/amax) * (lmax/2)

plt.figure()
amax = np.arange(0.01, 1, .01)
plt.plot(amax, fn(.005, amax, .1), "ro") ## red points
plt.plot(amax, fn(.005, amax, .2), "go") ## green point
plt.show()
</code></pre>

<p>I have no idea if these parameter ranges are meaningful for you, you will have to figure that out for yourself. </p>

<p><a href="https://i.sstatic.net/Nc6FU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Nc6FU.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2020-04-19T22:31:23.880Z
Thank you for your answer! I, however, messed up in the first place. The growth rate is obviously a velocity, equal to $$s=\frac{l_{max}}{2a_{max}}$$.

After doing some reading, the length of division should be fixed, and the cells are theoretically supposed to double every 30 minutes. However, as it gets crowded, the maximum age might become bigger.
a0142204
CC BY-SA 4.0
2020-04-20T18:27:27.237Z
Ok, I'm not sure that I understand what you are saying but you should be able to use the tools in the same way regardless of whatever the function turns out to be.
Maximilian Press
CC BY-SA 4.0
2020-04-18T21:59:05.157Z
2020-04-18T21:59:05.157Z
Maximilian Press
<p>I model the following events: a rod-shaped cell with center <span class="math-container">$x$</span> grows symmetrically until it reaches a maximum length/age, it divides into two identical cells, and the process continues. At division, the direction angle <span class="math-container">$\varphi$</span> of the daughter cells changes randomly. </p>

<p>So, the growth rate is <span class="math-container">$l=\frac{l_{max}}{2}+\frac{a}{a_{max}}\frac{l_{max}}{2}$</span></p>

<p>Is there any way of naively visualizing this? I found different cell modellers on GitHub but they were very complicated biologically speaking. I have some basic Python knowledge, but I have never done simulations. </p>

CC BY-SA 4.0
2020-04-19T12:05:12.793Z
Are you sure it is not 1/l ?
M__
<python><modelling><bacteria>
Visualizing cell growth
# Visualizing cell growth

(Asked by: username_0 on 2020-03-18)

I model the following events: a rod-shaped cell with center $x$ grows symmetrically until it reaches a maximum length/age, it divides into two identical cells, and the process continues. At division, the direction angle $\varphi$ of the daughter cells changes randomly.

So, the growth rate is $l=\frac{l\_{max}}{2}+\frac{a}{a\_{max}}\frac{l\_{max}}{2}$

Is there any way of naively visualizing this? I found different cell modellers on GitHub but they were very complicated biologically speaking. I have some basic Python knowledge, but I have never done simulations.

**Tags:** python, modelling, bacteria
> **Comments:**
> **username_1**: Are you sure it is not 1/l ?  

---

## 1 answers

### Answer by username_2 on 2020-04-18. Score: 1

I would recommend looking into Python's plotting utilities, for example here.
I would recommend specifically looking at the examples that plot mathematical functions.
The basic idea is that you create a function that computes your equation based on the different parameters as inputs ($a, a_{max}, l_{max}$) and then you can plug in a range of values for each parameter and plot e.g. with $a_{max}$ on the x axis, then different lines showing a range of values for $l_{max}$, or whatever makes sense for you.
e.g. 
import numpy as np
import matplotlib.pyplot as plt

def fn(a, amax, lmax):
  return lmax/2 + (a/amax) * (lmax/2)

plt.figure()
amax = np.arange(0.01, 1, .01)
plt.plot(amax, fn(.005, amax, .1), "ro") ## red points
plt.plot(amax, fn(.005, amax, .2), "go") ## green point
plt.show()

I have no idea if these parameter ranges are meaningful for you, you will have to figure that out for yourself.

> **Comments:**
> **username_0**: Thank you for your answer! I, however, messed up in the first place. The growth rate is obviously a velocity, equal to $$s=\frac{l_{max}}{2a_{max}}$$.  After doing some reading, the length of division should be fixed, and the cells are theoretically supposed to double every 30 minutes. However, as it gets crowded, the maximum age might become bigger.  
> **username_2**: Ok, I'm not sure that I understand what you are saying but you should be able to use the tools in the same way regardless of whatever the function turns out to be.  

---

