MATLAB: I am writing a code to solve a set of nonlinear equations using fsolve, but i keep getting this message “no solution found” and also ” fsolve stopped because the last step was ineffective. the vector of function value is not near zero “

fsolvenonlinear

This is the function file below.
function E=trial2(s)
u = 10; % wind speed
Ta=286;% ambient temp in kelvin
hwind = 2.3 + u; %(convective heat transfer coeff)
G=1000; % solar radiation
Tg=15; % glass temp
Rpvg=0.0014286; % resistance of glass-pv
Rbpv=1.93*10^(-3);% resistance of base pv
Tsky=0.0552*Ta^1.5; % radiation sky temp
alpha_g=1; % absoprptivity of glass
epsilon_g=0.84;% emissivity of glass
sigma=5.67*(10^8);% boltzman's constant
hrad=epsilon_g*sigma*(Tg^2+Tsky)*(Tg+Tsky); % radiation heat transfer coefficient
Tpv=s(1);
Tb=s(2);
E(1)=(Tpv/Rpvg)-(Tg*(hwind+(1/Rpvg)))-(Tg*hrad)+(hrad*Tsky)-(Ta*hwind)+(G*alpha_g);% glass energy balance equation
E(2)=G*alpha_g+((1/Rpvg)*(Tg-Tpv))+((1/Rbpv)*(Tb-Tpv));% pv thermal balance eqn
end
and the execution script below
sg = [50;50]; % iterating with random temperature
s = fsolve(@trial2,sg) % using fsolve to get Tpv and Tb

Best Answer

If you have the Symbolic Toolkit, then you can use
s = [sym('S1'), sym('S2')];
E = trial2(s);
s1 = solve(E(1), s(1));
s2 = solve(subs(E(2),s(1),s1),s(2));
double(s1), double(s2)
The outputs are approximately -23786403074636.8 and -55921190932736.1
Considering the 50 and 50 you used as starting values, I suspect you are not expecting values that large and negative, but these are the solutions given those equations.