#include #include #include #include #define dim 22 #define abt 1 /*sampling rate*/ #define N 40000 /*number of iterations*/ /*T=N*h, where T is the real time. This is independent of abt.*/ /***********************************************************/ /********************** PARAMETERS *************************/ /***********************************************************/ double mu = 0.45; double theta_HSL = 0.24; double theta_IPTG = 0.0137; double rho_production = 10; double rho_latch = 10; double rho_lysis = 10; double rho_antilysis = 10; double rho_qs = 10; double rho_luxi = 10; double beta_production_max = 0.44; double beta_production_min = 0.013; double beta_production_max_luxi = 0.02; double beta_production_min_luxi = 0.000015; double beta_latch = 0.28; double beta_lysis = 0.0426; double beta_antilysis = 0.0066; double beta_qs = 0.018; double K_laci = 700; //guessed double K_ci = 7000; //guessed double K_tetr = 7000; //guessed double K_P = 700; //guessed double K_IPTG_laci = 1200; //guessed double n_laci = 2; double n_ci = 2; double n_tetr = 3; double n_P = 2; double gamma_protein = 0.1; double k_on_iptg_laci = 0.001; double k_off_iptg_laci = 0.033; double k_on_P = 0.00001; double k_off_P = 0.00333; double alpha_mrna = 0.006; double alpha_X = 0.0000080225; double alpha_Y = 0.0000080225; double alpha_ci = 0.002888; // taged double alpha_laci = 0.002888;// taged double alpha_tetr = 0.002888; // taged double alpha_holin = 0.0002 ; //guessed double alpha_antiholin = 0.0002 ; //guessed double alpha_endolysin = 0.0002; // guessed double alpha_luxi = 0.00288811; // taged double alpha_luxr = 0.0002; double alpha_hsl = 0.00017; double alpha_p = 0.0002; // void RungeKutta(float y[],float h,float dy[]); float *diff_eq(float y[], float dy[]); main() { remove("result1.dat"); double a, h=0.5; int i,j,k; float y[dim],dy[dim]; // Initialising ODEs for(i=0; i<=21; i++) { y[i]=0.0; dy[i]=0.0; } // Set up file FILE *outfile1; outfile1=fopen("result1.dat","w"); fprintf(outfile1,"prod latch lysis antilysis qs X Y ci laci tetr holin endolysin antiholin luxi luxr hsl P iptg IPTG_utside hsl_outside\n"); //Define Input for(j=1;j15000) {y[18]=50000; } //HSL_outside if(j>25000) {y[19]=50000; } if(j>30000) //Turns IPTG off {y[18]=0; } k++; // Print Output fprintf(outfile1,"%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n",y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15],y[16],y[17],y[18],y[19],y[20]); // Integrating RungeKutta(y,h,dy); } fclose(outfile1); return 0; } void RungeKutta(float y[],float h,float dy[]) { int i; float k1[dim],k2[dim],k3[dim],k4[dim],y1[dim],y2[dim],y3[dim],*p_dy; p_dy=diff_eq(y,dy); for(i=0;i