/*------------------------------------------------------------------------- | The software accompanies the paper | | | | Classes and Objects of Chemical Thermodynamics in Object-Oriented | | Programming. 2. A Class of Chemical Species | | | | E.B. Rudnyi | | E-mail: rudnyi@comp.chem.msu.su | | Homepages: http://www.chem.msu.su/~rudnyi/welcome.html | | | | presented at Second Electronic Computational Chemistry Conference, | | November 1995, http://hackberry.chem.niu.edu/ECCC2/ | --------------------------------------------------------------------------*/ #include #include #include "func_Tp.h" #include "memtst.h" int main() { memory test; func_Tp a, aT, ap, aTp, aT2, ap2; ifstream in("func_Tp1.dat"); in >> a >> aT >> ap >> aTp >> aT2 >> ap2; for (global::T = 10.; global::T < 101.; global::T += 45) for (global::p = 1.; global::p < 11.; global::p += 5) { cout << "T is " << global::T << " and p is " << global::p << endl; cout << "value of f is" << setw(10) << a() << endl; cout << "derivative numerical analytical" << endl; cout << "df/dT " << setw(10) << a.df(global::dT) << setw(12) << aT() << endl; cout << "df/dp " << setw(10) << a.df(global::dp) << setw(12) << ap() << endl; cout << "d2f/dTdp " << setw(10) << a.df(global::dTp) << setw(12) << aTp() << endl; cout << "d2f/dT2 " << setw(10) << a.df(global::dT2) << setw(12) << aT2() << endl; cout << "d2f/dp2 " << setw(10) << a.df(global::dp2) << setw(12) << ap2() << endl; cout << "press RETURN to continue"; cin.get(); cout << endl; } return 0; }