X, Y, Z, and C cannot be complex.
Error in Untitled (line 66)
surf(X, Y, Z);
proj
ky
0.0100
The solution was obtained on a mesh of 754 points.
The maximum residual is 2.042e-06.
There were 39912 calls to the ODE function.
There were 274 calls to the BC function.
The solution was obtained on a mesh of 192 points.
The maximum residual is 8.109e-06.
There were 6379 calls to the ODE function.
There were 110 calls to the BC function.
Warning: Unable to meet the tolerance without using more than 1250 mesh points.
The last mesh of 892 points and the solution are available in the output argument.
The maximum residual is 0.184664, while requested accuracy is 1e-05.
The solution was obtained on a mesh of 2674 points.
The maximum residual is 1.847e-01.
There were 85426 calls to the ODE function.
There were 341 calls to the BC function.
Error using surf (line 71)
X, Y, Z, and C cannot be complex.
Error in solution>proj (line 69)
surf(X, Y, Z);
^^^^^^^^^^^^^^
rhof=997.1*10^-3;kf=0.613*10^5;cpf=4179*10^4;muf=10^-3*10;
bef=21*10^-5;sigf=0.05*10^-8;
k1=429*10^5;be1=21*10^-5;
kn=kf*((k3+2*kf-2*ph3*(kf-k3))/(k3+2*kf+ph3*(kf-k3)));
kh=kn*((k2+2*kn-2*ph2*(kn-k2))/(k2+2*kn+ph2*(kn-k2)));
kt=kh*((k1+2*kh-2*ph1*(kh-k1))/(k1+2*kh+ph1*(kh-k1)));
mut= muf/((1-ph1)^2.5*(1-ph2)^2.5*(1-ph3)^2.5);
rhot=(1-ph1)*((1-ph2)*((1-ph3)+ph3*(rho3/rhof))+ph2*(rho2/rhof))+ph1*(rho1/rhof);
sigt = sigf + (3 * ((ph1 * sig1 + ph2 * sig2) - sigf * (ph1 + ph2)) /(((ph1 * sig1 + ph2 * sig2) / (sigf * (ph1 + ph2))) + 2 - ((ph1 * sig1 + ph2 * sig2) / sigf) + (ph1 + ph2)));
vt =(1-ph1)*((1-ph2)*((1-ph3)+ph3*((rho3*cp3)/(rhof*cpf)))+ph2*((rho2*cp2)/(rhof*cpf)))+ph1*((rho1*cp1)/(rhof*cpf));
vb =(1-ph1)*((1-ph2)*((1-ph3)+ph3*((rho3*be3)/(rhof*bef)))+ph2*((rho2*be2)/(rhof*bef)))+(1-ph1)*ph1*((rho1*be1)/(rhof*bef));
myLegend1 = {};myLegend2 = {};
y0 = [0,1,0,1,0,0,0,0];options =bvpset('stats','on','RelTol',1e-5);
Z = zeros(numn, length(m));
solinit = bvpinit(m, y0);
sol = bvp4c(@projfun, @projbc, solinit, options);
Z(i, :) = deval(sol,m,1);
[X, Y] = meshgrid(m, rr);
zlabel('Solution y(6,:)');
title('Surface Plot of Solution');
function dy = projfun(~, y)
dy(2) =(R^((1-n)/2)*(muf/mut)*(rhot/rhof)*(f^2-g^2+R*h*df+(sigt/sigf)*M*f))^(1/n);
dy(4) = (R^((1-n)/2)*(muf/mut)*(rhot/rhof)*(f*g+R*dg+(sigt/sigf)*M*g))^(1/n);
dy(6) =(R^((-n))*((muf/mut)*(rhot/rhof)*(2*h*f+R*h*dh)-2*h))^(1/n);
dy(8)=(1/(1+(4/3)*Rd*(1/(kt/kf))))*(1/R)*(-t-Qh*Pr*(kf/kt)*t+Pr*((vt/(rhof*cpf))*(kf/kt)*(f*t+R*h*dt)));
function res= projbc(ya,yb)