#include #include #include using namespace std; int main (int argc, char *argv[]) { // Declare variables, stick to cgs units for everything: // s (in sec), D (in cm^2/sec), rho (density, in g/cm^3) // eta (viscosity, in g/(cm*sec)), R (gas constant, in erg (erg/(K*Mol)) // T (temperature, in Kelvin), M (molar mass, in g/Mol) // vbar (partial specific volume, in cm^3/g), f (frictional coefficient, in g/sec) // f0 (frictional coefficient of minimal sphere) // ff0 (frictional ratio, dimensionless) // r (radius of molecule, in cm), r0 (radius of minimal sphere, in cm) // rs (radius of Stokes Sphere, in cm), V0 (volume of minimal sphere, in cm^3) // Assign constants: double s=4.2e-13, D=7.5e-7, rho=1.0, R=8.314e7, T=293.15, M,vbar=0.72, Avogadro=6.0221408e+23, eta=0.01; // eta has units of poise, or g/(cm*sec) // Declare variables: double f, f0, ff0, r, r0, V, V0, Vdiff, rs; // calculate frictional coefficient (in g/sec, or cm*poise, poise units: g/(cm*sec)): f = R*T/(D*Avogadro); // Calculate Stokes Radius (in cm): rs = f/(6*M_PI*eta); // Calculate molar mass (in Dalton, or grams/mol): M=s*R*T/(D*(1-vbar*rho)); // Calculate volume of minimal sphere (in cm^3, or ml): V0 = M*vbar/Avogadro; // Calculate radius of minimal sphere (in cm): r0 = pow(V0*3.0/(4.0*M_PI), 1.0/3.0); // Calculate frictional coefficient of minimal sphere (in cm*poise): f0 = 6.0*M_PI*eta*r0; // Calculate frictional ratio (dimensionless): ff0 = f/f0; // Output result: cout << "V0: " << V0 << " cm^3\nrs: " << rs << " cm\nr0: " << r0 << " cm\nf: " << f << " g/sec\nf0: " << f0 << " g/sec\nM: " << M << " Dalton\nf/f0: " << ff0 << endl; }