status = mkdir('D:\PK79'); cd D:\PK79
filePath = 'D:\PK79\ADM3A.xlsx'; filename = 'ADM3A.xlsx';
T = fillmissing(d,"previous");
p1 = 0.01; p2 = 0.0; p3 = 0.0;
K = T.K; M = T.M; Pr = T.Pr; Ec = T.Ec; Q = T.Qe; D = T.D; b = T.b; Bi = T.Bi;
Cp = 1;rf = 7;kf = 0.6;sf = 5.5; C1 = 7;rhos1 = 1;k1 = 4;s1 = 1;
C2 = 5;r2 = 2;k2 = .5;s2 = 2.7; C3 = 6.2;r3 = 2;k3 = .9;s3 = 6.2;
H1 = ((1-p1)*(1-p2)*(1-p3))^-2.5; H2 = (1-p3)*( (1-p2)*( 1-p1 + p1*rhos1/rf ) + p2*r2/rf ) + p3*r3/rf;
H3 = (1-p3)*( (1-p2)*(1-p1 + p1*rhos1*C1/(rf*Cp)) + p2*r2*C2/(rf*Cp) ) + p3*r3*C3/(rf*Cp);
C2 = ( (s1+2*sf-2*p1*(sf-s1))/(s1+2*sf+p1*(sf-s1)));
C3 = ( (s2+2*C2-2*p2*(C2-s2))/(s2+2*C2+p2*(C2-s2)) );
A3 = ( (s3+2*C3-2*p3*(C3-s3))/(s3+2*C3+p3*(C3-s3)) );
B1 = ( (k1+2*kf-2*p1*(kf-k1))/(k1+2*kf+p1*(kf-k1)) );
B2 = ( (k2+2*B1-2*p2*(B1-k2))/(k2+2*B1+p2*(B1-k2)) );
H4 = ( (k3+2*B2-2*p3*(B2-k3))/(k3+2*B2+p3*(B2-k3)) );
N = size(T,1); Cf = zeros(N,1); Nu = zeros(N,1);
ODE = @(x,y)[y(2); y(3); y(4);
M(k)*(x+K(k)).^2*(A3/H1).*(y(2) + (x+K(k)).*y(3)) - 2*y(4)./(x+K(k)) + y(3)./(x+K(k)).^2 - y(2)./(x+K(k)).^3 - (H2/H1)*K(k)*((x+K(k)).^2.*(y(1)*y(4) - y(2)*y(3))) - y(1)*y(2) + (x+K(k)).*(y(1)*y(3)-y(2)^2);
y(6); - (Pr(k)/H4)*( Q(k)*(y(5) + exp(-D(k)*x)) + H3*K(k)*y(1)*y(6) + M(k)*Ec(k)*A3*y(2)^2 ) - y(6) ];
BC = @(ya,yb)[ya(1); ya(2)-1-b(k)*(ya(3)-ya(2)/K(k)); ya(6)-Bi(k)*(ya(5)-1); yb([2;3;5])];
solinit = bvpinit(x,[0 1 0 1 0 1]);
sol = bvp5c(ODE,BC,solinit);
Cf(k) = H1*( S(3,1) - S(2,1)/K(k));
vars = T.Properties.VariableNames;
T = removevars(T,vars(startsWith(vars,'Var')));
writetable(T,filename,'WriteMode','overwritesheet')