Skip to content

Commit a5b6423

Browse files
Update faq.md
1 parent 96766b0 commit a5b6423

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/src/basics/faq.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ be a Dual number. This causes the error. To fix it:
7676
1. Specify the `autodiff` to be `AutoFiniteDiff`
7777

7878
```@example dual_error_faq
79-
sol = solve(prob_oop, LevenbergMarquardt(; autodiff = AutoFiniteDiff());
79+
import ADTypes
80+
sol = solve(prob_oop, LevenbergMarquardt(; autodiff = ADTypes.AutoFiniteDiff());
8081
maxiters = 10000, abstol = 1e-8)
8182
```
8283
@@ -110,6 +111,7 @@ internally. See this simple example:
110111
```@example type_unstable
111112
import NonlinearSolve as NLS
112113
import InteractiveUtils
114+
import ADTypes
113115
114116
f(u, p) = @. u^2 - p
115117
@@ -134,7 +136,7 @@ nothing # hide
134136
Again Type-Stable! Now let's try using a regular array:
135137

136138
```@example type_unstable
137-
prob = NonlinearProblem(f, [1.0, 2.0], 2.0)
139+
prob = NLS.NonlinearProblem(f, [1.0, 2.0], 2.0)
138140
139141
InteractiveUtils.@code_warntype NLS.solve(prob, NLS.NewtonRaphson())
140142
nothing # hide
@@ -145,10 +147,10 @@ it will be dynamic and lead to dynamic dispatch. To fix this, we directly specif
145147
chunksize:
146148

147149
```@example type_unstable
148-
InteractiveUtils.@code_warntype solve(
150+
InteractiveUtils.@code_warntype NLS.solve(
149151
prob,
150-
NewtonRaphson(;
151-
autodiff = AutoForwardDiff(; chunksize = NonlinearSolve.pickchunksize(prob.u0))
152+
NLS.NewtonRaphson(;
153+
autodiff = ADTypes.AutoForwardDiff(; chunksize = NonlinearSolve.pickchunksize(prob.u0))
152154
)
153155
)
154156
nothing # hide

0 commit comments

Comments
 (0)