# Turbidostat

## Algorithm

1. OD is constantly monitored
2. When OD goes above the an upper OD threshold
3. A dilution is calculated to bring OD to the lower threshold
   1. Dilutions are capped at 20 seconds to avoid vial overflow
4. Both influx and efflux pumps are run simultaneously for the calculated length
5. Efflux pumps are run extra to make sure volume stays constant
   1. The efflux straw sets volume&#x20;

## Turbidostat Dilution

### Pumps

* Influx and efflux are both run at the same time
* Like chemostat, vial volume is set by efflux straw height
  * Efflux is run extra time to make sure that enough volume is removed
* Pumps run at roughly 0.75mL/second
* Pump calibration is important for turbidostat otherwise dilutions will not hit the lower OD threshold accurately

### Dilution Calculation Example

Dilution is calculated [here](https://github.com/FYNCH-BIO/dpu/blob/1ea8fe36a6a7cdbcf4e5a872c43abfdf53acaf35/experiment/template/custom_script.py#L124C17-L124C85) in the code and is modeled as a mass balance equation

<figure><img src="/files/zjjtSvbkAIz7v1jyo4cY" alt=""><figcaption></figcaption></figure>

#### Example Dilution

`time_in = -(np.log(lower_thresh[x]/average_OD) *VOLUME)/flow_rate[x]`

```python
average_OD = 1 # OD
lower_threshold = 0.5 # OD
VOLUME = 25 # mL
flow_rate = 0.75 # mL/second
time_in = -(np.log(0.5/1)*25)/0.75 = 23.1 # seconds
```

*However, the mox dilution is 20 seconds to avoid overflow.*

## Growth Rate

### Calculation

Calculated in eVOLVER.py in [this](https://github.com/FYNCH-BIO/dpu/blob/1ea8fe36a6a7cdbcf4e5a872c43abfdf53acaf35/experiment/template/eVOLVER.py#L483) function and stored in your data folder during an experiment.

When there is a turbidostat dilution, it fits a line to the log of the OD data since the last growth curve (ie last turbidostat dilution) time. The slope of that line is reported as the growth rate in 1/hr.

### Doubling Time

Convert growth rate to doubling time (in hours) via ln(2)/growthrate.

<table><thead><tr><th>Growth Rate (1/hr)</th><th width="320">Doubling Time (hr)</th></tr></thead><tbody><tr><td>0.2</td><td>3.47</td></tr><tr><td>0.5</td><td>1.39</td></tr><tr><td>1.0</td><td>0.69</td></tr><tr><td>1.5</td><td>0.46</td></tr><tr><td>2.0</td><td>0.35</td></tr></tbody></table>

## More Info

See [custom\_script](/evolver/software/dpu/custom_script.py.md) and the [GUI start guide](/evolver/experiments/starting-an-experiment/gui-start-guide.md) for information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://khalil-lab.gitbook.io/evolver/experiments/turbidostat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
