MATLAB code

From OpenWetWare
Jump to navigationJump to search

<html> <style type="text/css"> .firstHeading {display: none;} </style> </html> <html> <style type="text/css">

   table.calendar          { margin:0; padding:2px; }

table.calendar td { margin:0; padding:1px; vertical-align:top; } table.month .heading td { padding:1px; background-color:#FFFFFF; text-align:center; font-size:120%; font-weight:bold; } table.month .dow td { text-align:center; font-size:110%; } table.month td.today { background-color:#3366FF } table.month td {

   border:2px;
   margin:0;
   padding:0pt 1.5pt;
   font-size:8pt;
   text-align:right;
   background-color:#FFFFFF;
   }
  1. bodyContent table.month a { background:none; padding:0 }

.day-active { font-weight:bold; } .day-empty { color:black; } </style> </html>

<html><a href=http://openwetware.org/wiki/IGEM:IMPERIAL/2008/Prototype><img width=50px src=http://openwetware.org/images/f/f2/Imperial_2008_Logo.png></img</a></html> Home The Project B.subtilis Chassis Wet Lab Dry Lab Notebook

<html> <style type="text/css"> div.Section { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; }

/* Text (paragraphs) */ div.Section p { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:justify; margin-top:0px; margin-left:30px; margin-right:30px; }

/* Headings */ div.Section h1 { font:22pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:left; color:#3366FF; }

/* Subheadings */ div.Section h2 { font:18pt Calibri, Verdana, Arial, Geneva, sans-serif; color:#3366FF; margin-left:5px; }

/* Subsubheadings */ div.Section h3 { font:16pt Calibri, Verdana, Arial, sans-serif; font-weight:bold; color:#3366FF; margin-left:10px; }

/* Subsubsubheadings */ div.Section h4 { font:12pt Calibri, Verdana, Arial, sans-serif; color:#3366FF; margin-left:15px; }

/* Subsubsubsubheadings */ div.Section h5 { font:12pt Calibri, Verdana, Arial, sans-serif; color:#3366FF; margin-left:20px; }

/* References */ div.Section h6 { font:12pt Calibri, Verdana, Arial, sans-serif; font-weight:bold; font-style:italic; color:#3366FF; margin-left:25px; }

/* Hyperlinks */ div.Section a {

}

div.Section a:hover {

}

/* Tables */ div.Section td { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:justify; vertical-align:top; padding:2px 4px 2px 4px; }

/* Lists */ div.Section li { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:left; margin-top:0px; margin-left:30px; margin-right:0px; }

/* TOC stuff */ table.toc { margin-left:10px; }

table.toc li { font: 11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align: justify; margin-top: 0px; margin-left:2px; margin-right:2px; }

/* [edit] links */ span.editsection { color:#BBBBBB; font-size:10pt; font-weight:normal; font-style:normal; vertical-align:bottom; } span.editsection a { color:#BBBBBB; font-size:10pt; font-weight:normal; font-style:normal; vertical-align:bottom; } span.editsection a:hover { color:#3366FF; font-size:10pt; font-weight:normal; font-style:normal; vertical-align:bottom; }

  1. sddm {

margin: 0; padding: 0; z-index: 30 }

  1. sddm li {

margin: 0; padding: 0; list-style: none; float: center; font: bold 12pt Calibri, Verdana, Arial, Geneva, sans-serif; border: 0px }

  1. sddm li a {

display: block; margin: 0px 0px 0px 0px; padding: 0 0 12px 0; background: #33bbff; color: #FFFFFF; text-align: center; text-decoration: none; }

  1. sddm li a:hover {

border: 0px }

  1. sddm div {

position: absolute; visibility: hidden; margin: 0; padding: 0; background: #33bbff; border: 1px solid #33bbff } #sddm div a { position: relative; display: block; margin: 0; padding: 5px 10px; width: auto; white-space: nowrap; text-align: left; text-decoration: none; background: #FFFFFF; color: #2875DE; font: 11pt Calibri, Verdana, Arial, Geneva, sans-serif } #sddm div a:hover { background: #33bbff; color: #FFFFFF } </style></html>


%define the function file

function [vdot] = growth(t,v)

% a general growth model where the concentration of nutrient does not have any influence on the bacterial growth

k=1;


%The Hill function

nutrient = 21; %concentration of nutrient

n = 0.8;  % the Hill coefficient, describes how cooperative the two variable are

Ka = 10.5;  % the nutrient concentration occupying half of the cell

theta = (nutrient^n) / (((Ka)^n) + (nutrient^n));


%the Hill Function, models the cooperativitiy between the bacteria and nutrients

vdot = k*(theta)*v;


(In a separate M-file)


%calling the function

[t, v] = ode45('growth', [0, 5], 1);

k=1;

v_true = exp(k*t); %the analytical solution

nutrient = 21; %concentration of nutrient

n = 0.8;  % the Hill coefficient, describes how cooperative the two variable are

Ka = 10.5;  % the nutrient concentration occupying half of the cell

%the Hill Function, models the cooperativitiy between the bacteria and nutrient

theta = (nutrient^n) / (((Ka)^n) + (nutrient^n));


v1_true = exp(theta*t);

nutrient2 = 40;

%the Hill Function, models the cooperativitiy between the bacteriam and nutrient

theta2 = (nutrient2^n) / (((Ka)^n) + (nutrient2^n));


v2_true = exp(theta2*t);

nutrient3 = 80;

%the Hill Function, models the cooperativitiy between the bacteria and nutrient

theta3 = (nutrient3^n) / (((Ka)^n) + (nutrient3^n));


v3_true = exp(theta3*t);

nutrient4 = 100;

%the Hill Function, models the cooperativitiy between the bacteria and nutrient

theta4 = (nutrient4^n) / (((Ka)^n) + (nutrient4^n));

v4_true = exp(theta4*t);


%plot

subplot(2,2,1);

plot(t, v, 'o', t, v_true), xlabel('Time(s)');

%NB: solution of t and v in dots, solution of t and v_true is shown in line


ylabel('growth');

title('ODE model showing the growth rate where the growth rate is constant ');

subplot(2,2,2);

plot(t,v,'o', t, v1_true), xlabel('Time(s)');


%NB: solution of t and v in dots, solution of t and v_true (analytical solutionn) is shown in line


ylabel('growth');

title('ODE model showing the relationship between the growth rate and the internal concentration[21] with a Hill Function');

subplot (2,2,3);

plot(t,v,'o', t, v2_true), xlabel('Time(s)');


%NB: solution of t and v in dots, solution of t and v_true is shown in line

ylabel('growth');

title('ODE model showing the relationship between the growth rate and the internal concentration[40] with a Hill Function');

subplot (2,2,4);

plot(t,v,'o', t, v4_true), xlabel('Time(s)');


%NB: solution of t and v in dots, solution of t and v_true is shown in line

ylabel('growth');

title('ODE model showing the relationship between the growth rate and the internal concentration[100] with a Hill Function');