These lines are logging/saving whether the turbidostat algorithm is targeting the upper or lower OD between loop iterations and for post data processing. Basically should the algorithm wait for the OD to reach the upper T-stat limit, or should it be trying to hit the lower threshold. If the OD goes over the ODset value, it assigns the lower limit to ODSet and triggers a dilution event. Then it checks whether the dilution was successful in getting the OD to the lower limit. If it was, it assigns the upper limit again to ODSet and waits for the OD to increase. It’s possible that a dilution does not get the OD below the lower limit, and in this case you would not change the OD set to the upper limit so that another dilution can happen in a few minutes.
The chemostat algorithm isn’t trying to hit a specific OD, so it doesn’t have to keep track of a target.
Hopefully that is clear. We don’t really need to save the ODSet variable to file, but it can be useful potentially in debugging to know what the t-stat algorithm was trying to do.