Difference between revisions of "Team:Dundee/Modeling/Appendix3"

 
(45 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<html>
 
<html>
<style>container { text-align:left; min-width:80%; }
 
#pagebox { text-align:left; width:80%; margin-left:auto; margin-right:auto; }
 
#pagebox2 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }#pagebox3 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }#pagebox4 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }</style><!--Sets classes so that content within pagebox will have margins-->
 
  
  
<script type="text/x-mathjax-config">
+
 
  MathJax.Hub.Config({
+
 
    "HTML-CSS": { scale: 120}
+
  });
+
</script>
+
<!--Resizes the mathjax equations and inline symbols so that they are larger and easier to read-->
+
  
 
<style>#about .glyphicon {
 
<style>#about .glyphicon {
Line 67: Line 60:
  
 
<script type="text/javascript"
 
<script type="text/javascript"
   src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
+
   src="https://2015.igem.org/common/MathJax-2.5-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script><!--The following script tag allows for MathJax to be used, a language that allows for Latex code to be displayed in html-->
+
</script><!--The script tag allows for MathJax to be used, a language that allows for Latex code to be displayed in html-->
  
 
<style>
 
<style>
 +
.MathJax_Display {
 +
  color: #FFFFFF !important;
 +
}
 +
.codeinput{ color:#000000; font-size:10pt }
 +
span.keyword { color:#0000FF; font-size:10pt }
 +
span.comment { color:#228B22; font-size:10pt }
 +
span.string { color:#A020F0; font-size:10pt }
 +
span.untermstring { color:#B20000; font-size:10pt }
 +
span.syscmd { color:#B28C00; font-size:10t }
  
 
+
</style><!--This formats classes to match font colour with that from MATLAB editor and ensures latex equatinos are white.-->
 
+
span.keyword { color:#0000FF }
+
span.comment { color:#228B22 }
+
span.string { color:#A020F0 }
+
span.untermstring { color:#B20000 }
+
span.syscmd { color:#B28C00 }
+
</style><!--Sets up span classes to match MATLAB published html output style-->
+
 
<body>
 
<body>
 
       <meta name="viewport" content="width=device-width, initial-scale=1.0"><!--Ensures page is mobile device compatible-->
 
       <meta name="viewport" content="width=device-width, initial-scale=1.0"><!--Ensures page is mobile device compatible-->
Line 85: Line 80:
  
  
     <header>
+
     <header id="header-modelling-appendix">
 
     <a class="anchor" id="top"></a><!--Sets anchor so that this section can be referred back to using the command #top-->
 
     <a class="anchor" id="top"></a><!--Sets anchor so that this section can be referred back to using the command #top-->
 
         <center>
 
         <center>
 
             <h1><highlight class="highlight">Dry Lab</highlight></h1>
 
             <h1><highlight class="highlight">Dry Lab</highlight></h1>
 +
<br>
 
             <h3><highlight class="highlight">Appendix 3: Chromate Biosensor Code</highlight></h3>
 
             <h3><highlight class="highlight">Appendix 3: Chromate Biosensor Code</highlight></h3>
 
         </center>
 
         </center>
 +
 
       </header><!-- sets centered header(h1) and subheader(h3)-->
 
       </header><!-- sets centered header(h1) and subheader(h3)-->
  
<font size="4"><!--Sets font size to size 4-->
+
<font color="white"><!--Sets font size to size 5 and colour as white.-->
  
 
<a class="anchor" id="selection"></a><!--Sets anchor so that this section can be referred back to using the command #selection-->
 
<a class="anchor" id="selection"></a><!--Sets anchor so that this section can be referred back to using the command #selection-->
 
     <section id="about" class="row1">     
 
     <section id="about" class="row1">     
 
       <div class="row">
 
       <div class="row">
         <div class="col-md-4">
+
         <div class="col-lg-4">
 
           <a href="#chromate2" class="scroll"><span class="glyphicon glyphicon-pushpin" type="button"></span></a> <!--Button that navigates to a specific section of page-->
 
           <a href="#chromate2" class="scroll"><span class="glyphicon glyphicon-pushpin" type="button"></span></a> <!--Button that navigates to a specific section of page-->
 
           <h3>Chromate Model Code</h3>
 
           <h3>Chromate Model Code</h3>
          <p class="about-content">MATLAB code for chromate model.</p><!--text displayed under button-->
+
       
 
         </div>
 
         </div>
 
+
         <div class="col-lg-4">
         <div class="col-md-4">
+
 
           <a href="#bone" class="scroll"><span class="glyphicon glyphicon-pushpin" type="button"></span></a><!--Button that navigates to a specific section of page-->
 
           <a href="#bone" class="scroll"><span class="glyphicon glyphicon-pushpin" type="button"></span></a><!--Button that navigates to a specific section of page-->
 
           <h3>Bone Incision Experimental Data</h3>
 
           <h3>Bone Incision Experimental Data</h3>
          <p class="about-content">Raw data for the bone incision experiments.</p><!--text displayed under button-->
+
       
 
+
 
+
 
         </div>
 
         </div>
 
+
         <div class="col-lg-4">
         <div class="col-md-4">
+
 
           <a href="#bone" class="scroll"><span class="glyphicon glyphicon-pushpin" type="button"></span></a><!--Button that navigates to a specific section of page-->
 
           <a href="#bone" class="scroll"><span class="glyphicon glyphicon-pushpin" type="button"></span></a><!--Button that navigates to a specific section of page-->
 
           <h3>Bone Incision Experiment Code</h3>
 
           <h3>Bone Incision Experiment Code</h3>
           <p class="about-content">MATLAB code for the bone incision experiments.</p><!--text displayed under button-->
+
            
 
         </div>
 
         </div>
     
+
     
 
       </div>
 
       </div>
 
     </section>
 
     </section>
Line 123: Line 116:
  
  
<div id="pagebox"><!--All content within this division will have a margin-->
+
<div class="container"><!--All content within this division will have a margin-->
  
  
Line 133: Line 126:
 
           <div class="col-lg-12 feature" style="">
 
           <div class="col-lg-12 feature" style="">
 
             <div class="row">
 
             <div class="row">
                 <h3>Chromate Model Code</h3>
+
                 <h2><b>Chromate Model Code</b></h2>
             <p><font color="white"><!--Font colour set to white--> Lorem ipsum dolor sit amet, nostrud maiestatis quaerendum ne sed. Reque possit ne sea. Te dico labitur mediocritatem ius. Error timeam noluisse eos ad, eam ne magna meliore contentiones, nec ei volumus persecuti.
+
<br>
 +
             <p>The figures shown in the <u><a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate#chromate2"><!--Links to figure on another page.-->Chromate Biosensor model</a></u> were created using MATLAB. Two files were written to perform sensitivity analysis; one to set the function (chromate.m) and one to solve the function and plot the results in <u><a href="https://2015.igem.org/wiki/index.php?title=Team:Dundee/Modeling/Chromate#cfig3">Figure 3</a></u>, <u><a href="https://2015.igem.org/wiki/index.php?title=Team:Dundee/Modeling/Chromate#cfig4">Figure 4</a></u> , <u><a href="https://2015.igem.org/wiki/index.php?title=Team:Dundee/Modeling/Chromate#cfig5">Figure 5</a></u> and <u><a href="https://2015.igem.org/wiki/index.php?title=Team:Dundee/Modeling/Chromate#cfig6">Figure 6</a></u> (run_chromate.m). Both files are shown below, where the green is comments to aid in understanding of the scripts.</p><br>
  
Dicit animal definitionem et mel, nonumy tacimates nec in. Vis mucius periculis at. At est vidit scripserit repudiandae, agam porro sea ne. Sea et stet tibique praesent, vim et legere aperiri. Quo doming vocibus eleifend no.
 
  
Cu vis partem graeci facilisis. Falli inciderint mei no. Assentior suscipiantur mea id. Vis quas electram prodesset cu, choro omnium conclusionemque an his. Vis latine equidem perfecto ad.</font></p>
+
 
 +
 
 +
 
 +
<div class="content"><pre class="codeinput"><!--This marks the beginning of the input copied from matlab published html.-->
 +
  <span class="comment"><b><font size='6' color='green'>MATLAB code from chromate.m file</b></font></span>
 +
<span class="comment"><b>% Function to define the system of ODEs describing the modified chromate pathway.</b></span>
 +
<span class="comment"><b>%% Section 1: Function to define the system of ODEs describing the modified chromate pathway.</b></span>
 +
<span class="comment">% The vector u has seven dimensions where;</span>
 +
<span class="comment">% u(1) = ChrB protein concentration,</span>
 +
<span class="comment">% u(2) = ChrB dimer concentration,</span>
 +
<span class="comment">% u(3) = Cv, the hexavalent chromate added to the system concentration,</span>
 +
<span class="comment">% u(4) = Dimer and Cv complex concentration,</span>
 +
<span class="comment">% u(5) = Pc, the closed (bound and non-functioning) promoter concentration,</span>
 +
<span class="comment">% u(6) = Po. the open (unbound and functioning) promoter concentration,</span>
 +
<span class="comment">% u(7) = GFP output concentration.</span>
 +
<span class="comment">% Parameter t is time that the simulation runs over. </span>
 +
<span class="comment">% Parameters k1..k8 represent the kinetic rates of the system.</span>
 +
<span class="comment">% L represents leakiness of the system.</span>
 +
<span class="keyword">function</span> f=chromate(t,u,L);
 +
k1 = 1;
 +
k2 = 1;
 +
k3 = 1;
 +
km3 = 1;
 +
k4 = 1;
 +
km4 = 1;
 +
k5 = 1;
 +
k6 = 1;
 +
km6=1;
 +
k7 = 1;
 +
<span class="comment">% k8 divided by 60 as in minutes not hours.</span>
 +
k8=(0.25/60);
 +
<span class="comment">% Set S1 and S2 at specific times which represent whether chromate is present or not</span>
 +
<span class="comment">% S is the signal input.</span>
 +
 
 +
S1=0;
 +
S2=1;
 +
<span class="keyword">if</span> (t&lt;500)<span class="comment">% Where time is less than 500 seconds.</span>
 +
    S=S1;
 +
 
 +
<span class="keyword">else</span> <span class="keyword">if</span> (t&gt;500) &amp;&amp; (t&lt;3100)<span class="comment">% Where time is more than 500 seconds and less than 3100 seconds.</span>
 +
        S=S2;
 +
 
 +
    <span class="keyword">else</span> <span class="keyword">if</span> (t&gt;3100)<span class="comment">% Where time is more than 3100 seconds.</span>
 +
            S=S1;
 +
        <span class="keyword">end</span>
 +
    <span class="keyword">end</span>
 +
<span class="keyword">end</span> <span class="comment">% If and else if loop sets the times when chromate is present or absent from the system.</span>
 +
<span class="comment">% Define f as a vector where the input is the right hand side of the systems of ODEs representing the pathway with signal input incorporated.</span>
 +
f=[k1 - k2*u(1)+km3*u(2)-k3*u(1)*u(1);
 +
    k3*u(1)*u(1)-km3*u(2)+(km4*u(4))-(k4*u(2)*u(3)*S)-k5*u(2)+(km6*u(5)*S)-k6*u(2)*u(6);
 +
    -k4*u(2)*u(3)*S+km4*u(4);
 +
    k4*u(2)*u(3)*S-km4*u(4);
 +
    k6*u(6)*u(2)-km6*u(5)*S;
 +
    -k6*u(6)*u(2)+km6*u(5)*S;
 +
    L+k7*u(6)*S-k8*u(7)];
 +
<span class="comment">% End function.</span>
 +
<span class="keyword">end</span>
 +
<span class="comment">% This function can then be called using the @chromate command in run_chromate.m file.</span>
 +
<span class="comment">% END OF FILE</span>
 +
<span class="comment"><b><font size='6' color='green'>MATLAB code from chrom_wt.m file</b></font></span>
 +
<span class="comment"><b>%% Function to define the system of ODEs describing the original chromate pathway.</b></span>
 +
<span class="comment">% The vector u has seven dimensions where;</span>
 +
<span class="comment">% u(1) = ChrB protein concentration,</span>
 +
<span class="comment">% u(2) = ChrB dimer concentration,</span>
 +
<span class="comment">% u(3) = Cv, the hexavalent chromate added to the system concentration,</span>
 +
<span class="comment">% u(4) = Dimer and Cv complex concentration,</span>
 +
<span class="comment">% u(5) = Pc, the closed (bound and non-functioning) promoter concentration,</span>
 +
<span class="comment">% u(6) = Po. the open (unbound and functioning) promoter concentration,</span>
 +
<span class="comment">% u(7) = GFP output concentration.</span>
 +
<span class="comment">% Parameter t is time that the simulation runs over. </span>
 +
<span class="comment">% Parameters k1..k8 represent the kinetic rates of the system.</span>
 +
<span class="comment">% L represents leakiness of the system.</span>
 +
<span class="keyword">function</span> f=chrom_wt(t,u,L);
 +
k2 = 1;
 +
k3 = 1;
 +
km3 = 1;
 +
k4 = 1;
 +
km4 = 1;
 +
k5 = 1;
 +
k6 = 1;
 +
km6=1;
 +
k7 = 1;
 +
<span class="comment">% k8 divided by 60 as in minutes not hours.</span>
 +
k8=(0.25/60);
 +
<span class="comment">% Set S1 and S2 at specific times which represent whether chromate is present or not.</span>
 +
<span class="comment">% S is the signal input.</span>
 +
 
 +
S1=0;
 +
S2=1;
 +
<span class="keyword">if</span> (t1&lt;500)<span class="comment">% Where time is less than 500 seconds.</span>
 +
    S=S1;
 +
 
 +
<span class="keyword">else</span> <span class="keyword">if</span> (t1&gt;500) &amp;&amp; (t1&lt;3100)<span class="comment">% Where time is more than 500 seconds and less than 3100 seconds.</span>
 +
        S=S2;
 +
 
 +
    <span class="keyword">else</span> <span class="keyword">if</span> (t1&gt;3100)<span class="comment">% Where time is more than 3100 seconds.</span>
 +
            S=S1;
 +
        <span class="keyword">end</span>
 +
    <span class="keyword">end</span>
 +
<span class="keyword">end</span> <span class="comment">% If and else if loop sets the times when chromate is present or absent from the system.</span>
 +
<span class="comment">% Define f as a vector where the input is the right hand side of the systems of ODEs representing the pathway with signal input incorporated.</span>
 +
f=[L+k7*u(6)-k2*u(1)+km3*u(2)-k3*u(1)*u(1);
 +
    k3*u(1)*u(1)-km3*u(2)+(km4*u(4))-(k4*u(2)*u(3)*S)-k5*u(2)+(km6*u(5)*S)-k6*u(2)*u(6);
 +
    -k4*u(2)*u(3)*S+km4*u(4);
 +
    k4*u(2)*u(3)*S-km4*u(4);
 +
    k6*u(6)*u(2)-km6*u(5)*S;
 +
    -k6*u(6)*u(2)+km6*u(5)*S;
 +
    L+k7*u(6)*S-k8*u(7)];
 +
<span class="comment">% End function.</span>
 +
<span class="keyword">end</span>
 +
<span class="comment">% This function can then be called using the @chrom_wt command in run_chromate.m file</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
<span class="comment">% END OF FILE</span>
 +
 
 +
 
 +
 
 +
 
 +
<span class="comment"><b><font size='6' color='green'>MATLAB code from run_chromate.m file</b></font></span>
 +
<span class="comment"><b>%% File to solve chromate functions.</b></span>
 +
<span class="comment"><b>%% Section 1: Solving the modified system to investigate GFP production with chromate added and removed at specific times.</b></span>
 +
<span class="comment">% a = Initial ChrB protein concentration.</span>
 +
a = 1;
 +
<span class="comment">% b = Initial ChrB dimer concentration.</span>
 +
b = 1;
 +
<span class="comment">% c = Initial Cv, chromate, concentration.</span>
 +
c =1;
 +
<span class="comment">% d = Initial Cv and dimer complex concentration.</span>
 +
d = 0;
 +
<span class="comment">% e = Initial Pc, closed promoter, concentration.</span>
 +
e = 0;
 +
<span class="comment">% f = Initial Po, open promoter, concentration.</span>
 +
f = 1;
 +
<span class="comment">% g = Initial GFP concentration.</span>
 +
g = 0.01;
 +
<span class="comment">% T = Final time of simulation, in seconds.</span>
 +
T=3600;
 +
<span class="comment">% Solve the function using ode23 solver with set time range and defined initial conditions.</span>
 +
<span class="comment">% Save time values in vector t and u(1)..u(7) values in matrix u with no leakiness, L=0.</span>
 +
[t,u]=ode23(@chromate,[0,T],[a,b,c,d,e,f,g],[],0);
 +
 
 +
<span class="comment">% Call up empty figure 1 to prevent overwriting figures.</span>
 +
figure1=figure(1)
 +
<span class="comment">% Plot t vector against the 7th column of the u matrix, that is the GFP concentration, and set linewidth to 3 so that it is easily read.</span>
 +
plot(t,u(:,7), <span class="string">'LineWidth'</span>,3);
 +
<span class="comment">% Ensure that axis fits the data by using axis tight command.</span>
 +
axis <span class="string">tight</span>
 +
<span class="comment">% Remove the values on the x and y axis as they are not relevant.</span>
 +
set(gca,<span class="string">'YTick'</span>,[],<span class="string">'XTick'</span>,[]);
 +
<span class="comment">% Annotate the figure by adding arrows along the x and y axis to represent increasing time and Fluorescence.</span>
 +
annotation(figure1,<span class="string">'arrow'</span>,[0.133928571428571 0.914285714285714],<span class="keyword">...</span>
 +
    [0.0466190476190482 0.0476190476190482],<span class="string">'LineWidth'</span>,4);
 +
annotation(figure1,<span class="string">'arrow'</span>,[0.0982142857142857 0.0982142857142857],<span class="keyword">...</span>
 +
    [0.103761904761905 0.919047619047619],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.</span>
 +
annotation(figure1,<span class="string">'textarrow'</span>,[0.3875 0.25],<span class="keyword">...</span>
 +
    [0.346619047619048 0.119047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Added'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
annotation(figure1,<span class="string">'textarrow'</span>,[0.682142857142857 0.789285714285714],<span class="keyword">...</span>
 +
    [0.779952380952381 0.919047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Removed'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% Set the labels of the x and y axis to Time and Fluorescence, respectively.</span>
 +
xlabel (<span class="string">'Time'</span>, <span class="string">'FontSize'</span>, 15);
 +
ylabel (<span class="string">'Fluorescence'</span>,<span class="string">'FontSize'</span>, 15);
 +
<span class="comment">% Add a legend for GFP Response.</span>
 +
legend1=legend(<span class="string">'GFP Response'</span>);
 +
<span class="comment">% Make the box around legend bold and make font bigger, also position legend so that it is easily read.</span>
 +
set(legend1,<span class="keyword">...</span>
 +
    <span class="string">'Position'</span>,[0.468154768530456 0.149603206588803 0.360714277944395 0.0626984112082966],<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,2,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% END OF SECTION</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
 
 +
<span class="comment"><b>%% Section 2: Sensitivity analysis on effect of chromate added to GFP production in modified pathway.</b></span>
 +
<span class="comment">% n = Number of different values of chromate evaluated.</span>
 +
n=10;
 +
<span class="comment">% T = Final time of simulation, in seconds.</span>
 +
T=3600;
 +
<span class="comment">% c1 = The range of values used for initial chromate concentration, with minimum at 0 and maximum at 400.</span>
 +
c1=linspace(0,400,n);
 +
<span class="comment">% Call up figure 2 to ensure no figures are overwritten.</span>
 +
figure2=figure(2)
 +
<span class="comment">% Set hold on so that multiple lines will be plotted on same figure.</span>
 +
hold <span class="string">on</span>
 +
<span class="comment">% Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.</span>
 +
<span class="keyword">for</span> i=1:n
 +
<span class="comment">% Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.</span>
 +
    <span class="comment">% The initial concentration of chromate will depend on the value of i within the for loop.</span>
 +
    <span class="comment">% The values will be stored in the t vector and u matrix with no leakiness, L=0.</span>
 +
    [t,u]=ode23(@chromate,[0,T],[a,b,c1(i),d,e,f,g],[],0);
 +
    <span class="comment">% Plot the GFP concentration over time.</span>
 +
    plot(t,u(:,7), <span class="string">'LineWidth'</span>,2);
 +
<span class="comment">% End the for loop.</span>
 +
<span class="keyword">end</span>
 +
<span class="comment">% Then switch hold off so that no more lines are plotted on figure.</span>
 +
hold <span class="string">off</span>
 +
<span class="comment">% Set axis to tight so that plot fits the data.</span>
 +
axis <span class="string">tight</span>
 +
<span class="comment">% Add a rectangle onto the graph to highlight the section that will be zoomed in on in figure 3.</span>
 +
annotation(<span class="string">'rectangle'</span>,[0.236714285714286 0.561904761904762 0.213285714285714 0.354761904761906], <span class="string">'LineStyle'</span>,<span class="string">'--'</span>);
 +
<span class="comment">% Remove the values of the x and y axis as they are not necessary.</span>
 +
set(gca,<span class="string">'YTick'</span>,[],<span class="string">'XTick'</span>,[]);
 +
<span class="comment">% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.</span>
 +
annotation(figure2,<span class="string">'arrow'</span>,[0.133928571428571 0.914285714285714],<span class="keyword">...</span>
 +
    [0.0466190476190482 0.0476190476190482],<span class="string">'LineWidth'</span>,4);
 +
annotation(figure2,<span class="string">'arrow'</span>,[0.0982142857142857 0.0982142857142857],<span class="keyword">...</span>
 +
    [0.103761904761905 0.919047619047619],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.</span>
 +
annotation(figure2,<span class="string">'textarrow'</span>,[0.3875 0.25],<span class="keyword">...</span>
 +
    [0.346619047619048 0.119047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Added'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
annotation(figure2,<span class="string">'textarrow'</span>,[0.682142857142857 0.789285714285714],<span class="keyword">...</span>
 +
    [0.779952380952381 0.919047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Removed'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% Set the labels of the x and y axis to Time and Concentration, respectively.</span>
 +
xlabel (<span class="string">'Time'</span>, <span class="string">'FontSize'</span>, 15);
 +
ylabel (<span class="string">'Fluorescence'</span>,<span class="string">'FontSize'</span>, 15);
 +
<span class="comment">%</span>
 +
<span class="comment"><b>% We will now replot figure 2 but zoom in on a specific section for clarity.</b></span>
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
<span class="comment">% Call up empty figure 3 to prevent overwriting figures.</span>
 +
figure3=figure(3)
 +
<span class="comment">% Set hold on so that multiple lines will be plotted on same figure.</span>
 +
hold <span class="string">on</span>
 +
<span class="comment">% Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.</span>
 +
<span class="keyword">for</span> i=1:n
 +
<span class="comment">% Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.</span>
 +
 
 +
    <span class="comment">% The initial concentration of chromate will depend on the value of i within the for loop.</span>
 +
    <span class="comment">% The values will be stored in the t vector and u matrix with no leakiness, L=0.</span>
 +
    [t,u]=ode23(@chromate,[0,T],[a,b,c1(i),d,e,f,g],[],0);
 +
    <span class="comment">% Plot the GFP concentration over time.</span>
 +
    plot(t,u(:,7), <span class="string">'LineWidth'</span>,2);
 +
<span class="comment">% End the for loop.</span>
 +
<span class="keyword">end</span>
 +
<span class="comment">% set hold off, so that no more lines are plotted.</span>
 +
hold <span class="string">off</span>
 +
<span class="comment">% Ensure that axis fits the data by using axis tight command.</span>
 +
axis <span class="string">tight</span>
 +
<span class="comment">% Remove the values on the x and y axis as they are not relevant and set the x and y limits so that we get a zoomed in section of the plot.</span>
 +
set(gca,<span class="string">'YTick'</span>,[],<span class="string">'XTick'</span>,[], <span class="string">'XLim'</span>,[909.850230414748 1359.85023041475],<span class="string">'YLim'</span>,[163.478891218168 187.138947135872]);
 +
<span class="comment">% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.</span>
 +
annotation(figure3,<span class="string">'arrow'</span>,[0.133928571428571 0.914285714285714],<span class="keyword">...</span>
 +
    [0.0466190476190482 0.0476190476190482],<span class="string">'LineWidth'</span>,4);
 +
annotation(figure3,<span class="string">'arrow'</span>,[0.0982142857142857 0.0982142857142857],<span class="keyword">...</span>
 +
    [0.103761904761905 0.919047619047619],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Add a 3rd arrow to the plot to show increasing initial concentration of Cv in the legend.</span>
 +
annotation(figure3,<span class="string">'arrow'</span>,[0.817857142857141 0.817857142857143],<span class="keyword">...</span>
 +
    [0.597619047619051 0.238095238095238],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Set legend as just lines with no text, as text will be added later using paint (see wiki figures).</span>
 +
legend2=legend(<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>);
 +
<span class="comment">% Set the position of the legend and the width of the box line.</span>
 +
set(legend2,<span class="keyword">...</span>
 +
    <span class="string">'Position'</span>,[0.631547602609266 0.207142857142858 0.255952397390734 0.413492042689934],<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,2);
 +
<span class="comment">% Set the labels of the x and y axis to Time and Concentration, respectively.</span>
 +
xlabel (<span class="string">'Time'</span>, <span class="string">'FontSize'</span>, 15);
 +
ylabel (<span class="string">'Fluorescence'</span>,<span class="string">'FontSize'</span>, 15);
 +
<span class="comment">% END OF SECTION</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
 
 +
 
 +
 
 +
<span class="comment"><b>%% Section 3: Solving the original system to investigate GFP production with chromate added and removed at specific times.</b></span>
 +
<span class="comment">% The same initial conditions are used as modified systems so they do not need to be redefined.</span>
 +
<span class="comment">% Solve the chrom_wt function using ode23 solver with set time range and defined initial conditions.</span>
 +
<span class="comment">% Save time values in vector t and u(1)..u1(7) values in matrix u with no leakiness, L=0.</span>
 +
[t,u]=ode23(@chrom_wt,[0,T],[a,b,c,d,e,f,g],[],0);
 +
<span class="comment">% Call up a new figure to ensure figures are not overwritten.</span>
 +
figure4=figure(4)
 +
<span class="comment">% Plot t vector against the 7th column of the u matrix, that is the GFP concentration, and set linewidth to 3 so that it is easily read.</span>
 +
plot(t,u(:,7), <span class="string">'LineWidth'</span>,3);
 +
<span class="comment">% Ensure that axis fits the data by using axis tight command.</span>
 +
axis <span class="string">tight</span>
 +
<span class="comment">% Remove the values on the x and y axis as they are not relevant.</span>
 +
set(gca,<span class="string">'YTick'</span>,[],<span class="string">'XTick'</span>,[]);
 +
<span class="comment">% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.</span>
 +
annotation(figure4,<span class="string">'arrow'</span>,[0.133928571428571 0.914285714285714],<span class="keyword">...</span>
 +
    [0.0466190476190482 0.0476190476190482],<span class="string">'LineWidth'</span>,4);
 +
annotation(figure4,<span class="string">'arrow'</span>,[0.0982142857142857 0.0982142857142857],<span class="keyword">...</span>
 +
    [0.103761904761905 0.919047619047619],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Add line to show modified level in comparrison.</span>
 +
annotation(figure4,<span class="string">'line'</span>,[0 1],...
 +
    [0.9310344828 0.9310344828],<span class="string">'Color'</span>,[1 0 1],<span class="string">'LineWidth'</span>,2,...
 +
    <span class="string">'LineStyle'</span>,<span class="string">'--'</span>);
 +
<span class="comment">% Add text box.</span>
 +
annotation(figure4,<span class="string">'textbox'</span>,...
 +
    [0.147428571428571 0.714285714285715 0.116857142857143 0.145238095238096],...
 +
    <span class="string">'Color'</span>,[1 0 1],...
 +
  <span class="string"> 'String'</span>,{<span class="string">'Modified','Pathway','Max','GFP'</span>},...
 +
    <span class="string">'LineStyle'</span>,'none',...
 +
    <span class="string">'FontWeight'</span>,'bold',...
 +
    <span class="string">'FontSize'</span>,12,...
 +
    <span class="string">'FitBoxToText'</span>,'off');
 +
<span class="comment">% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.</span>
 +
annotation(figure4,<span class="string">'textarrow'</span>,[0.3875 0.25],<span class="keyword">...</span>
 +
    [0.346619047619048 0.119047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Added'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
annotation(figure4,<span class="string">'textarrow'</span>,[0.682142857142857 0.789285714285714],<span class="keyword">...</span>
 +
    [0.779952380952381 0.919047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Removed'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% Set the x and y labels to Increasing Time and Increasing concentration.</span>
 +
xlabel (<span class="string">'Time'</span>, <span class="string">'FontSize'</span>, 15);
 +
ylabel (<span class="string">'Fluorescence'</span>,<span class="string">'FontSize'</span>, 15);
 +
<span class="comment">% Add a legend for GFP Concentration.</span>
 +
legend3=legend(<span class="string">'GFP Response'</span>);
 +
<span class="comment">% Set the legend position, box line width and font size/style.</span>
 +
set(legend3,<span class="keyword">...</span>
 +
    <span class="string">'Position'</span>,[0.468154768530456 0.149603206588803 0.360714277944395 0.0626984112082966],<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,2,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% END OF SECTION</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
 
 +
 
 +
 
 +
<span class="comment"><b>%% Section 4: Sensitivity analysis on effect of chromate added to GFP production in original pathway.</b></span>
 +
<span class="comment">% Again set n as the number of values used for initial chromate.</span>
 +
n=10;
 +
<span class="comment">% T = Final time of simulation, in seconds.</span>
 +
T=3600;
 +
<span class="comment">% c1 = The range of values used for initial chromate concentration, with minimum at 0 and maximum at 400.</span>
 +
c1=linspace(0,400,n);
 +
<span class="comment">% Call up figure 5 to ensure no figures are overwritten.</span>
 +
figure5=figure(5)
 +
<span class="comment">% Set hold on so that multiple lines will be plotted on same figure.</span>
 +
hold <span class="string">on</span>
 +
<span class="comment">% Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.</span>
 +
<span class="keyword">for</span> i=1:n
 +
<span class="comment">% Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.</span>
 +
    <span class="comment">% The initial concentration of chromate will depend on the value of i within the for loop.</span>
 +
    <span class="comment">% The values will be stored in the t vector and u matrix with no leakiness, L=0.</span>
 +
    [t,u]=ode23(@chrom_wt,[0,T],[a,b,c1(i),d,e,f,g],[],0);
 +
    <span class="comment">% Plot the GFP concentration over time.</span>
 +
    plot(t,u(:,7), <span class="string">'LineWidth'</span>,2);
 +
<span class="comment">% End the for loop.</span>
 +
<span class="keyword">end</span>
 +
<span class="comment">% Then switch hold off so that no more lines are plotted on figure.</span>
 +
hold <span class="string">off</span>
 +
<span class="comment">% Set the axis to tight so that the data fits the plot.</span>
 +
axis <span class="string">tight</span>
 +
<span class="comment">% Add a rectangle onto the graph to highlight the section that will be zoomed in on in figure 6.</span>
 +
annotation(<span class="string">'rectangle'</span>,[0.236714285714286 0.561904761904762 0.213285714285714 0.354761904761906], <span class="string">'LineStyle'</span>, <span class="string">'--'</span>);
 +
<span class="comment">% Remove the values on the x and y axis as they are not relevant.</span>
 +
set(gca,<span class="string">'YTick'</span>,[],<span class="string">'XTick'</span>,[]);
 +
<span class="comment">% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.</span>
 +
annotation(figure5,<span class="string">'arrow'</span>,[0.133928571428571 0.914285714285714],<span class="keyword">...</span>
 +
    [0.0466190476190482 0.0476190476190482],<span class="string">'LineWidth'</span>,4);
 +
annotation(figure5,<span class="string">'arrow'</span>,[0.0982142857142857 0.0982142857142857],<span class="keyword">...</span>
 +
    [0.103761904761905 0.919047619047619],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.</span>
 +
annotation(figure5,<span class="string">'textarrow'</span>,[0.3875 0.25],<span class="keyword">...</span>
 +
    [0.346619047619048 0.119047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Added'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
annotation(figure5,<span class="string">'textarrow'</span>,[0.682142857142857 0.789285714285714],<span class="keyword">...</span>
 +
    [0.779952380952381 0.919047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Removed'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% Set the x and y labels as increasing Time and Increasing Concentration respectively.</span>
 +
xlabel (<span class="string">'Time'</span>, <span class="string">'FontSize'</span>, 15);
 +
ylabel (<span class="string">'Fluorescence'</span>,<span class="string">'FontSize'</span>, 15);
 +
<span class="comment">%</span>
 +
<span class="comment"><b>% We now want to replot figure 5 with a section zoomed in.</b></span>
 +
<span class="comment">%</span>
 +
<span class="comment">% Call up figure 6 so that no other plots are overwritten.</span>
 +
figure6=figure(6)
 +
<span class="comment">% Set hold on so that multiple line can be plotted on one graph.</span>
 +
hold <span class="string">on</span>
 +
<span class="comment">% Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.</span>
 +
<span class="keyword">for</span> i=1:n
 +
<span class="comment">% Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.</span>
 +
    <span class="comment">% The initial concentration of chromate will depend on the value of i within the for loop.</span>
 +
    <span class="comment">% The values will be stored in the t vector and u matrix with no leakiness, L=0.</span>
 +
    [t,u]=ode23(@chrom_wt,[0,T],[a,b,c1(i),d,e,f,g],[],0);
 +
    <span class="comment">% Plot the GFP concentration over time.</span>
 +
    plot(t,u(:,7), <span class="string">'LineWidth'</span>,2);
 +
<span class="comment">% End the for loop.</span>
 +
<span class="keyword">end</span>
 +
<span class="comment">% Set hold off so that no more lines are plotted on the figure.</span>
 +
hold <span class="string">off</span>
 +
<span class="comment">% Ensure that axis fits the data by using axis tight command.</span>
 +
axis <span class="string">tight</span>
 +
<span class="comment">% Remove the values on the x and y axis as they are not relevant and set the x and y limits so that we get a zoomed in section of the plot.</span>
 +
set(gca,<span class="string">'YTick'</span>,[],<span class="string">'XTick'</span>,[], <span class="string">'XLim'</span>,[909.850230414748 1359.85023041475],<span class="string">'YLim'</span>,[163.478891218168 187.138947135872]);
 +
<span class="comment">% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration</span>
 +
annotation(figure6,<span class="string">'arrow'</span>,[0.133928571428571 0.914285714285714],<span class="keyword">...</span>
 +
    [0.0466190476190482 0.0476190476190482],<span class="string">'LineWidth'</span>,4);
 +
annotation(figure6,<span class="string">'arrow'</span>,[0.0982142857142857 0.0982142857142857],<span class="keyword">...</span>
 +
    [0.103761904761905 0.919047619047619],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Add a 3rd arrow to the plot to show increasing initial concentration of Cv in the legend.</span>
 +
annotation(figure6,<span class="string">'arrow'</span>,[0.817857142857141 0.817857142857143],<span class="keyword">...</span>
 +
    [0.597619047619051 0.238095238095238],<span class="string">'LineWidth'</span>,4);
 +
<span class="comment">% Set legend as just lines with no text, as text will be added later using paint (see wiki figures).</span>
 +
legend4=legend(<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>,<span class="string">''</span>);
 +
<span class="comment">% Set the position of the legend and the width of the box line.</span>
 +
set(legend4,<span class="keyword">...</span>
 +
    <span class="string">'Position'</span>,[0.631547602609266 0.207142857142858 0.255952397390734 0.413492042689934],<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,2);
 +
<span class="comment">% Set the x and y labels to Increasing Time and Increasing Concentration respectively.</span>
 +
xlabel (<span class="string">'Time'</span>, <span class="string">'FontSize'</span>, 15);
 +
ylabel (<span class="string">'Fluorescence'</span>,<span class="string">'FontSize'</span>, 15);
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
<span class="comment">% END OF SECTION</span>
 +
 
 +
 
 +
<span class="comment"><b>%% Section 5: Leakiness of both the modified and original pathways.</b></span>
 +
<span class="comment">% All parameters are set as previous sections.</span>
 +
<span class="comment">% Solve the chrom_wt function using ode23 solver with set time range and defined initial conditions.</span>
 +
<span class="comment">% Save time values in vector t and u(1)..u(7) values in matrix u with leakiness L set at 0.05.</span>
 +
[t,u]=ode23(@chrom_wt,[0,T],[a,b,c,d,e,f,g],[],0.05);
 +
<span class="comment">% Solve the chromate function using ode23 solver with set time range and defined initial conditions.</span>
 +
<span class="comment">% Save time values in vector t1 and u1(1)..u1(7) values in matrix u1 with leakiness L set at 0.05.</span>
 +
[t1,u1]=ode23(@chromate,[0,T],[a,b,c,d,e,f,g],[],0.05);
 +
<span class="comment">% Call up a new figure to ensure figures are not overwritten.</span>
 +
figure7=figure(7);
 +
<span class="comment">% Plot t vector against the 7th column of the u matrix and plot t1 against the 7th column of u1 on the same plot for comparrison.</span>
 +
<span class="comment">% Set linewidth to 2 so that it is easily read.</span>
 +
hold <span class="string">on</span>
 +
plot(t,u(:,7),<span class="string">'LineWidth'</span>,2);
 +
plot(t1,u1(:,7),<span class="string">'LineWidth'</span>,2);
 +
hold <span class="string">off</span>
 +
<span class="comment">% Ensure that axis fits the data by using axis tight command.</span>
 +
axis <span class="string">tight</span>
 +
<span class="comment">% Remove the values on the x and y axis as they are not relevant.</span>
 +
set(gca,<span class="string">'YTick'</span>,[],<span class="string">'XTick'</span>,[]);
 +
<span class="comment">% Annotate the figure by adding arrows along the x and y axis to represent increasing Time and Fluorescence.</span>
 +
annotation(figure7,<span class="string">'arrow'</span>,[0.133928571428571 0.914285714285714],<span class="keyword">...</span>
 +
    [0.0466190476190482 0.0476190476190482],<span class="string">'LineWidth'</span>,4);
 +
annotation(figure7,<span class="string">'arrow'</span>,[0.0982142857142857 0.0982142857142857],<span class="keyword">...</span>
 +
    [0.103761904761905 0.919047619047619],<span class="string">'LineWidth'</span>,4);
 +
 
 +
<span class="comment">%  Annotate the figure by adding text arrow to highlight where the chromate is added and removed.</span>
 +
 
 +
annotation(figure7,<span class="string">'textarrow'</span>,[0.3875 0.25],<span class="keyword">...</span>
 +
    [0.346619047619048 0.119047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Added'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
<span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
annotation(figure7,<span class="string">'textarrow'</span>,[0.682142857142857 0.789285714285714],<span class="keyword">...</span>
 +
    [0.779952380952381 0.919047619047619],<span class="string">'Color'</span>,[1 0 0],<span class="keyword">...</span>
 +
    <span class="string">'String'</span>,{<span class="string">'Chromate Removed'</span>},<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,4,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% Set the x and y labels to Time and Fluoresence.</span>
 +
xlabel (<span class="string">'Time'</span>, <span class="string">'FontSize'</span>, 15);
 +
ylabel (<span class="string">'Fluorescence'</span>,<span class="string">'FontSize'</span>, 15);
 +
<span class="comment">% Add a legend to distinguish between the to pathways.</span>
 +
legend5=legend(<span class="string">'Original pathway'</span>,<span class="string">'Modified pathway'</span>);
 +
<span class="comment">% Set the legend position, box line width and font size/style.</span>
 +
set(legend5,<span class="keyword">...</span>
 +
    <span class="string">'Position'</span>,[0.468154768530456 0.149603206588803 0.360714277944395 0.0626984112082966],<span class="keyword">...</span>
 +
    <span class="string">'LineWidth'</span>,2,<span class="keyword">...</span>
 +
    <span class="string">'FontWeight'</span>,<span class="string">'bold'</span>,<span class="keyword">...</span>
 +
    <span class="string">'FontSize'</span>,12);
 +
<span class="comment">% END OF SECTION</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%END OF FILE</span>
 +
</pre>
 
</div>
 
</div>
 
               </div>   
 
               </div>   
<a href="#selection" class="btn btn-primary btn-lg pull-right" role="button">Back to Top</a> <!--Button that navigates back to top of page-->
+
<a href="#selection" class="btn btn-info btn-lg pull-right" role="button">&uarr;</a><!--Button that takes user to top of page.-->
<a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate#chormate2" class="btn btn-primary btn-lg pull-right" role="button">View Description of Model</a>        <!--Button that navigates to original model page-->
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate#chormate2" class="btn btn-primary btn-lg pull-right" role="button">View description of model</a>        <!--Button that navigates to original model page-->
 
               </div>
 
               </div>
 
             </div>
 
             </div>
Line 157: Line 641:
 
       <div class="col-lg-12 feature" style="">
 
       <div class="col-lg-12 feature" style="">
 
             <div class="row">
 
             <div class="row">
                 <h3>Bone Incision Data</h3>
+
                 <h2><b>Bone Incision Data</b></h2>
             <p><font color="white"><!--Font colour is set as white--> Lorem ipsum dolor sit amet, nostrud maiestatis quaerendum ne sed. Reque possit ne sea. Te dico labitur mediocritatem ius. Error timeam noluisse eos ad, eam ne magna meliore contentiones, nec ei volumus persecuti.
+
<br>
 +
             <p>Below is the raw data recorded for the Bone Incision Experiment. Hover the mouse on the image to see the analysed data, including errors, which was used to produce the graph seen on the <a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate">Bone Incision Experiment</a> page. </p>
  
Dicit animal definitionem et mel, nonumy tacimates nec in. Vis mucius periculis at. At est vidit scripserit repudiandae, agam porro sea ne. Sea et stet tibique praesent, vim et legere aperiri. Quo doming vocibus eleifend no.
+
<img src="https://static.igem.org/mediawiki/2015/a/a1/Rawdataarchsmldund15.png" onmouseover="this.src='https://static.igem.org/mediawiki/2015/9/9a/Analyseddataarchsmldund15.png'" onmouseout="this.src='https://static.igem.org/mediawiki/2015/a/a1/Rawdataarchsmldund15.png'" height="100%" width="100%" /></a>
  
Cu vis partem graeci facilisis. Falli inciderint mei no. Assentior suscipiantur mea id. Vis quas electram prodesset cu, choro omnium conclusionemque an his. Vis latine equidem perfecto ad.</font></p>
+
<br>
 +
<br>
 +
<a href="#selection" class="btn btn-info btn-lg pull-right" role="button">&uarr;</a><!--Button that takes user to top of page.-->
 +
<a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate#bone" class="btn btn-primary btn-lg pull-right" role="button">View description of experiment</a>
 
</div>
 
</div>
 
            
 
            
 
           <div class="col-lg-12 feature" style="">
 
           <div class="col-lg-12 feature" style="">
 
             <div class="row">
 
             <div class="row">
                 <h3>Bone Incision Experiment Code</h3>
+
                 <h2><b>Bone Incision Experiment Code</b></h2><br>
             <p><font color="white"><!--Font colour is set as white-->
+
             <p>The code used in Matlab to produce the parabolic surface plot on the <a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate">Bone Incision Experiment</a> page, which relates the wear volume to the length of the blade and the force of stabbing.</p>
code.</font></p>
+
 
</div>
 
</div>
  
Line 197: Line 684:
 
</pre>
 
</pre>
  
<a href="#selection" class="btn btn-primary btn-lg pull-right" role="button">Back to Top</a> <!--Button that navigates back to top-->
+
<a href="#selection" class="btn btn-info btn-lg pull-right" role="button">&uarr;</a><!--Button that takes user to top of page.-->
<a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate#bone" class="btn btn-primary btn-lg pull-right" role="button">View Description of Experiment</a>        <!--Navigates back to original section-->
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Chromate#bone" class="btn btn-primary btn-lg pull-right" role="button">View description of experiment</a>        <!--Navigates back to original section-->
 
               </div>
 
               </div>
 
             </div>
 
             </div>
 
              
 
              
  
       </div>
+
        
 
     </section>
 
     </section>
  
Line 218: Line 705:
 
           <div class="col-lg-12 feature" style="">
 
           <div class="col-lg-12 feature" style="">
 
             <div class="row">
 
             <div class="row">
<font color="white"><!--Sets font colour to white--><p>To see the MATLAB code for the BioSpray section of the project or the Fingerprint Aging section of the project use the following buttons.</font></p>
+
<br><p>To see the MATLAB code for the FluID section of the project or the Fingerprint Ageing section of the project use the following buttons.<br></p>
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix2" class="btn btn-primary btn-lg pull-right" role="button">Appendix 2: Fingerprint Aging</a>  <!--Navigates to previous appendix-->
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix2" class="btn btn-primary btn-lg pull-right" role="button">Appendix 2: Fingerprint Ageing</a>  <!--Navigates to previous appendix-->
  
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix1"  class="btn btn-primary btn-lg pull-right" role="button">Appendix 1: BioSpray</a>  <!--Navigates to 1st appndix page-->
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix1"  class="btn btn-primary btn-lg pull-right" role="button">Appendix 1: FluID</a>  <!--Navigates to 1st appndix page-->
 
   </div>
 
   </div>
 
      
 
      

Latest revision as of 22:11, 18 September 2015

Dry Lab


Appendix 3: Chromate Biosensor Code

Chromate Model Code

Bone Incision Experimental Data

Bone Incision Experiment Code

Chromate Model Code


The figures shown in the Chromate Biosensor model were created using MATLAB. Two files were written to perform sensitivity analysis; one to set the function (chromate.m) and one to solve the function and plot the results in Figure 3, Figure 4 , Figure 5 and Figure 6 (run_chromate.m). Both files are shown below, where the green is comments to aid in understanding of the scripts.



  MATLAB code from chromate.m file
% Function to define the system of ODEs describing the modified chromate pathway.
%% Section 1: Function to define the system of ODEs describing the modified chromate pathway.
% The vector u has seven dimensions where;
% u(1) = ChrB protein concentration,
% u(2) = ChrB dimer concentration,
% u(3) = Cv, the hexavalent chromate added to the system concentration,
% u(4) = Dimer and Cv complex concentration,
% u(5) = Pc, the closed (bound and non-functioning) promoter concentration,
% u(6) = Po. the open (unbound and functioning) promoter concentration,
% u(7) = GFP output concentration.
% Parameter t is time that the simulation runs over. 
% Parameters k1..k8 represent the kinetic rates of the system.
% L represents leakiness of the system.
function f=chromate(t,u,L);
k1 = 1;
k2 = 1;
k3 = 1;
km3 = 1;
k4 = 1;
km4 = 1;
k5 = 1;
k6 = 1;
km6=1;
k7 = 1;
% k8 divided by 60 as in minutes not hours.
k8=(0.25/60);
% Set S1 and S2 at specific times which represent whether chromate is present or not
% S is the signal input.

S1=0;
S2=1;
if (t<500)% Where time is less than 500 seconds.
    S=S1;

else if (t>500) && (t<3100)% Where time is more than 500 seconds and less than 3100 seconds.
        S=S2;

    else if (t>3100)% Where time is more than 3100 seconds.
            S=S1;
        end
    end
end % If and else if loop sets the times when chromate is present or absent from the system.
% Define f as a vector where the input is the right hand side of the systems of ODEs representing the pathway with signal input incorporated.
f=[k1 - k2*u(1)+km3*u(2)-k3*u(1)*u(1);
    k3*u(1)*u(1)-km3*u(2)+(km4*u(4))-(k4*u(2)*u(3)*S)-k5*u(2)+(km6*u(5)*S)-k6*u(2)*u(6);
    -k4*u(2)*u(3)*S+km4*u(4);
     k4*u(2)*u(3)*S-km4*u(4);
     k6*u(6)*u(2)-km6*u(5)*S;
     -k6*u(6)*u(2)+km6*u(5)*S;
    L+k7*u(6)*S-k8*u(7)];
 % End function.
end
% This function can then be called using the @chromate command in run_chromate.m file.
% END OF FILE
 MATLAB code from chrom_wt.m file
%% Function to define the system of ODEs describing the original chromate pathway.
% The vector u has seven dimensions where;
% u(1) = ChrB protein concentration,
% u(2) = ChrB dimer concentration,
% u(3) = Cv, the hexavalent chromate added to the system concentration,
% u(4) = Dimer and Cv complex concentration,
% u(5) = Pc, the closed (bound and non-functioning) promoter concentration,
% u(6) = Po. the open (unbound and functioning) promoter concentration,
% u(7) = GFP output concentration.
% Parameter t is time that the simulation runs over. 
% Parameters k1..k8 represent the kinetic rates of the system.
% L represents leakiness of the system.
function f=chrom_wt(t,u,L);
k2 = 1;
k3 = 1;
km3 = 1;
k4 = 1;
km4 = 1;
k5 = 1;
k6 = 1;
km6=1;
k7 = 1;
% k8 divided by 60 as in minutes not hours.
k8=(0.25/60);
% Set S1 and S2 at specific times which represent whether chromate is present or not.
% S is the signal input.

S1=0;
S2=1;
if (t1<500)% Where time is less than 500 seconds.
    S=S1;

else if (t1>500) && (t1<3100)% Where time is more than 500 seconds and less than 3100 seconds.
        S=S2;

    else if (t1>3100)% Where time is more than 3100 seconds.
            S=S1;
        end
    end
end % If and else if loop sets the times when chromate is present or absent from the system.
% Define f as a vector where the input is the right hand side of the systems of ODEs representing the pathway with signal input incorporated.
f=[L+k7*u(6)-k2*u(1)+km3*u(2)-k3*u(1)*u(1);
    k3*u(1)*u(1)-km3*u(2)+(km4*u(4))-(k4*u(2)*u(3)*S)-k5*u(2)+(km6*u(5)*S)-k6*u(2)*u(6);
    -k4*u(2)*u(3)*S+km4*u(4);
     k4*u(2)*u(3)*S-km4*u(4);
     k6*u(6)*u(2)-km6*u(5)*S;
     -k6*u(6)*u(2)+km6*u(5)*S;
     L+k7*u(6)*S-k8*u(7)];
 % End function.
end
% This function can then be called using the @chrom_wt command in run_chromate.m file
%
%
% END OF FILE




 MATLAB code from run_chromate.m file
%% File to solve chromate functions.
%% Section 1: Solving the modified system to investigate GFP production with chromate added and removed at specific times.
% a = Initial ChrB protein concentration.
a = 1;
% b = Initial ChrB dimer concentration.
b = 1;
% c = Initial Cv, chromate, concentration.
c =1;
% d = Initial Cv and dimer complex concentration.
d = 0;
% e = Initial Pc, closed promoter, concentration.
e = 0;
% f = Initial Po, open promoter, concentration.
f = 1;
% g = Initial GFP concentration.
g = 0.01;
% T = Final time of simulation, in seconds.
T=3600;
% Solve the function using ode23 solver with set time range and defined initial conditions.
% Save time values in vector t and u(1)..u(7) values in matrix u with no leakiness, L=0.
[t,u]=ode23(@chromate,[0,T],[a,b,c,d,e,f,g],[],0);

% Call up empty figure 1 to prevent overwriting figures.
figure1=figure(1)
% Plot t vector against the 7th column of the u matrix, that is the GFP concentration, and set linewidth to 3 so that it is easily read.
plot(t,u(:,7), 'LineWidth',3);
% Ensure that axis fits the data by using axis tight command.
axis tight
% Remove the values on the x and y axis as they are not relevant.
set(gca,'YTick',[],'XTick',[]);
% Annotate the figure by adding arrows along the x and y axis to represent increasing time and Fluorescence.
annotation(figure1,'arrow',[0.133928571428571 0.914285714285714],...
    [0.0466190476190482 0.0476190476190482],'LineWidth',4);
annotation(figure1,'arrow',[0.0982142857142857 0.0982142857142857],...
    [0.103761904761905 0.919047619047619],'LineWidth',4);
% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.
annotation(figure1,'textarrow',[0.3875 0.25],...
    [0.346619047619048 0.119047619047619],'Color',[1 0 0],...
    'String',{'Chromate Added'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
annotation(figure1,'textarrow',[0.682142857142857 0.789285714285714],...
    [0.779952380952381 0.919047619047619],'Color',[1 0 0],...
    'String',{'Chromate Removed'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
% Set the labels of the x and y axis to Time and Fluorescence, respectively.
xlabel ('Time', 'FontSize', 15);
ylabel ('Fluorescence','FontSize', 15);
% Add a legend for GFP Response.
legend1=legend('GFP Response');
% Make the box around legend bold and make font bigger, also position legend so that it is easily read.
set(legend1,...
    'Position',[0.468154768530456 0.149603206588803 0.360714277944395 0.0626984112082966],...
    'LineWidth',2,...
    'FontWeight','bold',...
    'FontSize',12);
% END OF SECTION
%
%

%% Section 2: Sensitivity analysis on effect of chromate added to GFP production in modified pathway.
% n = Number of different values of chromate evaluated.
n=10;
% T = Final time of simulation, in seconds.
T=3600;
% c1 = The range of values used for initial chromate concentration, with minimum at 0 and maximum at 400.
c1=linspace(0,400,n);
% Call up figure 2 to ensure no figures are overwritten.
figure2=figure(2)
% Set hold on so that multiple lines will be plotted on same figure.
hold on
% Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.
for i=1:n
 % Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.
    % The initial concentration of chromate will depend on the value of i within the for loop.
    % The values will be stored in the t vector and u matrix with no leakiness, L=0.
    [t,u]=ode23(@chromate,[0,T],[a,b,c1(i),d,e,f,g],[],0);
    % Plot the GFP concentration over time.
    plot(t,u(:,7), 'LineWidth',2);
% End the for loop.
end
% Then switch hold off so that no more lines are plotted on figure.
hold off
% Set axis to tight so that plot fits the data.
axis tight
% Add a rectangle onto the graph to highlight the section that will be zoomed in on in figure 3.
annotation('rectangle',[0.236714285714286 0.561904761904762 0.213285714285714 0.354761904761906], 'LineStyle','--');
% Remove the values of the x and y axis as they are not necessary.
set(gca,'YTick',[],'XTick',[]);
% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.
annotation(figure2,'arrow',[0.133928571428571 0.914285714285714],...
    [0.0466190476190482 0.0476190476190482],'LineWidth',4);
annotation(figure2,'arrow',[0.0982142857142857 0.0982142857142857],...
    [0.103761904761905 0.919047619047619],'LineWidth',4);
% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.
annotation(figure2,'textarrow',[0.3875 0.25],...
    [0.346619047619048 0.119047619047619],'Color',[1 0 0],...
    'String',{'Chromate Added'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
annotation(figure2,'textarrow',[0.682142857142857 0.789285714285714],...
    [0.779952380952381 0.919047619047619],'Color',[1 0 0],...
    'String',{'Chromate Removed'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
% Set the labels of the x and y axis to Time and Concentration, respectively.
xlabel ('Time', 'FontSize', 15);
ylabel ('Fluorescence','FontSize', 15);
%
% We will now replot figure 2 but zoom in on a specific section for clarity.
%
%
% Call up empty figure 3 to prevent overwriting figures.
figure3=figure(3)
% Set hold on so that multiple lines will be plotted on same figure.
 hold on
 % Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.
 for i=1:n
 % Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.
   
    % The initial concentration of chromate will depend on the value of i within the for loop.
    % The values will be stored in the t vector and u matrix with no leakiness, L=0.
    [t,u]=ode23(@chromate,[0,T],[a,b,c1(i),d,e,f,g],[],0);
    % Plot the GFP concentration over time.
    plot(t,u(:,7), 'LineWidth',2);
% End the for loop.
 end
 % set hold off, so that no more lines are plotted.
hold off
% Ensure that axis fits the data by using axis tight command.
axis tight
% Remove the values on the x and y axis as they are not relevant and set the x and y limits so that we get a zoomed in section of the plot.
set(gca,'YTick',[],'XTick',[], 'XLim',[909.850230414748 1359.85023041475],'YLim',[163.478891218168 187.138947135872]);
% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.
annotation(figure3,'arrow',[0.133928571428571 0.914285714285714],...
    [0.0466190476190482 0.0476190476190482],'LineWidth',4);
annotation(figure3,'arrow',[0.0982142857142857 0.0982142857142857],...
    [0.103761904761905 0.919047619047619],'LineWidth',4);
% Add a 3rd arrow to the plot to show increasing initial concentration of Cv in the legend.
annotation(figure3,'arrow',[0.817857142857141 0.817857142857143],...
    [0.597619047619051 0.238095238095238],'LineWidth',4);
% Set legend as just lines with no text, as text will be added later using paint (see wiki figures).
legend2=legend('','','','','','','','','','');
% Set the position of the legend and the width of the box line.
set(legend2,...
    'Position',[0.631547602609266 0.207142857142858 0.255952397390734 0.413492042689934],...
    'LineWidth',2);
% Set the labels of the x and y axis to Time and Concentration, respectively.
xlabel ('Time', 'FontSize', 15);
ylabel ('Fluorescence','FontSize', 15);
% END OF SECTION
%
%



%% Section 3: Solving the original system to investigate GFP production with chromate added and removed at specific times.
% The same initial conditions are used as modified systems so they do not need to be redefined.
% Solve the chrom_wt function using ode23 solver with set time range and defined initial conditions.
% Save time values in vector t and u(1)..u1(7) values in matrix u with no leakiness, L=0.
[t,u]=ode23(@chrom_wt,[0,T],[a,b,c,d,e,f,g],[],0);
% Call up a new figure to ensure figures are not overwritten.
figure4=figure(4)
% Plot t vector against the 7th column of the u matrix, that is the GFP concentration, and set linewidth to 3 so that it is easily read.
plot(t,u(:,7), 'LineWidth',3);
% Ensure that axis fits the data by using axis tight command.
axis tight
% Remove the values on the x and y axis as they are not relevant.
set(gca,'YTick',[],'XTick',[]);
% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.
annotation(figure4,'arrow',[0.133928571428571 0.914285714285714],...
    [0.0466190476190482 0.0476190476190482],'LineWidth',4);
annotation(figure4,'arrow',[0.0982142857142857 0.0982142857142857],...
    [0.103761904761905 0.919047619047619],'LineWidth',4);
% Add line to show modified level in comparrison.
annotation(figure4,'line',[0 1],...
    [0.9310344828 0.9310344828],'Color',[1 0 1],'LineWidth',2,...
    'LineStyle','--');
% Add text box.
annotation(figure4,'textbox',...
    [0.147428571428571 0.714285714285715 0.116857142857143 0.145238095238096],...
    'Color',[1 0 1],...
    'String',{'Modified','Pathway','Max','GFP'},...
    'LineStyle','none',...
    'FontWeight','bold',...
    'FontSize',12,...
    'FitBoxToText','off');
% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.
annotation(figure4,'textarrow',[0.3875 0.25],...
    [0.346619047619048 0.119047619047619],'Color',[1 0 0],...
    'String',{'Chromate Added'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
annotation(figure4,'textarrow',[0.682142857142857 0.789285714285714],...
    [0.779952380952381 0.919047619047619],'Color',[1 0 0],...
    'String',{'Chromate Removed'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
% Set the x and y labels to Increasing Time and Increasing concentration.
xlabel ('Time', 'FontSize', 15);
ylabel ('Fluorescence','FontSize', 15);
% Add a legend for GFP Concentration.
legend3=legend('GFP Response');
% Set the legend position, box line width and font size/style.
set(legend3,...
    'Position',[0.468154768530456 0.149603206588803 0.360714277944395 0.0626984112082966],...
    'LineWidth',2,...
    'FontWeight','bold',...
    'FontSize',12);
% END OF SECTION
%
%



%% Section 4: Sensitivity analysis on effect of chromate added to GFP production in original pathway.
% Again set n as the number of values used for initial chromate.
n=10;
% T = Final time of simulation, in seconds.
T=3600;
% c1 = The range of values used for initial chromate concentration, with minimum at 0 and maximum at 400.
c1=linspace(0,400,n);
% Call up figure 5 to ensure no figures are overwritten.
figure5=figure(5)
% Set hold on so that multiple lines will be plotted on same figure.
hold on
% Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.
for i=1:n
 % Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.
    % The initial concentration of chromate will depend on the value of i within the for loop.
    % The values will be stored in the t vector and u matrix with no leakiness, L=0.
    [t,u]=ode23(@chrom_wt,[0,T],[a,b,c1(i),d,e,f,g],[],0);
    % Plot the GFP concentration over time.
    plot(t,u(:,7), 'LineWidth',2);
% End the for loop.
end
% Then switch hold off so that no more lines are plotted on figure.
hold off
% Set the axis to tight so that the data fits the plot.
axis tight
% Add a rectangle onto the graph to highlight the section that will be zoomed in on in figure 6.
annotation('rectangle',[0.236714285714286 0.561904761904762 0.213285714285714 0.354761904761906], 'LineStyle', '--');
% Remove the values on the x and y axis as they are not relevant.
set(gca,'YTick',[],'XTick',[]);
% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration.
annotation(figure5,'arrow',[0.133928571428571 0.914285714285714],...
    [0.0466190476190482 0.0476190476190482],'LineWidth',4);
annotation(figure5,'arrow',[0.0982142857142857 0.0982142857142857],...
    [0.103761904761905 0.919047619047619],'LineWidth',4);
% Annotate the figure by adding text arrow to highlight where the chromate is added and removed.
annotation(figure5,'textarrow',[0.3875 0.25],...
    [0.346619047619048 0.119047619047619],'Color',[1 0 0],...
    'String',{'Chromate Added'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
annotation(figure5,'textarrow',[0.682142857142857 0.789285714285714],...
    [0.779952380952381 0.919047619047619],'Color',[1 0 0],...
    'String',{'Chromate Removed'},...
    'LineWidth',4,...
    'FontWeight','bold',...
    'FontSize',12);
% Set the x and y labels as increasing Time and Increasing Concentration respectively.
xlabel ('Time', 'FontSize', 15);
ylabel ('Fluorescence','FontSize', 15);
%
% We now want to replot figure 5 with a section zoomed in.
%
% Call up figure 6 so that no other plots are overwritten.
figure6=figure(6)
% Set hold on so that multiple line can be plotted on one graph.
 hold on
 % Set a for loop so that the n values for chromate are evaluated individually and the system solved for each of them.
 for i=1:n
 % Solve the chromate function using ode23 solver over set time range and same initial conditions for all variables except chromate.
    % The initial concentration of chromate will depend on the value of i within the for loop.
    % The values will be stored in the t vector and u matrix with no leakiness, L=0.
    [t,u]=ode23(@chrom_wt,[0,T],[a,b,c1(i),d,e,f,g],[],0);
    % Plot the GFP concentration over time.
    plot(t,u(:,7), 'LineWidth',2);
% End the for loop.
 end
 % Set hold off so that no more lines are plotted on the figure.
hold off
% Ensure that axis fits the data by using axis tight command.
axis tight
% Remove the values on the x and y axis as they are not relevant and set the x and y limits so that we get a zoomed in section of the plot.
set(gca,'YTick',[],'XTick',[], 'XLim',[909.850230414748 1359.85023041475],'YLim',[163.478891218168 187.138947135872]);
% Annotate the figure by adding arrows along the x and y axis to represent increasing time and concentration
annotation(figure6,'arrow',[0.133928571428571 0.914285714285714],...
    [0.0466190476190482 0.0476190476190482],'LineWidth',4);
annotation(figure6,'arrow',[0.0982142857142857 0.0982142857142857],...
    [0.103761904761905 0.919047619047619],'LineWidth',4);
% Add a 3rd arrow to the plot to show increasing initial concentration of Cv in the legend.
annotation(figure6,'arrow',[0.817857142857141 0.817857142857143],...
    [0.597619047619051 0.238095238095238],'LineWidth',4);
% Set legend as just lines with no text, as text will be added later using paint (see wiki figures).
legend4=legend('','','','','','','','','','');
% Set the position of the legend and the width of the box line.
set(legend4,...
    'Position',[0.631547602609266 0.207142857142858 0.255952397390734 0.413492042689934],...
    'LineWidth',2);
% Set the x and y labels to Increasing Time and Increasing Concentration respectively.
xlabel ('Time', 'FontSize', 15);
ylabel ('Fluorescence','FontSize', 15);
%
%
% END OF SECTION


%% Section 5: Leakiness of both the modified and original pathways.
% All parameters are set as previous sections.
% Solve the chrom_wt function using ode23 solver with set time range and defined initial conditions.
% Save time values in vector t and u(1)..u(7) values in matrix u with leakiness L set at 0.05. 
[t,u]=ode23(@chrom_wt,[0,T],[a,b,c,d,e,f,g],[],0.05);
% Solve the chromate function using ode23 solver with set time range and defined initial conditions.
% Save time values in vector t1 and u1(1)..u1(7) values in matrix u1 with leakiness L set at 0.05.
[t1,u1]=ode23(@chromate,[0,T],[a,b,c,d,e,f,g],[],0.05);
% Call up a new figure to ensure figures are not overwritten.
figure7=figure(7);
% Plot t vector against the 7th column of the u matrix and plot t1 against the 7th column of u1 on the same plot for comparrison.
% Set linewidth to 2 so that it is easily read.
hold on
plot(t,u(:,7),'LineWidth',2);
plot(t1,u1(:,7),'LineWidth',2);
hold off
% Ensure that axis fits the data by using axis tight command.
axis tight
% Remove the values on the x and y axis as they are not relevant.
 set(gca,'YTick',[],'XTick',[]);
% Annotate the figure by adding arrows along the x and y axis to represent increasing Time and Fluorescence.
 annotation(figure7,'arrow',[0.133928571428571 0.914285714285714],...
     [0.0466190476190482 0.0476190476190482],'LineWidth',4);
 annotation(figure7,'arrow',[0.0982142857142857 0.0982142857142857],...
     [0.103761904761905 0.919047619047619],'LineWidth',4);

%  Annotate the figure by adding text arrow to highlight where the chromate is added and removed.

 annotation(figure7,'textarrow',[0.3875 0.25],...
     [0.346619047619048 0.119047619047619],'Color',[1 0 0],...
     'String',{'Chromate Added'},...
     'LineWidth',4,...
'FontWeight','bold',...
     'FontSize',12);
 annotation(figure7,'textarrow',[0.682142857142857 0.789285714285714],...
     [0.779952380952381 0.919047619047619],'Color',[1 0 0],...
     'String',{'Chromate Removed'},...
     'LineWidth',4,...
     'FontWeight','bold',...
     'FontSize',12);
% Set the x and y labels to Time and Fluoresence.
 xlabel ('Time', 'FontSize', 15);
 ylabel ('Fluorescence','FontSize', 15);
% Add a legend to distinguish between the to pathways.
 legend5=legend('Original pathway','Modified pathway');
% Set the legend position, box line width and font size/style.
 set(legend5,...
     'Position',[0.468154768530456 0.149603206588803 0.360714277944395 0.0626984112082966],...
     'LineWidth',2,...
     'FontWeight','bold',...
     'FontSize',12);
% END OF SECTION
%
%
%END OF FILE
View description of model

Bone Incision Data


Below is the raw data recorded for the Bone Incision Experiment. Hover the mouse on the image to see the analysed data, including errors, which was used to produce the graph seen on the Bone Incision Experiment page.



View description of experiment

Bone Incision Experiment Code


The code used in Matlab to produce the parabolic surface plot on the Bone Incision Experiment page, which relates the wear volume to the length of the blade and the force of stabbing.


  MATLAB code from bone.m file


k=6.23*10^(-9);%wear coefficient
W=zeros(1,101);%zero vector for calculated volume of bone incision m^3
s=(0:0.001:0.1);%range of values for blade length m, from 0 to 10cm
p=(0:2:200);%range of values for applied force N, from 0 to 200N

for i=1:101
    for j=1:101
    W(i,j)=k*p(i)*s(j); %Archards Equation in two for loops
    %to create a matrix of possible values for volume
end
end

surf(p,s,W)%creates a surface plot, where the height and therefore colour are dependand on the matric W
grid on
title('Relationship Between Volume of Bone Incison, Force and Blade length')
zlabel('Volume of Incision/m^3')
ylabel('Blade Length/m')
xlabel('Applied Load/N')
View description of experiment

To see the MATLAB code for the FluID section of the project or the Fingerprint Ageing section of the project use the following buttons.

Appendix 2: Fingerprint Ageing Appendix 1: FluID