Skip to content

Commit c8cb9fe

Browse files
committed
chore: update nonlinear battery problem
1 parent 607e73d commit c8cb9fe

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

benchmarks/NonlinearProblem/Manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.10.6"
44
manifest_format = "2.0"
5-
project_hash = "96dc1933fc75da024f19d8269dca08bf12d5e1c7"
5+
project_hash = "8814c1199875b7c1b1e3a38f566386a806b41b9d"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "eea5d80188827b35333801ef97a40c2ed653b081"

benchmarks/NonlinearProblem/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
88
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
99
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
1010
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
11+
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
1112
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
1213
MINPACK = "4854310b-de5a-5eb6-a2a5-c1dee2bd17f9"
1314
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"

benchmarks/NonlinearProblem/nonlinear_battery_problem.jmd

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,38 @@ Fetch required packages.
2323
using NonlinearSolve, LinearSolve, StaticArrays, Sundials, SpeedMapping,
2424
BenchmarkTools, LinearAlgebra, DiffEqDevTools, PolyesterForwardDiff, CairoMakie
2525
import MINPACK, NLsolve
26-
RUS = RadiusUpdateSchemes;
26+
import LineSearches
27+
28+
const RUS = RadiusUpdateSchemes;
2729
```
2830

2931
Declare the benchmarked solvers (and their names and plotting options).
3032

3133
```julia
3234
DEFAULT_FORWARD_AD = AutoForwardDiff(; chunksize = 12)
3335

