# Team:Cornell/project/drylab/modeling/time response

## Time Response

### How do our sensors respond to varying analyte concentration over time?

To make sense of data collected remotely, we must know the time it takes for our sensor to produce a signal in response to a change in analyte concentration in the sample stream. In other words, we need to know whether current output at any time can be taken to represent analyte concentration at that time , or whether our system has memory. From preliminary data presented for our arsenic sensor in our results page, we know the response time of the S.A.F.E. B.E.T. sensor is on the order of 1.5 days. That is, it takes nearly a day and a half for our system to fully respond upon a sudden change in analyte concentration in the reactor.

However, knowledge of the characteristic response time is insufficient to predict the dynamic behavior of our sensor when the concentration of analyte is variable in time. In other words, the response time of the sensor can tell us how long it takes our system to respond to a single perturbation in analyte concentration, but further analysis is necessary in the prediction of the sensor’s response to continuously changing analyte concentration. For example, if changes in concentration occur slowly over time, our sensor may produce a signal that perfectly tracks the analyte concentration—with some lag. On the other hand, if changes occur quickly in relation to the response time of the sensor, we might expect an output corresponding to a time-average of the analyte concentration. Here, we model the current output of our sensor in response to oscillating concentration of analyte in order to predict the time-scales over which the S.A.F.E. B.E.T. sensor filters out fine changes in analyte concentration. ### Problem Setup

As seen in the figure to the left, the S.A.F.E. B.E.T. sensor is a continuous flow reactor, with the feed rate at the inlet equal to the effluent flow rate—at a value of $F$ = 18 mL/min. The reactor has constant volume of 120 mL.

We want to know how our system responds to oscillating analyte concentration in the feed stream—i.e., the river in which the sensor is deployed. To this end, we will model time varying analyte concentration $([A](t))$ as a sine wave. The frequency of this wave will be the parameter of primary interest, since we are particularly interested in determining the timescales over which the S.A.F.E. B.E.T. sensor produces a signal that tracks fine changes in analyte concentration.

However, before we can determine our sensor's current response to an input function of varying river analyte concentration, we must first solve for the concentration of analyte in the reactor as a function of time $(c(t))$. Therefore, our solution will consist of two coupled differential equations—one which may be solved analytically for $c(t)$ and one which may be numerically solved for the current response of the S.A.F.E. B.E.T. sensor—as described below.

### Solution

##### Concentration of Analyte In Reactor
First, we need to solve for the concentration of analyte in the reactor as a function of time $(c(t))$ given an oscillating input of analyte $([A](t))$—with arbitrary frequency and amplitude—in the river. By performing a mass balance around the reactor (and ignoring any contribution from generation or consumption), we may write the following differential equation: $$\frac{dc}{dt} = [A](t)\cdot\frac{F}{V}-c\cdot\frac{F}{V}=D([A](t)-c),$$ $$\mathrm{where} \ \ [A](t) = A_0\cdot\sin(2 \pi ft)+A_0,$$ and the dilution rate, $D$, equals 3.6 day$^{-1}$ for our system. Using $e^{Dt}$ as an integrating factor, we find $$c(t) = \frac{(A0 (D^2 \sin(2 \pi f t)+D^2-2 \pi D f \cos(2 \pi f t)+4 \pi^2 f^2))}{(D^2+4 \pi^2 f^2)}+k_1 e^{-D t}$$ $$\mathrm{where} \ \ k_1 = - \frac{(A_0 (D^2-2 \pi D f+4 \pi^2))}{(D^2+4 \pi^2 f^2)} \ \ \mathrm{such\ that} \ c(0) =0$$

##### Current Response
Now that we have an analytical solution for the concentration of analyte in the reactor over time, we wish to model the current response given the input function $c(t)$. To accomplish this, we model the time rate of change of current of our arsenic sensor using a Hill function  with a cooperativity coefficient of unity—fitting data presented in Fig. 3 of our Current Response characterization page—and lumping all transcriptional, translational, and post-translational processes: $$\frac{dI}{dt} = \frac{\beta_1 \cdot c(t)}{c_{1/2}+c(t)}+\beta_0 - \alpha I,$$ where $c(t)$ is as defined above; $\beta_1$ is 1.4 $\mu$A/day, $\beta_0$ is 2.8 $\mu$A/day, $c_{1/2}$, the half-saturating analyte concentration, is 100 $\mu$M, $\alpha$ = 0.69 day$^{-1}$; and the saturating current output is $(\beta_1 + \beta_0)/\alpha$.

Using this ordinary differential equation, we may numerically solve for current as a function of time—given the input function derived above. The results of such numerical solutions for input functions with various frequencies—performed using the differential equation solver ode45 in MATLAB—are shown below.  ### Results: Time-Averaged Output for Rapidly Oscillating Analyte Concentrations

As seen below in Fig. 1, variations in analyte concentration on the order of 90 days can be detected by the S.A.F.E. B.E.T. sensor without time-averaging. In other words, the signal produced by the sensor tracks the changes in analyte without disruption from the ‘memory’ of the system. This is important, since we know our sensor can reliably report analyte concentration at any given time once we account for the simple time lag of the response time—which is negligible for variations on timescales of weeks or greater. ###### Fig. 1. A sinusoidally oscillating concentration of analyte (with period, T, of 90 days) in the feed stream (green) is plotted alongside the modeled sensor output (blue). For analyte changes on this timescale, current output traverses the entire range of the outputs from basal current of 4 $\mu$A to saturating current just under 6 $\mu$A— giving a fine-tuned output corresponding to analyte concentrations within the dynamic range.

However, for variations in analyte that occur on timescales of less than a month, the ‘memory’ of the system begins to interfere with our sensor’s ability to track fine changes in analyte concentration. As seen in Fig. 2 below, when oscillations in analyte concentration occur on the order of days, the response of our sensor approaches a constant output that accurately represents the time-average of the oscillating analyte concentration. Even though S.A.F.E. B.E.T. cannot track fine changes on these timescales, the ability to sense the time-averaged value represents a significant improvement over current detection methods that rely on ‘spot’ sampling—which often misrepresents the true analyte concentration. ### References

 Hill, A. (1910) The possible effects of the aggregation of the molecules of haemoglobin on its dissociation curves. J Physiol 40: 4–7.