0

Chemical Reaction

Posted March 24th, 2010 in Programming Corner and tagged , , , , by Paran

#include<iostream.h>

#include<conio.h>

void main()

{  clrscr();

float A[52], B[52], C[52], k1= 0.008, k2= 0.002, del= 0.1, time= 0.0;

A[0]= 100.0; B[0]= 50.0; C[0]= 0.0;

cout<<”\tTime\tA][i]\t\tB[i]\t\tC[i]\n\n”;

for( int i=0; i<51; i++ ){

cout<<”\t”<< time<<”\t”<< A[i]<<”\t\t”<< B[i]<<”\t\t”<< C[i]<<”\n”;

A[i+1] = A[i] + ( k2 * C[i] – k1*A[i]*B[i] ) * del;

B[i+1] = B[i] + ( k2 * C[i] – k1*A[i]*B[i] ) * del;

C[i+1] = C[i] + 2 * ( k1 * A[i] * B[i] – k2 * C[i] ) * del;

time = time + del;

}

getch();

}

Please share your better concept about this program.

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: +1 (from 1 vote)
Share and Enjoy:
  • Facebook
  • Twitter
  • Google Bookmarks
  • Print
  • Live
  • Digg
  • Sphinn
  • Mixx
  • Add to favorites

Leave a Reply





  • Page 1 of 1
  • « Previous
  • 1
  • Next »