Skip to content

Commit 6c70f18

Browse files
committed
NLS on Goddard finished with comparision
1 parent a05d3e1 commit 6c70f18

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

docs/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
1515
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1616
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1717
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
18-
Tutorials = "cb10daa6-a5e5-4c25-a171-ae181b8ea3c9"
1918

2019
[compat]
2120
BenchmarkTools = "1.6"

docs/src/tutorial-goddard.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,19 +370,20 @@ t2 = ξ_nls[5]
370370
t3 = ξ_nls[6]
371371
tf = ξ_nls[7]
372372
373-
s = similar(ξ_nls, 7)
374-
shoot!(s, p0_nls, t1, t2, t3, tf)
375-
376373
println("\nNonlinearSolve results :")
377374
println("p0 = ", p0_nls)
378375
println("t1 = ", t1)
379376
println("t2 = ", t2)
380377
println("t3 = ", t3)
381378
println("tf = ", tf)
382-
@show norm(s)
379+
380+
s = similar(p0_nls, 7)
381+
shoot!(s, p0_nls, t1, t2, t3, tf)
382+
383+
println("\nNorm of the shooting function: ‖s‖ = ", norm(s), "\n")
383384
```
384385

385-
Lets benchmark these two resolution to compare their performances.
386+
The results found for the different parameters are extremely close so now, lets benchmark these two resolution to compare their performances.
386387

387388
```@example main-goddard
388389
@benchmark fsolve(nle!, jnle!, ξ, show_trace=false) #MINPACK
@@ -392,6 +393,8 @@ Lets benchmark these two resolution to compare their performances.
392393
@benchmark solve(prob_nls; show_trace=Val(false)) #NonlinearSolve
393394
```
394395

396+
The MINPACK (fsolve) method is much faster than NonlinearSolve (solve) on this problem. It also uses less memory (1.95 GiB vs 6.10 GiB). Both methods have a similar GC overhead (~24–25%), but MINPACK is overall more efficient here.
397+
395398
## [Plot of the solution](@id tutorial-goddard-plot)
396399

397400
We plot the solution of the indirect solution (in red) over the solution of the direct method

0 commit comments

Comments
 (0)