9 May 2025 9:46:51.014 PM test_nls_test(): Fortran90 version Test test_nls(). Show how the sample problems can be used. In this example, we use the sample problems with the MINPACK routine LMDER1. 1: Linear function, full rank. Number of equations M = 10 Number of variables N = 5 Starting point X: 1.00000 1.00000 1.00000 1.00000 1.00000 F(X): -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -2.00000 -2.00000 -2.00000 -2.00000 -2.00000 The least squares gradient: 1 4.00000 2 4.00000 3 4.00000 4 4.00000 5 4.00000 LMDER1 return flag INFO = 3 Relative error in X and sum of squares at most TOL. Final point X: -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 F(X): -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 0.222045E-15 0.222045E-15 0.222045E-15 0.222045E-15 0.222045E-15 The least squares gradient: 1 -0.111022E-15 2 -0.888178E-15 3 0.00000 4 -0.888178E-15 5 -0.111022E-15 Solution X: -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 F(X): -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 The least squares gradient: 1 -0.111022E-15 2 0.00000 3 0.00000 4 0.00000 5 -0.111022E-15 2: Linear function, rank 1. Number of equations M = 10 Number of variables N = 5 Starting point X: 1.00000 1.00000 1.00000 1.00000 1.00000 F(X): 14.0000 29.0000 44.0000 59.0000 74.0000 89.0000 104.000 119.000 134.000 149.000 The least squares gradient: 1 11440.0 2 22880.0 3 34320.0 4 45760.0 5 57200.0 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: -167.797 -83.3984 221.110 -41.1992 -32.7594 F(X): -0.857143 -0.714286 -0.571429 -0.428571 -0.285714 -0.142857 -0.284217E-13 0.142857 0.285714 0.428571 The least squares gradient: 1 -0.312639E-11 2 -0.625278E-11 3 -0.937916E-11 4 -0.125056E-10 5 -0.156319E-10 Solution X: 0.952381E-02 0.952381E-02 0.952381E-02 0.952381E-02 0.952381E-02 F(X): -0.857143 -0.714286 -0.571429 -0.428571 -0.285714 -0.142857 0.222045E-15 0.142857 0.285714 0.428571 The least squares gradient: 1 0.155431E-13 2 0.310862E-13 3 0.461853E-13 4 0.621725E-13 5 0.746070E-13 3: Linear function, rank 1, zero columns and rows. Number of equations M = 10 Number of variables N = 5 Starting point X: 1.00000 1.00000 1.00000 1.00000 1.00000 F(X): -1.00000 8.00000 17.0000 26.0000 35.0000 44.0000 53.0000 62.0000 71.0000 -1.00000 The least squares gradient: 1 0.00000 2 7200.00 3 10800.0 4 14400.0 5 0.00000 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 1.00000 -210.362 32.1204 81.1346 1.00000 F(X): -1.00000 -0.823529 -0.647059 -0.470588 -0.294118 -0.117647 0.588235E-01 0.235294 0.411765 -1.00000 The least squares gradient: 1 0.00000 2 -0.130967E-09 3 -0.196451E-09 4 -0.261934E-09 5 0.00000 Solution X: 0.196078E-01 0.196078E-01 0.196078E-01 0.196078E-01 0.196078E-01 F(X): -1.00000 -0.823529 -0.647059 -0.470588 -0.294118 -0.117647 0.588235E-01 0.235294 0.411765 -1.00000 The least squares gradient: 1 0.00000 2 -0.159872E-13 3 -0.266454E-13 4 -0.319744E-13 5 0.00000 4: Rosenbrock function. Number of equations M = 2 Number of variables N = 2 Starting point X: -1.20000 1.00000 F(X): -4.40000 2.20000 The least squares gradient: 1 -215.600 2 -88.0000 LMDER1 return flag INFO = 4 FVEC is orthogonal to the columns of the jacobian. Final point X: 1.00000 1.00000 F(X): 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 Jacobian matrix: Col 1 2 Row 1 -20.0000 10.0000 2 -1.00000 0.00000 Solution X: 1.00000 1.00000 F(X): 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 Jacobian matrix: Col 1 2 Row 1 -20.0000 10.0000 2 -1.00000 0.00000 5: Helical valley function. Number of equations M = 3 Number of variables N = 3 Starting point X: -1.00000 0.00000 0.00000 F(X): -50.0000 0.00000 0.00000 The least squares gradient: 1 0.00000 2 -1591.55 3 -1000.00 LMDER1 return flag INFO = 2 Relative error in X is at most TOL. Final point X: 1.00000 -0.624330E-17 0.00000 F(X): 0.993652E-16 0.00000 0.00000 The least squares gradient: 1 -0.197469E-31 2 -0.316289E-14 3 0.198730E-14 Jacobian matrix: Col 1 2 3 Row 1 -0.993652E-16 -15.9155 10.0000 2 10.0000 -0.624330E-16 0.00000 3 0.00000 0.00000 1.00000 Solution X: 1.00000 0.00000 0.00000 F(X): 0.00000 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 3 0.00000 Jacobian matrix: Col 1 2 3 Row 1 0.00000 -15.9155 10.0000 2 10.0000 0.00000 0.00000 3 0.00000 0.00000 1.00000 6: Powell singular function. Number of equations M = 4 Number of variables N = 4 Starting point X: 3.00000 -1.00000 0.00000 1.00000 F(X): -7.00000 -2.23607 1.00000 12.6491 The least squares gradient: 1 306.000 2 -144.000 3 -2.00000 4 -310.000 LMDER1 return flag INFO = 4 FVEC is orthogonal to the columns of the jacobian. Final point X: 0.165212E-16 -0.165212E-17 0.264339E-17 0.264339E-17 F(X): 0.00000 0.00000 0.481482E-34 0.609033E-33 The least squares gradient: 1 0.106911E-48 2 -0.133638E-50 3 0.267276E-50 4 -0.106911E-48 Jacobian matrix: Col 1 2 3 4 Row 1 1.00000 10.0000 0.00000 0.00000 2 0.00000 0.00000 2.23607 -2.23607 3 0.00000 -0.138778E-16 0.277556E-16 0.00000 4 0.877708E-16 0.00000 0.00000 -0.877708E-16 Solution X: 0.00000 0.00000 0.00000 0.00000 F(X): 0.00000 0.00000 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 3 0.00000 4 0.00000 Jacobian matrix: Col 1 2 3 4 Row 1 1.00000 10.0000 0.00000 0.00000 2 0.00000 0.00000 2.23607 -2.23607 3 0.00000 0.00000 -0.00000 0.00000 4 0.00000 0.00000 0.00000 -0.00000 7: Freudenstein-Roth function. Number of equations M = 2 Number of variables N = 2 Starting point X: 0.500000 -2.00000 F(X): 19.5000 -4.50000 The least squares gradient: 1 30.0000 2 -1272.00 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 11.4176 -0.896445 F(X): 4.94894 -4.94897 The least squares gradient: 1 -0.617077E-04 2 0.677628E-01 Jacobian matrix: Col 1 2 Row 1 1.00000 -13.3753 2 1.00000 -13.3820 Solution X: 5.00000 4.00000 F(X): 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 Jacobian matrix: Col 1 2 Row 1 1.00000 -10.0000 2 1.00000 42.0000 8: Bard function. Number of equations M = 15 Number of variables N = 3 Starting point X: 1.00000 1.00000 1.00000 ||F(X)|| = 6.45614 The least squares gradient: 1 43.7657 2 -51.8712 3 -50.5600 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 0.824106E-01 1.13304 2.34369 ||F(X)|| = 0.906360E-01 The least squares gradient: 1 0.466024E-09 2 0.543720E-08 3 -0.266202E-08 9: Kowalik and Osborne function. Number of equations M = 11 Number of variables N = 4 Starting point X: 0.250000 0.390000 0.415000 0.390000 ||F(X)|| = 0.728915E-01 The least squares gradient: 1 0.133576 2 -0.747535E-03 3 -0.900556E-02 4 0.111355E-01 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 0.192784 0.191791 0.123152 0.136298 ||F(X)|| = 0.175359E-01 The least squares gradient: 1 -0.536505E-06 2 -0.171483E-06 3 0.145652E-06 4 0.441036E-05 10: Meyer function. Number of equations M = 16 Number of variables N = 3 Starting point X: 0.200000E-01 4000.00 250.000 ||F(X)|| = 41153.5 The least squares gradient: 1 -0.872767E+11 2 -0.561936E+07 3 0.724791E+08 LMDER1 return flag INFO = 2 Relative error in X is at most TOL. Final point X: 0.560964E-02 6181.35 345.224 ||F(X)|| = 9.37795 The least squares gradient: 1 8.26181 2 0.114157E-03 3 -0.174047E-02 11: Watson function. Number of equations M = 31 Number of variables N = 6 Starting point X: 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 ||F(X)|| = 5.47723 The least squares gradient: 1 0.00000 2 -60.0000 3 -60.0000 4 -61.0345 5 -62.0690 6 -63.1149 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: -0.157173E-01 1.01244 -0.232998 1.26049 -1.51381 0.993048 ||F(X)|| = 0.478296E-01 The least squares gradient: 1 0.787632E-05 2 0.513059E-05 3 0.439075E-05 4 0.427558E-05 5 0.448131E-05 6 0.494219E-05 12: Box 3-dimensional function. Number of equations M = 10 Number of variables N = 3 Starting point X: 0.00000 10.0000 20.0000 F(X): -10.1070 -12.8032 -12.8704 -12.0584 -11.0026 -9.92914 -8.91438 -7.98021 -7.12905 -6.35673 The least squares gradient: 1 98.2234 2 -2.11937 3 112.388 LMDER1 return flag INFO = 2 Relative error in X is at most TOL. Final point X: 1.00000 10.0000 1.00000 F(X): 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 3 0.00000 Solution X: 1.00000 10.0000 1.00000 F(X): 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 3 0.00000 13: Jennrich-Sampson function. Number of equations M = 10 Number of variables N = 2 Starting point X: 0.300000 0.400000 F(X): 1.15832 1.95234 2.22028 1.72685 0.129255 -3.07282 -8.61082 -17.5557 -31.4780 -52.6837 The least squares gradient: 1 33796.6 2 87402.1 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 0.257694 0.257939 F(X): 1.41180 2.65060 3.66554 4.39077 4.74109 4.60624 3.84352 2.26828 -0.358446 -4.34589 The least squares gradient: 1 -1.72876 2 -0.631821 Solution X: 0.257800 0.257800 F(X): 1.41184 2.65071 3.66576 4.39114 4.74169 4.60716 3.84492 2.27035 -0.355419 -4.34154 The least squares gradient: 1 -3.42250 2 -3.42250 14: Brown and Dennis function. Number of equations M = 20 Number of variables N = 4 Starting point X: 25.0000 5.00000 -5.00000 -1.00000 ||F(X)|| = 2815.44 The least squares gradient: 1 0.114932E+07 2 0.177929E+07 3 -254580. 4 -173400. LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: -11.5344 13.1821 -0.407063 0.234984 ||F(X)|| = 292.962 The least squares gradient: 1 108.227 2 -136.875 3 -2.11204 4 -1.00586 15: Chebyquad function. Number of equations M = 10 Number of variables N = 5 Starting point X: 0.166667 0.333333 0.500000 0.666667 0.833333 F(X): 0.00000 -0.222222 0.222045E-16 -0.395062E-01 0.222045E-16 0.140231 -0.888178E-16 0.212093 0.177636E-15 -0.143702E-01 The least squares gradient: 1 0.636202 2 0.287417E-01 3 0.181188E-14 4 -0.287417E-01 5 -0.636202 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 0.152002 0.317529 0.500000 0.682471 0.847998 F(X): 0.710543E-15 -0.172592 -0.111022E-15 -0.101980 -0.126565E-14 0.114528 -0.510703E-15 0.217440 0.954792E-15 0.794445E-01 The least squares gradient: 1 0.282148E-02 2 -0.550666E-03 3 0.502316E-14 4 0.550666E-03 5 -0.282148E-02 16: Brown almost-linear function. Number of equations M = 10 Number of variables N = 10 Starting point X: 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 0.500000 F(X): -5.50000 -5.50000 -5.50000 -5.50000 -5.50000 -5.50000 -5.50000 -5.50000 -5.50000 -0.999023 The least squares gradient: 1 -110.004 2 -110.004 3 -110.004 4 -110.004 5 -110.004 6 -110.004 7 -110.004 8 -110.004 9 -110.004 10 -99.0039 LMDER1 return flag INFO = 2 Relative error in X is at most TOL. Final point X: 0.979430 0.979430 0.979430 0.979430 0.979430 0.979430 0.979430 0.979430 0.979430 1.20570 F(X): 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.222045E-15 The least squares gradient: 1 0.453416E-15 2 0.453416E-15 3 0.453416E-15 4 0.453416E-15 5 0.453416E-15 6 0.453416E-15 7 0.453416E-15 8 0.453416E-15 9 0.453416E-15 10 0.368326E-15 Solution X: 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 F(X): 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 The least squares gradient: 1 0.00000 2 0.00000 3 0.00000 4 0.00000 5 0.00000 6 0.00000 7 0.00000 8 0.00000 9 0.00000 10 0.00000 17: Osborne function 1. Number of equations M = 33 Number of variables N = 5 Starting point X: 0.500000 1.50000 -1.00000 0.100000E-01 0.200000E-01 ||F(X)|| = 0.937564 The least squares gradient: 1 10.7100 2 3.06465 3 1.58106 4 -411.656 5 76.2617 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 0.375410 1.93585 -1.46469 0.128675E-01 0.221227E-01 ||F(X)|| = 0.739249E-02 The least squares gradient: 1 -0.577043E-09 2 -0.197866E-09 3 -0.116241E-09 4 0.387968E-07 5 0.533221E-08 18: Osborne function 2. Number of equations M = 65 Number of variables N = 11 ||X|| = 11.8695 ||F(X)|| = 1.44687 LMDER1 return flag INFO = 3 Relative error in X and sum of squares at most TOL. ||X|| = 9.38197 ||F(X)|| = 0.200344 19: Hanson function 1. Number of equations M = 16 Number of variables N = 2 Starting point X: 10.0000 0.150000 ||F(X)|| = 18.6281 The least squares gradient: 1 37.8101 2 6910.70 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 8.84418 0.123230 ||F(X)|| = 14.4465 The least squares gradient: 1 -0.645508E-04 2 12.8792 20: Hanson function 2. Number of equations M = 16 Number of variables N = 3 Starting point X: 25.0000 -0.100000 0.100000 ||F(X)|| = 10.4261 The least squares gradient: 1 -6.97244 2 -2755.11 3 33.7201 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: 26.0615 -0.648426E-01 0.821210E-01 ||F(X)|| = 6.29796 The least squares gradient: 1 -0.851711E-04 2 1.88651 3 -0.632383 21: McKeown problem 1. Number of equations M = 3 Number of variables N = 2 Starting point X: 0.100000 0.100000 F(X): 0.282911 -0.283048 0.440279 The least squares gradient: 1 2.45373 2 1.68195 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: -0.520589E-04 0.148638E-03 F(X): 0.133028 -0.244219 0.325978 The least squares gradient: 1 -0.628227E-05 2 0.796132E-03 Jacobian matrix: Col 1 2 Row 1 -0.563962 0.392847 2 -0.405139 0.927355 3 -0.733888E-01 0.535668 22: McKeown problem 2. Number of equations M = 4 Number of variables N = 3 Starting point X: 0.100000 0.100000 0.100000 F(X): 0.196929 -0.132318 -0.618364 -0.707935 The least squares gradient: 1 1.19405 2 2.36012 3 -0.588496 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: -0.991041E-04 -0.443693E-03 -0.205718E-03 F(X): 0.142687 -0.185089 -0.521512 -0.685540 The least squares gradient: 1 -0.346942E-02 2 -0.841346E-02 3 0.202895E-02 Jacobian matrix: Col 1 2 3 Row 1 -0.567817 0.385687 -0.402521 2 0.930338 -0.683143E-01 0.533596 3 0.659773 -0.634826 -0.681763 4 -0.868745 0.587789 0.289314 23: McKeown problem 3. Number of equations M = 10 Number of variables N = 5 Starting point X: 0.100000 0.100000 0.100000 0.100000 0.100000 F(X): 0.800182E-01 -0.523763E-01 0.439467 0.312750 0.219782 0.549064 0.433182 -0.525394 0.123042E-01 -0.468774 The least squares gradient: 1 0.814317 2 1.24632 3 1.17554 4 1.71537 5 1.88564 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: -0.212994E-03 -0.207199E-04 0.996546E-04 0.713822E-04 -0.170013E-03 F(X): 0.427654E-01 0.351135E-01 0.876550E-01 0.329071E-01 0.579122E-01 0.649725 0.344054 -0.627477 0.177718E-02 -0.224882 The least squares gradient: 1 -0.143676E-02 2 -0.229061E-03 3 0.169444E-03 4 0.843976E-04 5 -0.649658E-03 24: Devilliers-Glasser function 1. Number of equations M = 24 Number of variables N = 4 Starting point X: 1.00000 8.00000 4.00000 4.41200 ||F(X)|| = 352.527 The least squares gradient: 1 37927.6 2 8121.21 3 -96314.6 4 -50678.6 LMDER1 return flag INFO = 2 Relative error in X is at most TOL. Final point X: 60.1370 1.37100 3.11200 8.04419 ||F(X)|| = 0.240786E-12 The least squares gradient: 1 0.654278E-12 2 0.490595E-10 3 -0.415617E-10 4 -0.517393E-10 25: Devilliers-Glasser function 2. Number of equations M = 16 Number of variables N = 5 Starting point X: 45.0000 2.00000 2.50000 1.50000 0.900000 ||F(X)|| = 182.162 The least squares gradient: 1 1794.81 2 50693.3 3 -176.998 4 -335.015 5 48765.7 LMDER1 return flag INFO = 2 Relative error in X is at most TOL. Final point X: 53.8100 1.27000 3.01200 2.13000 0.507000 ||F(X)|| = 0.219184E-13 The least squares gradient: 1 -0.801855E-13 2 -0.368060E-11 3 -0.993376E-13 4 -0.845169E-13 5 -0.905245E-11 26: The Madsen example. Number of equations M = 3 Number of variables N = 2 Starting point X: 3.00000 1.00000 F(X): 13.0000 0.141120 0.540302 The least squares gradient: 1 181.721 2 129.091 LMDER1 return flag INFO = 1 Relative error in the sum of squares is at most TOL. Final point X: -0.156392 0.694507 F(X): 0.398183 -0.155755 0.768369 The least squares gradient: 1 -0.371727E-02 2 -0.190517E-02 Jacobian matrix: Col 1 2 Row 1 0.381723 1.23262 2 0.987796 0.00000 3 0.00000 -0.640007 Solution X: -0.155489 0.694560 F(X): 0.398594 -0.154863 0.768335 The least squares gradient: 1 -0.202918E-03 2 -0.106411E-03 Jacobian matrix: Col 1 2 Row 1 0.383582 1.23363 2 0.987936 0.00000 3 0.00000 -0.640047 test_nls_test(): Normal end of execution. 9 May 2025 9:46:51.018 PM