36+
HagerZhang() = LineSearchesJL(; method = LineSearches.HagerZhang())
37+
MoreThuente() = LineSearchesJL(; method = LineSearches.MoreThuente())
38+
39+
# XXX: Add PETSc
3440
solvers_all = [
3541
(; pkg = :nonlinearsolve, name = "Default PolyAlgorithm", solver = Dict(:alg => FastShortcutNonlinearPolyalg(; autodiff = DEFAULT_FORWARD_AD))),
36-
(; pkg = :nonlinearsolve, name = "Newton Raphson", solver = Dict(:alg => NewtonRaphson(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD))),
37-
(; pkg = :nonlinearsolve, name = "Newton Raphson (HagerZhang LineSearch)", solver = Dict(:alg => NewtonRaphson(; linsolve = nothing, linesearch = HagerZhang()))),
38-
(; pkg = :nonlinearsolve, name = "Newton Raphson (MoreThuente LineSearch)", solver = Dict(:alg => NewtonRaphson(; linsolve = nothing, linesearch = MoreThuente()))),
39-
(; pkg = :nonlinearsolve, name = "Newton Raphson (BackTracking LineSearch)", solver = Dict(:alg => NewtonRaphson(; linsolve = nothing, linesearch = BackTracking()))),
42+
(; pkg = :nonlinearsolve, name = "Newton Raphson", solver = Dict(:alg => NewtonRaphson(; autodiff = DEFAULT_FORWARD_AD))),
43+
(; pkg = :nonlinearsolve, name = "Newton Raphson (HagerZhang LineSearch)", solver = Dict(:alg => NewtonRaphson(; linesearch = HagerZhang()))),
44+
(; pkg = :nonlinearsolve, name = "Newton Raphson (MoreThuente LineSearch)", solver = Dict(:alg => NewtonRaphson(; linesearch = MoreThuente()))),
45+
(; pkg = :nonlinearsolve, name = "Newton Raphson (BackTracking LineSearch)", solver = Dict(:alg => NewtonRaphson(; linesearch = BackTracking()))),
4046
(; pkg = :nonlinearsolve, name = "Newton Krylov with GMRES", solver = Dict(:alg => NewtonRaphson(; linsolve = KrylovJL_GMRES()))),
4147
(; pkg = :nonlinearsolve, name = "DFSane", solver = Dict(:alg => DFSane())),
4248
(; pkg = :nonlinearsolve, name = "Trust Region", solver = Dict(:alg => TrustRegion())),
43-
(; pkg = :nonlinearsolve, name = "Trust Region (NLsolve Update)", solver = Dict(:alg => TrustRegion(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.NLsolve))),
44-
(; pkg = :nonlinearsolve, name = "Trust Region (Nocedal Wright)", solver = Dict(:alg => TrustRegion(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.NocedalWright))),
45-
(; pkg = :nonlinearsolve, name = "Trust Region (Hei)", solver = Dict(:alg => TrustRegion(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Hei))),
46-
(; pkg = :nonlinearsolve, name = "Trust Region (Yuan)", solver = Dict(:alg => TrustRegion(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Yuan))),
47-
(; pkg = :nonlinearsolve, name = "Trust Region (Bastin)", solver = Dict(:alg => TrustRegion(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Bastin))),
48-
(; pkg = :nonlinearsolve, name = "Trust Region (Fan)", solver = Dict(:alg => TrustRegion(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Fan))),
49-
(; pkg = :nonlinearsolve, name = "Levenberg-Marquardt", solver = Dict(:alg => LevenbergMarquardt(; linsolve = nothing, autodiff = DEFAULT_FORWARD_AD))),
49+
(; pkg = :nonlinearsolve, name = "Trust Region (NLsolve Update)", solver = Dict(:alg => TrustRegion(; autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.NLsolve))),
50+
(; pkg = :nonlinearsolve, name = "Trust Region (Nocedal Wright)", solver = Dict(:alg => TrustRegion(; autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.NocedalWright))),
51+
(; pkg = :nonlinearsolve, name = "Trust Region (Hei)", solver = Dict(:alg => TrustRegion(; autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Hei))),
52+
(; pkg = :nonlinearsolve, name = "Trust Region (Yuan)", solver = Dict(:alg => TrustRegion(; autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Yuan))),
53+
(; pkg = :nonlinearsolve, name = "Trust Region (Bastin)", solver = Dict(:alg => TrustRegion(; autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Bastin))),
54+
(; pkg = :nonlinearsolve, name = "Trust Region (Fan)", solver = Dict(:alg => TrustRegion(; autodiff = DEFAULT_FORWARD_AD, radius_update_scheme = RUS.Fan))),
55+
(; pkg = :nonlinearsolve, name = "Levenberg-Marquardt", solver = Dict(:alg => LevenbergMarquardt(; autodiff = DEFAULT_FORWARD_AD))),
5056
(; pkg = :nonlinearsolve, name = "Levenberg-Marquardt with Cholesky", solver = Dict(:alg => LevenbergMarquardt(; autodiff = DEFAULT_FORWARD_AD, linsolve = CholeskyFactorization()))),
51-
(; pkg = :nonlinearsolve, name = "Levenberg-Marquardt (No Geodesic Accln.)", solver = Dict(:alg => LevenbergMarquardt(; linsolve = nothing, disable_geodesic = Val(true), autodiff = DEFAULT_FORWARD_AD))),
57+
(; pkg = :nonlinearsolve, name = "Levenberg-Marquardt (No Geodesic Accln.)", solver = Dict(:alg => LevenbergMarquardt(; disable_geodesic = Val(true), autodiff = DEFAULT_FORWARD_AD))),
5258
(; pkg = :nonlinearsolve, name = "Levenberg-Marquardt (No Geodesic Accln.) with Cholesky", solver = Dict(:alg => LevenbergMarquardt(; disable_geodesic = Val(true), autodiff = DEFAULT_FORWARD_AD, linsolve = CholeskyFactorization()))),
5359
(; pkg = :wrapper, name = "Modified Powell [MINPACK]", solver = Dict(:alg => CMINPACK(; method = :hybr))),
5460
(; pkg = :wrapper, name = "Levenberg-Marquardt [MINPACK]", solver = Dict(:alg => CMINPACK(; method = :lm))),

0 commit comments

Comments
 (0)