MATLAB: Solving 8 equations with 8 unknowns using FSOLVE

fsolve

I have 8 equations with 8 unknowns as shown bellow. please how can I solve them and find the unkowns. I tried FSOLVE coding and it showed an error (Error using fsolve (line 298). Objective function is returning undefined values at initial point. FSOLVE cannot continue.). So, please could you help me to find the issue.
function F = radwan(x)
jw1=1.787;
jw2=3.0375;
DHv=2257; %kj/kg (40.65 kj/mol)
Tbf1=35;
Tbf2=45.6;
Tbp1=10.9;
Tbp2=12.7;
Q1=17000.763;
Q2=26000.778;
C1=0.680046641;
C2=0.754098;
hm1=1;
hm2=1;
F(1)=x(1)*(Tbf1-x(2))-Q1;
F(2)=hm1*(x(2)-x(3))+jw1*DHv-Q1;
F(3)=x(4)*(x(3)-Tbp1)-Q1;
F(4)= x(5)*(Tbf2-x(6))-Q2;
F(5)=hm2*(x(6)-x(7))+jw2*DHv -Q2;
F(6)=x(8)*(x(7)-Tbp2)-Q2;
F(7)=C1*((exp(-6.4313+(1882/x(2)))/exp(-6.4313+(1882/x(6))))^0.14)-(x(5)/x(1));
F(8)=C2*((exp(-6.4313+(1882/x(3)))/exp(-6.4313+(1882/x(7))))^0.14)-(x(8)/x(4));

Best Answer

you have divisions by x1, x2, x3, x4, x6, and x7. Your code would fail if the initial values for any of those are 0.
Related Question