From 91c0ca09c7c78672b5fbca905f2ef5491c057305 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Tue, 17 Oct 2023 19:57:33 -0400 Subject: [PATCH] Rebase --- docs/pages.jl | 3 +- docs/src/tutorials/code_optimization.md | 2 +- docs/src/tutorials/getting_started.md | 40 ++++++++++---------- docs/src/tutorials/iterator_interface.md | 2 +- docs/src/tutorials/small_compile.md | 2 +- docs/src/tutorials/termination_conditions.md | 2 +- test/basictests.jl | 3 +- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/pages.jl b/docs/pages.jl index 35f924cdd..c29d2874b 100644 --- a/docs/pages.jl +++ b/docs/pages.jl @@ -2,8 +2,7 @@ pages = ["index.md", "tutorials/getting_started.md", - "Tutorials" => Any[ - "tutorials/code_optimization.md", + "Tutorials" => Any["tutorials/code_optimization.md", "tutorials/large_systems.md", "tutorials/small_compile.md", "tutorials/termination_conditions.md", diff --git a/docs/src/tutorials/code_optimization.md b/docs/src/tutorials/code_optimization.md index bb6fbdbd4..24d003206 100644 --- a/docs/src/tutorials/code_optimization.md +++ b/docs/src/tutorials/code_optimization.md @@ -55,4 +55,4 @@ prob = NonlinearProblem(f!, u0, p) linsolve = LinearSolve.KrylovJL_GMRES() sol = solve(prob, NewtonRaphson(; linsolve), reltol = 1e-9) -``` \ No newline at end of file +``` diff --git a/docs/src/tutorials/getting_started.md b/docs/src/tutorials/getting_started.md index edcbb6921..9f1685557 100644 --- a/docs/src/tutorials/getting_started.md +++ b/docs/src/tutorials/getting_started.md @@ -9,19 +9,19 @@ to understanding the deeper parts of the documentation. There are three types of nonlinear systems: -1. The "standard nonlinear system", i.e. the `NonlinearProblem`. This is a - system of equations with an initial condition where you want to satisfy - all equations simultaniously. -2. The "interval rootfinding problem", i.e. the `IntervalNonlinearProblem`. - This is the case where you're given an interval `[a,b]` and need to find - where `f(u) = 0` for `u` inside the bounds. -3. The "steady state problem", i.e. find the `u` such that `u' = f(u) = 0`. - While related to (1), it's not entirely the same because there's a uniquely - defined privledged root. -4. The nonlinear least squares problem, which is an overconstrained nonlinear - system (i.e. more equations than states) which might not be satisfiable, i.e. - there may be no `u` such that `f(u) = 0`, and thus we find the `u` which - minimizes `||f(u)||` in the least squares sense. + 1. The "standard nonlinear system", i.e. the `NonlinearProblem`. This is a + system of equations with an initial condition where you want to satisfy + all equations simultaniously. + 2. The "interval rootfinding problem", i.e. the `IntervalNonlinearProblem`. + This is the case where you're given an interval `[a,b]` and need to find + where `f(u) = 0` for `u` inside the bounds. + 3. The "steady state problem", i.e. find the `u` such that `u' = f(u) = 0`. + While related to (1), it's not entirely the same because there's a uniquely + defined privledged root. + 4. The nonlinear least squares problem, which is an overconstrained nonlinear + system (i.e. more equations than states) which might not be satisfiable, i.e. + there may be no `u` such that `f(u) = 0`, and thus we find the `u` which + minimizes `||f(u)||` in the least squares sense. For now let's focus on the first two. The other two are covered in later tutorials, but from the first two we can show the general flow of the NonlinearSolve.jl package. @@ -105,7 +105,7 @@ For a complete list of solver choices, see [the nonlinear system solvers page](@ Next we can modify the tolerances. Here let's set some really low tolerances to force a tight solution: ```@example 1 -solve(prob, TrustRegion(), reltol=1e-12, abstol=1e-12) +solve(prob, TrustRegion(), reltol = 1e-12, abstol = 1e-12) ``` There are many more options for doing this configuring. Specifically for handling termination conditions, @@ -139,10 +139,10 @@ sol = solve(prob_int, ITP(), abstol = 0.01) Congrats, you now know how to use the basics of NonlinearSolve.jl! However, there is so much more to see. Next check out: -- [Some code optimization tricks to know about with NonlinearSolve.jl](@ref code_optimization) -- [An iterator interface which lets you step through the solving process step by step](@ref iterator) -- [How to handle large systems of equations efficiently](@ref large_systems) -- [Ways to use NonlinearSolve.jl that is faster to startup and can statically compile](@ref fast_startup) -- [More detailed termination conditions](@ref termination_conditions_tutorial) + - [Some code optimization tricks to know about with NonlinearSolve.jl](@ref code_optimization) + - [An iterator interface which lets you step through the solving process step by step](@ref iterator) + - [How to handle large systems of equations efficiently](@ref large_systems) + - [Ways to use NonlinearSolve.jl that is faster to startup and can statically compile](@ref fast_startup) + - [More detailed termination conditions](@ref termination_conditions_tutorial) -And also check out the rest of the manual. \ No newline at end of file +And also check out the rest of the manual. diff --git a/docs/src/tutorials/iterator_interface.md b/docs/src/tutorials/iterator_interface.md index 640fb5f02..c0fb914f4 100644 --- a/docs/src/tutorials/iterator_interface.md +++ b/docs/src/tutorials/iterator_interface.md @@ -1,7 +1,7 @@ # [Nonlinear Solver Iterator Interface](@id iterator) !!! warn - + This iterator interface will be expanded with a `step!` function soon! There is an iterator form of the nonlinear solver which mirrors the DiffEq integrator interface: diff --git a/docs/src/tutorials/small_compile.md b/docs/src/tutorials/small_compile.md index e6aa07312..aab4531b8 100644 --- a/docs/src/tutorials/small_compile.md +++ b/docs/src/tutorials/small_compile.md @@ -1,3 +1,3 @@ # Faster Startup and and Static Compilation -This is a stub article to be completed soon. \ No newline at end of file +This is a stub article to be completed soon. diff --git a/docs/src/tutorials/termination_conditions.md b/docs/src/tutorials/termination_conditions.md index 152e0abc4..6a7e8a3cd 100644 --- a/docs/src/tutorials/termination_conditions.md +++ b/docs/src/tutorials/termination_conditions.md @@ -1,3 +1,3 @@ # [More Detailed Termination Conditions](@id termination_conditions_tutorial) -This is a stub article to be completed soon. \ No newline at end of file +This is a stub article to be completed soon. diff --git a/test/basictests.jl b/test/basictests.jl index efa148bb0..06cfc103d 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -225,7 +225,8 @@ end radius_update_scheme in radius_update_schemes probN = NonlinearProblem(quadratic_f, u0, 2.0) - @test all(solve(probN, TrustRegion(; autodiff, radius_update_scheme)).u .≈ sqrt(2.0)) + @test all(solve(probN, TrustRegion(; autodiff, radius_update_scheme)).u .≈ + sqrt(2.0)) end # Test that `TrustRegion` passes a test that `NewtonRaphson` fails on.