# Function code

function dy=ty_m2gc(t,y)

%%sets parameters

global k1 k2 k3 glucose dm1 dm2 dm3 kp1 kp2 kp3 km1 km2 km3 n1 n2 n3 dp1 dp2 dp3

%%

%equations

%%hill function

fhill1 = (k1*km1^n1)/(km1^n1+glucose^n1);

fhill2 = (k2*km2^n2)/(km2^n2+glucose^n2);

fhill3 = (k3*km3^n3)/(km3^n3+glucose^n3);

%RcsB

dy(1)=fhill1-dm1*y(1);

dy(2) = y(1)*kp1-dp1*y(2);

%B3023

dy(3)=fhill2-dm2*y(3);

dy(4) = y(3)*kp2-dp2*y(4);

%Waal Ligase

dy(5)=fhill3-dm3*y(5);

dy(6) = y(5)*kp3-dp3*y(6);

dy=[dy(1);dy(2);dy(3);dy(4);dy(5);dy(6)];

# Function call

%function call

global k1 k2 k3 glucose dm1 dm2 dm3 kp1 kp2 kp3 km1 km2 km3 n1 n2 n3 dp1 dp2 dp3

k1=1;

k2=1;

k3=1;

dm1=1;

dm2=1;

dm3=1;

kp1=1;

kp2=1;

kp3=1;

km1=1;

km2=1;

km3=1;

n1=1;

n2=1;

n3=1;

dp1=1;

dp2=1;

dp3=1;

i=1 %loop counter

%%

%varying glucose input

for glucose=[0:1:10];

[T,Y]=ode45(@ty_m2gc,[0:1:50], [0 0 0 0 0 0]);

A2(:,i) = Y(:,2); %RcsB

A4(:,i) = Y(:,4); %B3023

A6(:,i) = Y(:,6); %Waal Ligase

i=i+1;

end

subplot(1,3,1); plot(T,A2); TITLE('RcsB');xlabel('Time');ylabel('[RcsB]');

subplot(1,3,2); plot(T,A4); TITLE('B3023');xlabel('Time');ylabel('[B3023]');

subplot(1,3,3); plot(T,A6); TITLE('Waal ligase');xlabel('Time');ylabel('[Waal ligase]');