@@ -43,6 +43,7 @@ println("... Test NonlinearEquations.jl")
4343 nonlinearity = mild
4444 restricted = false
4545 quasi = true
46+ forwardjac = false
4647
4748 if loglevel >= info
4849 println (" Linear problem:" )
@@ -55,7 +56,7 @@ println("... Test NonlinearEquations.jl")
5556 println (" * scale vector = $fscale " )
5657 end
5758
58- converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
59+ converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
5960
6061 if loglevel == debug
6162 println (" * solution = $x " )
@@ -68,7 +69,7 @@ println("... Test NonlinearEquations.jl")
6869 end
6970
7071
71- # Determined test from https://www.zib.de/codelib/NewtonLib/nleq_err.tar
72+ # Determined test from https://www.zib.de/codelib/NewtonLib/
7273 @testset " ... Test Chebyquad problem of dimensions 2..7" begin
7374
7475 # Test function
@@ -108,11 +109,12 @@ println("... Test NonlinearEquations.jl")
108109 nonlinearity = high
109110 restricted = false
110111 quasi = true
112+ forwardjac = false
111113
112114 for n = 2 : nn
113115
114116 if n == 6
115- continue # NLEQ_ERR does not converge for n = 6, 8, 9
117+ continue
116118 end
117119
118120 if loglevel >= info
@@ -130,7 +132,7 @@ println("... Test NonlinearEquations.jl")
130132 println (" * scale vector = $fscale " )
131133 end
132134
133- converged = solveNonlinearEquations! (fx!, n, x, fscale; nonlinearity= high, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
135+ converged = solveNonlinearEquations! (fx!, n, x, fscale; nonlinearity= high, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
134136
135137 if loglevel == debug
136138 println (" * solution = $x " )
@@ -179,6 +181,7 @@ println("... Test NonlinearEquations.jl")
179181 nonlinearity = high
180182 restricted = false
181183 quasi = true
184+ forwardjac = false
182185
183186 for ii in 1 : 2
184187 if loglevel >= info
@@ -196,7 +199,7 @@ println("... Test NonlinearEquations.jl")
196199 println (" * scale vector = $fscale " )
197200 end
198201
199- converged = solveNonlinearEquations! (f_2by2!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
202+ converged = solveNonlinearEquations! (f_2by2!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
200203
201204 if loglevel == debug
202205 println (" * solution = $x " )
@@ -233,6 +236,7 @@ println("... Test NonlinearEquations.jl")
233236 nonlinearity = high
234237 restricted = false
235238 quasi = true
239+ forwardjac = false
236240
237241 if loglevel >= info
238242 println (" MINPACK Powell singular problem:" )
@@ -244,7 +248,7 @@ println("... Test NonlinearEquations.jl")
244248 println (" * scale vector = $fscale " )
245249 end
246250
247- converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
251+ converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
248252
249253 if loglevel == debug
250254 println (" * solution = $x " )
@@ -280,6 +284,7 @@ println("... Test NonlinearEquations.jl")
280284 nonlinearity = high
281285 restricted = false
282286 quasi = true
287+ forwardjac = false
283288
284289 if loglevel >= info
285290 println (" MINPACK Powell badly scaled problem:" )
@@ -291,7 +296,7 @@ println("... Test NonlinearEquations.jl")
291296 println (" * scale vector = $fscale " )
292297 end
293298
294- converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
299+ converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
295300
296301 if loglevel == debug
297302 println (" * solution = $x " )
@@ -333,6 +338,7 @@ println("... Test NonlinearEquations.jl")
333338 nonlinearity = high
334339 restricted = false
335340 quasi = true
341+ forwardjac = true
336342
337343 if loglevel >= info
338344 println (" MINPACK Wood problem:" )
@@ -344,7 +350,7 @@ println("... Test NonlinearEquations.jl")
344350 println (" * scale vector = $fscale " )
345351 end
346352
347- converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
353+ converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
348354
349355 if loglevel == debug
350356 println (" * solution = $x " )
@@ -390,6 +396,7 @@ println("... Test NonlinearEquations.jl")
390396 nonlinearity = high
391397 restricted = false
392398 quasi = true
399+ forwardjac = false
393400
394401 if loglevel >= info
395402 println (" MINPACK helical valey problem:" )
@@ -401,7 +408,7 @@ println("... Test NonlinearEquations.jl")
401408 println (" * scale vector = $fscale " )
402409 end
403410
404- converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
411+ converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
405412
406413 if loglevel == debug
407414 println (" * solution = $x " )
@@ -423,6 +430,7 @@ println("... Test NonlinearEquations.jl")
423430 nonlinearity = high
424431 restricted = false
425432 quasi = true
433+ forwardjac = true
426434
427435 for n in (6 , 9 )
428436
@@ -471,7 +479,7 @@ println("... Test NonlinearEquations.jl")
471479 println (" * scale vector = $fscale " )
472480 end
473481
474- converged = solveNonlinearEquations! (fx!, n, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
482+ converged = solveNonlinearEquations! (fx!, n, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
475483
476484 if loglevel == debug
477485 println (" * solution = $x " )
@@ -517,6 +525,7 @@ println("... Test NonlinearEquations.jl")
517525 nonlinearity = extreme
518526 restricted = true
519527 quasi = false
528+ forwardjac = true
520529
521530 if loglevel >= info
522531 println("MINPACK trigonometric problem:")
@@ -528,7 +537,7 @@ println("... Test NonlinearEquations.jl")
528537 println("* scale vector = $fscale")
529538 end
530539
531- converged = solveNonlinearEquations!(fx!, m, x, fscale; nonlinearity=nonlinearity, restricted=restricted, xtol=tol, maxiter=maxiter, quasi=quasi, loglevel=loglevel)
540+ converged = solveNonlinearEquations!(fx!, m, x, fscale; nonlinearity=nonlinearity, restricted=restricted, xtol=tol, maxiter=maxiter, quasi=quasi, forwardjac=forwardjac, loglevel=loglevel)
532541
533542 if loglevel == debug
534543 println("* solution = $x")
@@ -561,6 +570,7 @@ println("... Test NonlinearEquations.jl")
561570 nonlinearity = high
562571 restricted = false
563572 quasi = true
573+ forwardjac = false
564574
565575 if loglevel >= info
566576 println (" Determined Rosenbrock problem:" )
@@ -572,7 +582,7 @@ println("... Test NonlinearEquations.jl")
572582 println (" * scale vector = $fscale " )
573583 end
574584
575- converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
585+ converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
576586
577587 if loglevel == debug
578588 println (" * solution = $x " )
@@ -609,6 +619,7 @@ println("... Test NonlinearEquations.jl")
609619 nonlinearity = high
610620 restricted = false
611621 quasi = false
622+ forwardjac = true
612623
613624 if loglevel >= info
614625 println (" Underdeterminded Rosenbrock problem:" )
@@ -620,7 +631,7 @@ println("... Test NonlinearEquations.jl")
620631 println (" * scale vector = $fscale " )
621632 end
622633
623- converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
634+ converged = solveNonlinearEquations! (fx!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
624635
625636 if loglevel == debug
626637 println (" * solution = $x " )
@@ -663,6 +674,7 @@ println("... Test NonlinearEquations.jl")
663674 nonlinearity = mild
664675 restricted = false
665676 quasi = true
677+ forwardjac = false
666678
667679 if loglevel >= info
668680 println (" Slider-crank initial state problem 1:" )
@@ -679,7 +691,7 @@ println("... Test NonlinearEquations.jl")
679691 println (" * scale vector = $fscale \n " )
680692 end
681693
682- converged = solveNonlinearEquations! (res_z!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
694+ converged = solveNonlinearEquations! (res_z!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
683695
684696 if loglevel == debug
685697 println (" * solution = $x " )
@@ -697,7 +709,7 @@ println("... Test NonlinearEquations.jl")
697709
698710
699711 # Underdetermined slider-crank initial state problem 2
700- @testset " ... Test slider-crank initial state problem 1 " begin
712+ @testset " ... Test slider-crank initial state problem 2 " begin
701713
702714 # kinematic parameters
703715 wheelRadius = 0.1
@@ -726,6 +738,7 @@ println("... Test NonlinearEquations.jl")
726738 nonlinearity = high
727739 restricted = false
728740 quasi = true
741+ forwardjac = false
729742
730743 if loglevel >= info
731744 println (" Slider-crank initial state problem 2:" )
@@ -743,7 +756,7 @@ println("... Test NonlinearEquations.jl")
743756 println (" * scale vector = $fscale \n " )
744757 end
745758
746- converged = solveNonlinearEquations! (res!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, loglevel= loglevel)
759+ converged = solveNonlinearEquations! (res!, m, x, fscale; nonlinearity= nonlinearity, restricted= restricted, xtol= tol, maxiter= maxiter, quasi= quasi, forwardjac = forwardjac, loglevel= loglevel)
747760
748761 if loglevel == debug
749762 println (" * solution = $x " )
0 commit comments