MATLAB code

From OpenWetWare

Jump to: navigation, search

Home The Project B.subtilis Chassis Wet Lab Dry Lab Notebook


%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');
Personal tools