- #1
Lord Dark
- 121
- 0
Hi guys ,,
I made a program to find the volume/mol using van der waals EOS
I know that my mistake is in
I made a program to find the volume/mol using van der waals EOS
/* following equation is van der waals eos which gives you the volume per mol */
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
int main ()
{
double p, // pressure in KPa
v, // volume in meter cubed
r, // gas constant or universal constant
t, // tempreture in kelvin
a,b, // van der waals constants
tcr,pcr ;// the critical points of the pressure & tempreture
r = 8.318 ;
cout << " Enter the value of pressure in KPa = " ;
cin >> p ; cout << endl ;
cout << " Enter the value of the tempreture in Kelvin = " ;
cin >> t ; cout << endl ;
cout << " Enter the value of the pressure critical point in Kpa = ";
cin >> pcr ; cout << endl ;
cout << " Enter the value of the temrpeture critical point in K = ";
cin >> tcr ; cout << endl ;
a = (27*pow(r,2)*pow(tcr,2))/(64*pcr);
b = (r*tcr)/(8*pcr);
p = ((r*t)/(v-b)) - (a/pow(v,2)) ;
cout << " The value of the Volume in m3/mol = " << v ;
return 0;
}
I know that my mistake is in
the problem is that I can't let v be alone ,, so can anyone help me to find a way to slove for v ??p = ((r*t)/(v-b)) - (a/pow(v,2))