00001 #include "hydrationheat.h"
00002
00003 hydrationheat::hydrationheat (void)
00004 {
00005
00006 }
00007
00008 hydrationheat::~hydrationheat (void)
00009 {
00010
00011 }
00012
00013
00014
00015
00016
00017
00018
00019
00020 void hydrationheat::read (XFILE *in)
00021 {
00022 xfscanf (in,"%lf %lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f,&r);
00023
00024
00025 aa=a*f*r;
00026 bb=b/pow(c*3600.0,d);
00027 cc=bb*d*e;
00028 }
00029
00030
00031
00032
00033
00034
00035
00036
00037 void hydrationheat::print (FILE *out)
00038 {
00039 fprintf (out,"%lf %lf %lf %lf %lf %lf %lf\n",a,b,c,d,e,f,r);
00040 }
00041
00042
00043
00044
00045
00046
00047
00048
00049 double hydrationheat::give_value (double t)
00050 {
00051 double z,denom,nom1,nom2;
00052
00053 denom=e+bb*pow(t,d);
00054 nom1=bb*pow(t,d);
00055 nom2=cc*pow(t,d-1);
00056
00057 z=aa*pow(nom1/denom,f-1)*nom2/denom/denom;
00058
00059 return z;
00060 }
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 long hydrationheat::compare(hydrationheat &hh)
00077 {
00078 if (a != hh.a)
00079 return 1;
00080 if (b != hh.b)
00081 return 1;
00082 if (c != hh.c)
00083 return 1;
00084 if (d != hh.d)
00085 return 1;
00086 if (e != hh.e)
00087 return 1;
00088 if (f != hh.f)
00089 return 1;
00090 if (r != hh.r)
00091 return 1;
00092 if (aa != hh.aa)
00093 return 1;
00094 if (bb != hh.bb)
00095 return 1;
00096 if (cc != hh.cc)
00097 return 1;
00098
00099 return 0;
00100 }