-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storing trace #58
Comments
Did you do |
In a fresh session:
|
https://github.com/SciML/SciMLNLSolve.jl It looks like that is documented? http://nonlinearsolve.sciml.ai/dev/solvers/NonlinearSystemSolvers/#SciMLNLSolve.jl |
It was - I was not carefull enough in reading the documentation. The full working example is now
I think that for other careless readers like me, a simple example of how to use other solvers would be instructive. |
Yup, we can add a tutorial |
using NonlinearSolve
v = 120 #kg
k = 2.5 #m
w = 4.0 #km/m
α = 2e-7 #kg⁻¹
function F(x⃗, parameters)
L₀, L, p, x, θ, φ, a, H = tuple(x⃗...)
return [
a * (cosh(x / a) - 1) - p,
2a * sinh(x / a) - L,
2x + 2k * cos(θ) - parameters.d,
p + k * sin(θ) - parameters.n,
sinh(x / a) - tan(φ),
(1 + v / (w * L₀)) * tan(φ) - tan(θ),
L₀ * (1 + α * H) - L,
w * L₀ / 2sin(φ) - H,
]
end
params = (d = 30, n = 5)
x₀ = [29, 27, 1, params.d / 2, deg2rad(45), deg2rad(22.5), 40, 500]
probN = NonlinearProblem{false}(F, x₀, params)
sol = solve(probN; abstol = 1e-9, show_trace = Val(true), trace_level = TraceAll(100),
store_trace = Val(true))
Algorithm: GeneralKlement(linsolve = LUFactorization())
---- ------------- ----------- -------
Iter f(u) inf-norm Step 2-norm cond(J)
---- ------------- ----------- -------
0 3.48438696e+02 0.00000000e+00 1.00000000e+00
Final 4.58673147e+00
----------------------
Algorithm: GeneralBroyden()
---- ------------- ----------- -------
Iter f(u) inf-norm Step 2-norm cond(J)
---- ------------- ----------- -------
0 3.48438696e+02 0.00000000e+00 1.00000000e+00
100 2.21817021e+02 3.67955669e+01 8.24919384e+03
Final 5.63586054e+00
----------------------
Algorithm: NewtonRaphson(ad = AutoForwardDiff())
---- ------------- ----------- -------
Iter f(u) inf-norm Step 2-norm cond(J)
---- ------------- ----------- -------
0 3.48438696e+02 0.00000000e+00 Inf
Final 3.55271368e-15
----------------------
u: 8-element Vector{Float64}:
27.52327682597094
27.523962383296873
3.2064613688401113
13.258386042046885
0.8000852068277563
0.4578205135984268
27.929656903088112
124.54137097709595
|
Add more tests to Alefeld and fix bugs
I want to store the trace during solving. I would love to use the native NonlinearSolve methods for that, but it appears to me that no such thing is implemented. So I want to use the NLSolveJL interface. But from reading the documentation, I am still not able to see - how do i use it?
So far I have tried the following
With
NLSolveJL
not being defined, I was wondering if it is simply not exported. But this seems not to be the case:I think that a section with working examples in the docs of how to access non-native solvers would go a long ways.
The text was updated successfully, but these errors were encountered: