-
-
Notifications
You must be signed in to change notification settings - Fork 48
Not finding a zero for a fairly simple problem #187
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I can't reproduce this (with NonlinearSolve v1.8.0) and I think there are two problems here + a style point with use of broadcasting.
From a fresh REPL, you should get an error explaining this, which starts:
Plausibly what has happened here is that you have previously defined a method for
With a modified example, I get:
where the relevant parts of the output are:
|
Indeed, NonlinearSolve.jl never supported using NonlinearSolve
f(u, p) = 0.5/1.5*log.(u./(1.0.-u)) .- 2.0*u .+1.0
uspan = (0.02, 0.1) # brackets
prob = IntervalNonlinearProblem(f, uspan)
sol = solve(prob) # 0.07072018167994477
@show sol.resid # 0.0
u0 = 0.06
p = 2.0
prob = NonlinearProblem(f, u0, p)
solver = solve(prob)
@show solver.u # 0.07072018167994477
@show sol.resid # 0.0 so closing. |
This doesn't find the zero at u = 0.070720181679945, using either a bounded or unbounded method. Is this a problem with the setup or is it more fundamental?
And the output is:
Here's MATLAB code that gives the correct answer using both a bounded and unbounded method:
The text was updated successfully, but these errors were encountered: