%Numerical integration of the mutual repression switch
clear all
%Parameters:
r=30; %Production at maximum mRNA number in 1/min
gamma=1/30; %Degradation rate in 1/min
Kd=200; %Dissociation constant
dt=0.1; %Time step for our calculation
TotalTime=100; %Total time of integration
%How many steps of integration do we need to take?
NumberTimeSteps=TotalTime/dt;
R1(1)=900; %Initial conditions
R2(1)=300;
%We also need ot keep track of time
Time(1)=0;
for i=2:NumberTimeSteps
%At each time point account for production and degradation of mRNA
%molecules
R1(i)=R1(i-1)-gamma*R1(i-1)+r/(1+(R2(i-1)/Kd)^2);
R2(i)=R2(i-1)-gamma*R2(i-1)+r/(1+(R1(i-1)/Kd)^2);
Time(i)=Time(i-1)+dt;
end
%Plot them
figure(2)
plot(Time,R1,'-k')
hold on
plot(Time,R2,'-r')
hold off
%Add our trajectory to the phase diagram
figure(1)
hold on
plot(R1,R2,'og')
hold off