diff --git a/test/basictests.jl b/test/basictests.jl index 7680f255a..4fc595502 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -813,3 +813,21 @@ sol = solve(probN, PseudoTransient(alpha_initial = 10.0, linsolve = linsolve), reltol = 1e-9) @test sol.retcode == ReturnCode.Success + +# Test that `PseudoTransient` passes a test that `NewtonRaphson` fails on. + +p = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] +u0 = [-10.0, -1.0, 1.0, 2.0, 3.0, 4.0, 10.0] + +f_t = (u, p) -> 0.010000000000000002 .+ + 10.000000000000002 ./ (1 .+ + (0.21640425613334457 .+ + 216.40425613334457 ./ (1 .+ + (0.21640425613334457 .+ + 216.40425613334457 ./ + (1 .+ 0.0006250000000000001(u .^ 2.0))) .^ 2.0)) .^ 2.0) .- + 0.0011552453009332421u .- p + +probN = NonlinearProblem{false}(f_t, u0, p) +sol = solve(probN, PseudoTransient(alpha_initial = 1.0), abstol = 1e-10) +@test all(abs.(f_t(sol.u, p)) .< 1e-10)