/* ** NL1.E ** */ library nlsys; nlset; proc f(x); local f1,f2,f3; f1 = 3*x[1] +0.2*x[2] - 1/x[3]; f2 = x[3]*x[1]/x[2]; f3 = x[1] + x[3]^2 - 5/x[2]; retp(f1|f2|f3); endp; proc gdf(x); local df1,df2,df3; df1 = 3~0.2~(1/x[3]^2); df2 = (x[3]/x[2])~(-x[3]*x[1]/x[2]^2)~(x[1]/x[2]); df3 = 1~(5/x[2]^2)~2*x[3]; retp(df1|df2|df3); endp; x0 = zeros(3,1); x0[1] = 1; x0[2] = 8; x0[3] = 3; _nlalgr = 1; _nlajac = &gdf; output file = nl1.out reset; __title = "NL1.E - Using an Analytic Jacobian"; { x1,fvp1,jc,tcode } = nlprt(nlsys(&f,x0)); /* Solution is (0,5,1) */ output off;