Skip to content

Commit fcdfea1

Browse files
committed
NonlinearSolve working
1 parent ee1658c commit fcdfea1

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

docs/src/tutorial-goddard.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ println("\nNorm of the shooting function: ‖s‖ = ", norm(s), "\n")
360360
# NonlinearSolve resolution
361361
nle_new!(s, ξ, p) = shoot!(s, ξ[1:3], ξ[4], ξ[5], ξ[6], ξ[7])
362362
prob_nls = NonlinearProblem(nle_new!, ξ)
363-
sol_nls = solve(prob_nls, NewtonRaphson(); show_trace=Val(true))
363+
sol_nls = solve(prob_nls; show_trace=Val(true))
364364
365365
ξ_nls = sol_nls.u
366366
p0_nls = ξ_nls[1:3]
@@ -373,18 +373,22 @@ s = similar(ξ_nls, 7)
373373
shoot!(s, p0_nls, t1, t2, t3, tf)
374374
375375
println("\nNonlinearSolve results :")
376-
@show ξ_nls
376+
println("p0 = ", p0_nls)
377+
println("t1 = ", t1)
378+
println("t2 = ", t2)
379+
println("t3 = ", t3)
380+
println("tf = ", tf)
377381
@show norm(s)
378382
```
379383

380384
Lets benchmark these two resolution to compare their performances.
381385

382386
```@example main-goddard
383-
@benchmark fsolve(nle!, jnle!, ξ, show_trace=false)
387+
@benchmark fsolve(nle!, jnle!, ξ, show_trace=false) #MINPACK
384388
```
385389

386390
```@example main-goddard
387-
@benchmark solve(prob_nls, NewtonRaphson(); show_trace=Val(false)) #NonlinearSolve
391+
@benchmark solve(prob_nls; show_trace=Val(false)) #NonlinearSolve
388392
```
389393

390394
## [Plot of the solution](@id tutorial-goddard-plot)

0 commit comments

Comments
 (0)