Chemical Reaction Engineering Mini Project
Chemical Reaction Engineering Mini Project
: : : :
R.K. PRABHU 09CH24 VI semester B. Tech (Chemical Engineering) Coimbatore Institute of Technology, Coimbatore 14
Date
24.02.2012
QUESTION:
Write a C program to find the order of the reaction, given the respective half life and initial concentration.
PROGRAM CODING:
double log(double e); double log(double f); double log(double g); double log(double h); clrscr(); printf("\nHow many number of data are available?..."); scanf("%d",&i); for(p=0;p<i;p++) { printf("\nEnter the half life of data %d...",p+1); scanf("%lf",&t[p]); printf("\nEnter the initial concentration of data %d...",p+1); scanf("%lf",&c[p]); } sum=0; x=0; for(p=0;p<i;p++) { e=t[p]; f=t[p+1]; g=c[p]; h=c[p+1]; v[p]=(log(e)-log(f))/(log(g)-log(h));
if(v[p]<0) n[p]=1-v[p]; else if(v[p]==0) n[p]=1; else n[p]=1+v[p]; sum=sum+n[p]; } x=sum/i; printf("\nThe order is %.2lf",x); getch(); }
OUTPUT:
How many number of data are available?... 5 Enter the half life of data 1... 1 Enter the initial concentration of data 1... 1 Enter the half life of data 2... 1 Enter the initial concentration of data 2... 14 Enter the half life of data 3... 1 Enter the initial concentration of data 3... 542 Enter the half life of data 4... 1 Enter the initial concentration of data 4... 1234 Enter the half life of data 5... 1 Enter the initial concentration of data 5... 17895 The order is 1.00