Java

Wednesday 1 April 2015

Java program to find the state of a system in chemical reactor for a given a amount of time at a specified internal.

program:


import java.io.*;
import java.Text.DecimalFormat;
class ch;
{
int i=1,n;
double k1,k2,delta,time=0;
double a[]=new double[50];
double b[]=new double[10];
double c[]=new double[10];
DecimalFormat t=new DecimalFormat("0.000");
Scanner S=new Scanner(System.in);
System.out.println("enter a[i],b[i],c[i],delta,k1,k2,value");
a[i]=S.nextDouble[];
b[i]=S.nextDouble[];
c[i]=S.nextDouble[];
delta=S.nextDouble[];
k1=S.nextDouble[];
k2=S.nextDouble[];
n=S.nextDouble[];
System.out.println("time \t a[i] \t b[i] \t c[i]");
for(i=1;i<=n;i++)
{
System.out.println(" "+t.Format(time)+"\t"+t.Format a(i)"\t"+t.Format (b(i))+"\t"+t.Format(c(i));
a[i+1]=a[i]+(k2*c[i]-k1*a[i]*b[i])*delta;
b[i+1]=b[i]+(k2*c[i]-k1*a[i]*b[i])*delta;
c[i+1]=c[i]+2.0*(k1*a[i]*b[i]-k2*c[i])*delta;
}
}
}



Create your own website Click here......  



1 comment:

  1. Best Slot Games & Slots 2021 - Lucky Club Live Casino
    The Best Games & Slots 2021 · 7. Starburst · 6. Wild Streak · 5. Hot Safari · 4. Mustang Gold · 3. Mega Moolah · 2. Extra Chilli · 1. luckyclub.live Super X · Free Spins

    ReplyDelete