POLYMATH Report          NLE 
 Nonlinear Equations 2016-May-30 

Calculated values of NLE variables
    Variable Value f(x) Initial Guess Initial f(x)
1 x 5 -2.6E-12 2 2.1E02
2 y 20 1.3E-12 10 -8.4E01

    Variable Value Initial Value
1 t 5 1.39794

Nonlinear equations
1 f(x) = 2*x+x*y-y^2 + 290 = 0
2 f(y) = t+x*y - 105 = 0

Explicit equations
1 t = x*log(y/2)

Problem source text
# S. 8 - NLE System
# Solve a system of 2 nonlinear equations
# Verified Solution: x=5, y =20
# 2*x+x*y-y^2 = -290
# x*log(y/2)+x*y = 105
f(x) = 2*x+x*y-y^2 + 290
f(y) = t+x*y - 105
t = x*log(y/2)
x(0) = 2
y(0) = 10

Matlab formatted problem
Create m file called PolyNles.m and paste the following text into it.
% S. 8 - NLE System
% Solve a system of 2 nonlinear equations
% Verified Solution: x=5, y =20
% 2*x+x*y-y^2 = -290
% x*log(y/2)+x*y = 105
function PolyNles
   xguess = [2 10]; % initial guess vector
   x = fsolve(@MNLEfun, xguess);
   fprintf('The NLEs solution is:\n');
   fprintf('x = %g\n',x(1));
   fprintf('y = %g\n',x(2));
end

function fvec = MNLEfun(IndepVarsVec)
   x = IndepVarsVec(1);
   y = IndepVarsVec(2);
   t = x * log10(y / 2);
   fvec(1,1) = 2 * x + x * y - (y ^ 2) + 290;
   fvec(2,1) = t + x * y - 105;
end

General Settings
Total number of equations 3
Number of implicit equations 2
Number of explicit equations 1
Elapsed time 0.00 sec
Reporting digits 8
Solution method safenewt
Max iterations 150
Tolerance F 1E-07
Tolerance X 1E-07
Tolerance min 1E-07