#include #include #include #include /******************************************************************** ********************Bactomotion mulitdimentional********************* ********************************************************************/ /* Program solves the internal dynamics of the bacteria individually whilst simulating each bacterial movement in a chemotaxtic gradient */ /********************************************************************** * Taken Rory's Chemotaxis Program, and converted into C * * and changed the program to handle a population of * * Bacteria. By Stuart * **********************************************************************/ #define steps 30000 #define pop 40 double D,aspartate_time,time2,theta1[pop],zeta1[pop],pathx1[steps],pathy1[steps],pathz1[steps], xdist1[steps],pipe1[steps],dist1[steps][pop],completion,v,p1,q1,bactox[steps][pop],bactoy[steps][pop]; double pi=3.14159265; int t,p; FILE *f1_p; main() { remove("bacto.dat"); D = 7.0*pow(10,-10); srand(time(0)); //Initalise the random number generator f1_p=fopen("bacto.dat","w"); printf("time in minutes that aspartate diffuses for ="); scanf ("%lf",&aspartate_time); time2 = aspartate_time*60; /************************************************** *******************Inital Conditions*************** **************************************************/ for(p=0;p