
Function: Z_CP_DIM
******************
  Description: Partial Molar Heat capacity for the unfolding of a dimeric protein 
  Parameters:  a0 a1 a2 a3 a4 a5 a6 a7 a8

  Notes:
	see Yu et al. 1999 J. Phys. Chem. 103, 2270-

    a0= first order parameter for Cp,N (kJ/K^2 mol) 
    a1= zero order parameter for Cp,N (kJ/K mol)
    a2= second order parameter for Cp,U (kJ/K^3 mol)
    a3= first order parameter for Cp,U (kJ/K^2 mol)
    a4= zero order parameter for Cp,U (kJ/K mol)
    a5= DHu (kJ/mol, in monomer units)
    a6= Tmax (K) - the temperature must be in K
    a7= conc (M, monomer units)
    a8= second order parameter for Cp,N (kJ/K^3 mol)

    Function is undefined at x=0.0.

  C-code:
    c = x * 0.008314;
    d = x * x * a[8] + x * a[0] + a[1];
    e = x * x * a[2] + x * a[3] + a[4];
    f = ((a[4] - a[1])*(x - a[6])) + ((0.5 * (a[3] - a[0])) * ((x*x) - (a[6] *
        a[6]))) + ((0.3333 * (a[2] - a[8])) * (pow(x,3.0) - pow(a[6],3.0)));
    s = ((a[4] - a[1])*(log(x) - log(a[6]))) + ((a[3] - a[0])*(x-a[6]))
	    + ((0.5 * (a[2] - a[8])) * ((x*x) - (a[6]*a[6])));
    s = 2.0 * s;
    g = 2.0 * (f + a[5]);
    h = exp((x * 2.0 * ((a[5] / a[6]) + s + 0.008314 * log(1.66 * a[7])) - g) / c);
    v = ((-1.0 * h + sqrt(h * h + 8.0 * a[7] * h)) / 4.0 * a[7]);
    w = (v * (1.0 - v) / (2.0 - v)) * (2.0 * g * g / (c * x));
    answer = d + w + (v * (e-d));

  Future Notes:
    Here was the un-verified c-code for the monomer case:
    c = x * 0.008314;
    d = x * x * a[7] + x * a[0] + a[1];
    e = x * x * a[2] + x * a[3] + a[4];
    f = ((a[4] - a[1])*(x - a[6])) + ((0.5 * (a[3] - a[0])) * ((x*x) - (a[6] *
        a[6]))) + ((0.3333 * (a[2] - a[8])) * (pow(x,3.0) - pow(a[6],3.0)));
    s = ((a[4] - a[1])*(log(x) - log(a[6]))) + ((a[3] - a[0])*(x-a[6])) + ((0.5 *
        (a[2] - a[7])) * ((x*x) - (a[6]*a[6])));
    g = f + a[5];
    h = exp((x * ((a[5] / a[6]) + s) - g) / c);
    v = h / (1.0 + h);
    w = v * (1.0 - v) * (g * g / (c * x));
    answer = d + w + (v * f);

  Future Notes:
    Here was the un-verified c-code for the trimer case:
    c = x * 0.008314;
    d = x * x * a[8] + x * a[0] + a[1];
    e = x * x * a[2] + x * a[3] + a[4];
    f = ((a[4] - a[1])*(x - a[6])) + ((0.5 * (a[3] - a[0])) * ((x*x) - (a[6] *
        a[6]))) + ((0.3333 * (a[2] - a[8])) * (pow(x,3.0) - pow(a[6],3.0)));
    s = ((a[4] - a[1])*(log(x) - log(a[6]))) + ((a[3] - a[0])*(x-a[6])) + ((0.5 *
        (a[2] - a[8])) * ((x*x) - (a[6]*a[6])));
    g = f + a[5];
    h = exp(x*((a[5]/a[6]) + s + 0.008314 * log(2.09*a[7]*a[7])-g)/c);
    i = sqrt(1.0 + ( h / (20.25 * a[7]*a[7])));
    j = (h / (6.0 * a[7]*a[7])) * (1.0 + i);
    k = (h / (6.0 * a[7]*a[7])) * (1.0 - i);
    v = pow(j, 0.3333333) + pow(k, 0.3333333);
    w = (v * (1.0 - v) / (3.0 - (2.0 * v))) * (3.0 * g * g / (c * x));
    answer = d + w + (v * (e-d));
