/* ** NL5.E ** ** Extended Powell Singular Function ** ** A test program for nonlinear equation solution. ** (See Dennis and Schnabel, 1983 and More', Garbow ** and Hillstrom); ** ** The equations to be solved are: ** ** For n = 1: ** ** Eq 1: x1 + 10*x2 = 0 ** Eq 2: sqrt(5)*(x3 - x4) = 0 ** Eq 3: (x2 - 2*x4)^2 ** Eq 2: sqrt(10)*(x1 - x4)^2 = 0 ** ** Starting values: ** x0 = 3,-1,0,1 ** Solution: ** x* = 0,0,0,0 ** ** References: ** Dennis and Schnabel 1983, ** Numerical Methods for Unconstrained Optimization and ** Nonlinear Equations (New Jersey: Prentice-Hall) ** */ library nlsys; nlset; proc F(x); local f1,f2,f3,f4; f1 = x[1] + 10*x[2]; f2 = sqrt(5)*(x[3] - x[4]); f3 = (x[2] - 2*x[4])^2; f4 = sqrt(10)*(x[1] - x[4])^2; retp(f1|f2|f3|f4); endp; output file = nl5.out reset; /* starting values */ let x0 = 3 -1 0 1; _nlchpf = 0; _nlalgr = 1; _nlfvtol = 1e-8; __title = "Extended Powell Singular Function"; { x,fvp,jc,tcode }= nlprt(nlsys(&f,x0)); output off;