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

Line 135: Line 135:
  
 
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>
 
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="keyword">function</span> f=chromate(t,u);
 +
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;
 +
    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 SECTION</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%</span>
 +
<span class="comment">%% Function to define the system of ODEs describing the original chromate pathway.</span>
 +
<span class="comment">% Function to define the system of ODEs describing the modified chromate pathway.</span>
 +
<span class="comment">%% Section 1: Function to define the system of ODEs describing the modified chromate pathway.</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="keyword">function</span> f=chrom_wt(t1,u1);
 +
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=[k7*u1(6)-k2*u1(1)+km3*u1(2)-k3*u1(1)*u1(1);
 +
    k3*u1(1)*u1(1)-km3*u1(2)+(km4*u1(4))-(k4*u1(2)*u1(3)*S)-k5*u1(2)+(km6*u1(5)*S)-k6*u1(2)*u1(6);
 +
    -k4*u1(2)*u1(3)*S+km4*u1(4);
 +
    k4*u1(2)*u1(3)*S-km4*u1(4);
 +
    k6*u1(6)*u1(2)-km6*u1(5)*S;
 +
    -k6*u1(6)*u1(2)+km6*u1(5)*S;
 +
    k7*u1(6)*S-k8*u1(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>
 +
</pre>
 
</div>
 
</div>
 
               </div>   
 
               </div>   

Revision as of 16:47, 20 August 2015

Dry Lab

Appendix 3: Chromate Biosensor Code

Chromate Model Code

MATLAB code for chromate model.

Bone Incision Experimental Data

Raw data for the bone incision experiments.

Bone Incision Experiment Code

MATLAB code for the bone incision experiments.

Chromate Model Code

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. 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.


  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.
function f=chromate(t,u);
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;
     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 SECTION
%
%
%% Function to define the system of ODEs describing the original chromate pathway.
% 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.
function f=chrom_wt(t1,u1);
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=[k7*u1(6)-k2*u1(1)+km3*u1(2)-k3*u1(1)*u1(1);
    k3*u1(1)*u1(1)-km3*u1(2)+(km4*u1(4))-(k4*u1(2)*u1(3)*S)-k5*u1(2)+(km6*u1(5)*S)-k6*u1(2)*u1(6);
    -k4*u1(2)*u1(3)*S+km4*u1(4);
     k4*u1(2)*u1(3)*S-km4*u1(4);
     k6*u1(6)*u1(2)-km6*u1(5)*S;
     -k6*u1(6)*u1(2)+km6*u1(5)*S;
     k7*u1(6)*S-k8*u1(7)];
 % End function.
end
% This function can then be called using the @chrom_wt command in run_chromate.m file
%
%
% END OF FILE
Back to Top View Description of Model

Bone Incision Data

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. 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.

Bone Incision Experiment Code

code.


  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')
Back to Top View Description of Experiment

To see the MATLAB code for the BioSpray section of the project or the Fingerprint Aging section of the project use the following buttons.

Appendix 2: Fingerprint Aging Appendix 1: BioSpray