Skip to content

Commit

Permalink
Add test for 187
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Oct 17, 2023
1 parent 883b01e commit 0c69cde
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/polyalgs.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NonlinearSolve
using NonlinearSolve, Test

f(u, p) = u .* u .- 2
u0 = [1.0, 1.0]
Expand All @@ -19,4 +19,20 @@ function f(du, u, p)
end

prob = NonlinearProblem(f, [2.0,2.0,2.0], [1.0, 2.0, 2.5])
sol = solve(prob)
sol = solve(prob)
@test SciMLBase.successful_retcode(sol)

# https://github.com/SciML/NonlinearSolve.jl/issues/187

f(u, p) = 0.5/1.5*log.(u./(1.0.-u)) .- 2.0*u .+1.0

uspan = (0.02, 0.1)
prob = IntervalNonlinearProblem(f, uspan)
sol = solve(prob)
@test SciMLBase.successful_retcode(sol)

u0 = 0.06
p = 2.0
prob = NonlinearProblem(f, u0, p)
solver = solve(prob)
@test SciMLBase.successful_retcode(sol)

0 comments on commit 0c69cde

Please sign in to comment.