# Analysis

## MathWorks Simulations

### Equations 1, 2, 3

\begin{eqnarray} \frac{dx_2}{d\tau} = \psi_1 - \gamma_2 x_2 \tag{Fig. 1.A}\\ \frac{d\theta}{d\tau} = k\psi_1 - \gamma_\theta \theta \tag{Fig. 1.B}\\ \frac{d\lambda}{d\tau} = \frac{\alpha_\lambda}{1+x_2^n} - \gamma_\lambda \lambda \tag{Fig. 1.C} \end{eqnarray}

Using the previously derived expressions from our ODEs, restated above, we simulated our equations for cI Protein, sgRNA and anti-CRISPR, shown in Figure 1.

We then used the Mathworks Simulink package to derive solutions to our system and model our system for a range of parameters.

In the first two plots, cI Protein is represented by the parameter x2. When light is on, we see that CI protein is at maximum when degradation rate is at 0 and maximum transcription rate is at the highest. There is no transcription when degradation rate is highest and maximum transcription rate is at the lowest.

In the second row of plots, sgRNA is represented by the parameter θ. When light is on, we get maximum concentration of sgRNA when degradation is at 0 and notably, when CI protein is high, sgRNA is also high as they are both not repressed.

For the last row of plots, anti-CRISPR is represented by the parameter λ. Anti-CRISPR expression is high when CI concentration is low, as CI represses anti-crispr.

## ODE Solution

Solving:

\begin{eqnarray} \frac{x_2}{dt} = \alpha - \gamma x_2 \\ \frac{x_2}{dt} + \gamma x_2 = \alpha \end{eqnarray}

Integrating Factor:

\begin{eqnarray} e^{\int \gamma dt} = e^{\gamma t} \end{eqnarray}

Multiplying both sides by our integrating factor:

\begin{eqnarray} (\frac{x_2}{dt} + \gamma x_2)e^{\gamma t} = \alpha e^{\gamma t}\\ \int (\frac{x_2}{dt} + \gamma x_2)e^{\gamma t} = \int \alpha e^{\gamma t} \\ x_2 = \frac{\alpha}{\gamma} + ce^{-\gamma t} \end{eqnarray}

## R plots

Our GitHub repository contains all our code for the following R plots and R analysis, as well as for generating the above simulations.

## R Analysis

Analyzed in R for this model, and got the following values with adjusted R-squared and p-value:

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)          2.87199    0.21773   13.19 1.47e-15 ***
c(time, time, time)  0.15267    0.01142   13.37 9.74e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.2935 on 37 degrees of freedom
Multiple R-squared:  0.8285,	Adjusted R-squared:  0.8238
F-statistic: 178.7 on 1 and 37 DF,  p-value: 9.741e-16

Intercept represents the equilibrium value of LacILov, and thus our intercept:

\begin{eqnarray} 2.879199 \pm (0.21773)(2.026) \\ 2.879199 \pm 0.44112098 \end{eqnarray}