%pcoumProdSim
global k kcat Km AroP Vcell Vout Vtot;

k=[0.03;log(2)/(5.2*60);(42/1575);log(2)/(10*60*60)+log(2)/(30*60)];% Rate constants in s^-1 [mRNA production;mRNA degradation;TAL production;TAL degradation]; 
Km=[0.57;100]; %Km for enzymes/transporters in µM [AroP;TAL]
kcat=[100;0.9]; %Turnover numbers in s^-1 [AroP;TAL]
AroP=1.48*10^6/(6.0221413e+23*1.1*10^-15); %Concentration of Tyrosine transporter AroP in cell in µM
yzero = [25*(1/(6.0221413e+23))*10^6*(1/(1.1*10^-15));0;0;2000;29;0]; % initial values. [DNA:mRNA;TAL;Tyr outside;Tyr inside;p-com tot]
time=48; %How many hours do you want to simulate?
%Relative volume of compartments
Vcell=0.0044; %Volume of cells in 1 ml/1 ml. The ratio which cell volume takes up in the medium.
Vtot=1;
Vout=Vtot-Vcell;

%Solve ODE:s numerically with ode15s or ode45 etc.
[T,Y]=ode15s(@pcoumRates,[0 (time*60*60)],yzero);

%Plotting
figure();

subplot(2,1,1);
hold all;
plot(T./(60*60),Y(:,1),'b');
plot(T./(60*60),Y(:,2),'r');
plot(T./(60*60),Y(:,3),'g');
ylabel('Concentration [µM]');
xlabel('Time [hours]');
legend('DNA','mRNA','TAL','Location','East')
set( findobj(gca,'type','line'), 'LineWidth', 2);
grid on;

subplot(2,1,2);
hold all;
colormap=hsv(13);
plot(T./(60*60),Y(:,4),'color',colormap(3,:));
plot(T./(60*60),Y(:,5),'color',colormap(2,:));
plot(T./(60*60),Y(:,6),'color',colormap(4,:));
ylabel('Concentration [µM]');
xlabel('Time [hours]');
legend('Tyrosine outside cell','Tyrosine inside cell','Total p-coumaric acid','Location','East')
set( findobj(gca,'type','line'), 'LineWidth', 2);
grid on;