Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 17, 2023
1 parent 3724fbc commit 91c0ca0
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
3 changes: 1 addition & 2 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/code_optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ prob = NonlinearProblem(f!, u0, p)
linsolve = LinearSolve.KrylovJL_GMRES()
sol = solve(prob, NewtonRaphson(; linsolve), reltol = 1e-9)
```
```
40 changes: 20 additions & 20 deletions docs/src/tutorials/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
And also check out the rest of the manual.
2 changes: 1 addition & 1 deletion docs/src/tutorials/iterator_interface.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/small_compile.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Faster Startup and and Static Compilation

This is a stub article to be completed soon.
This is a stub article to be completed soon.
2 changes: 1 addition & 1 deletion docs/src/tutorials/termination_conditions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# [More Detailed Termination Conditions](@id termination_conditions_tutorial)

This is a stub article to be completed soon.
This is a stub article to be completed soon.
3 changes: 2 additions & 1 deletion test/basictests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 91c0ca0

Please sign in to comment.