Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bioreactor Problem The system : A bioreactor growing bacteria consuming a substrate to produce a product, e.g. an Anaerobic Digester producing methane form animal waste.

Bioreactor Problem

The system: A bioreactor growing bacteria consuming a substrate to produce a product, e.g. an Anaerobic Digester producing methane form animal waste.

Assumptions : 1) This is a continuous flow reactor, with inflow containing the substrate at 10 g/L at a flow rate of 0.5 L/L-day. 2) The bacteria grow according to Monod kinetics, with maxmax = 1.2 g/L-day and KsKs = 2.6 g/L. 3) The bacteria die at a constant per-capita rate of 3 percent per day. 4) Each gram of bacterial growth requires 2.4 grams of substrate. 5) Product is produced at a rate proportional to rate of substrate consumption via bacterial growth each gram of substrate consumed produces 0.25 grams of Product.

Parameter Definition Value
muMax max growth rate, (g/L-day) 1.2
kS growth half-velocity constant (g/L) 2.6
kd per-capita mortality rate (1/day) 0.03
kyS yield coefficient for S (g/g) 2.4
kyP yield coefficient for P (g/g) 0.25
f flow rate, L/L-day 0.5
Sin influent Substrate concentration (g/L) 10

Initial Conditions: Bacteria: 1, Substrate: 20, Product: 0

Your tasks:

Implement this model in Python, using the odeint() function in the scipy.integrate package.

Run the model for 10 days, collecting output every 0.1 time units.

Generate a time-series plot showing each state variable as a function of time.

Describe one positive, and one negative, feedback in this system.

Find the flow rate that optimizes the production of the product P for this system

Additionally, there are two optional tasks:

Find all equilibrium points for this system for S and X combined (ignore P).

Generate a state-space (X vs S) diagram for this systemts for this system for S and X combined (ignore P).

Turn in:

A jupyter notebook with:

1. Your Python code developed for this model 2. The plot described above, labeled appropriately 3. A paragraph describing a positive feedback and a negative feedback in the system 4. A paragraph discussing the equilibrium question 

In [1]:

import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
 
 

Describe a positive and negative feedback in this system

One positive feedback in this system is One negative feedback in this system is

Find the flow rate that optimizes the production of the product P for this system

A couple of hints:

1) Since we are trying to optimize a single parameter, f, use scipy.optimize.minimize_scalar(). See the docs https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.optimize.minimize_scalar.html. The default arguments should work fine in this case.

2) The above mentioned function find the MINIMUM of a scalar function, but remember you are trying to find a MAXIMUM. How do you make a maximization process look like a minimization process?

3) Define a Cost() function that runs the model for a specified flow rate and returns the value you are trying to mimimize. This is the function that you will hand to mimimize_scaler()

4) Because f is the variable the Cost function will need to set, you should declare it as global in your Cost function before setting it.

In [2]:

from scipy.optimize import minimize_scalar
 

Bonus Problem 1: Identify any equilibrium points for the combined Substrate and Biomass in the range 0,0 - 10,10 in state space

Include how you identified these points. Note, because we are not concerned about the product P, you might consider putting in a "helper" function that removes the third state variable from the search.

In [ ]:

 

Bonus problem 2 - State Space Diagram

Create a 2-D Quiver diagram of the model state space (S and X only, ignore P) for the parameter values provided above. In addition to the "arrows" showing system trajectories in state space, add the actual trajectory followed by your simulation for two sets of initial conditions: 1) S0S0=1, X0X0=1, and 2) S0S0=1, X0X0=1

Hint: the direction vectors for the "arrows" are the state equation values (derivatives) for each state dimension (two in this case - S,X), evaluated at a point in state space.

Another hint: see https://matplotlib.org/examples/pylab_examples/quiver_demo.html

This is suprisingly easy if you really understand what a state space is.

NOTE: if you changed the value of the f variable above, you should set it back to it's starting value before using the model for the quiver diagram.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions