function F = findCp(x,par)

cpc0=x(1);
cph0=x(2);

T0      = par(1);
Th1in   = par(2);
m0      = par(3);
mh      = par(4);
cpcin   = par(5);
cphin   = par(6);
UA      = par(7);
n       = par(8);

cpc = (cpcin+cpc0)/2;
cph = (cphin+cph0)/2;

wc = m0*cpc;
wh = mh*cph;

global T1; global Th1;
[T1 Th1] = tempCalc(T0,Th1in,wc,wh,UA,n);

cpc_n = (2*0.0021297*T1 + 1.7895)*1000;
cph_n = (2*0.0019783*Th1 + 1.7771)*1000;

F = [cpc_n - cpc0;
    cph_n - cph0];