diff --git a/Project.toml b/Project.toml index 35fdb7046..27655a6af 100644 --- a/Project.toml +++ b/Project.toml @@ -80,7 +80,7 @@ LinearAlgebra = "1.10" LinearSolve = "2.30" MINPACK = "1.2" MaybeInplace = "0.1.3" -ModelingToolkit = "9.13.0" +ModelingToolkit = "9.15.0" NLSolvers = "0.5" NLsolve = "4.5" NaNMath = "1" diff --git a/test/misc/exotic_type_tests.jl b/test/misc/exotic_type_tests.jl new file mode 100644 index 000000000..57a9c28ed --- /dev/null +++ b/test/misc/exotic_type_tests.jl @@ -0,0 +1,27 @@ +# File for different types of exotic types +@testsetup module NonlinearSolveExoticTypeTests +using NonlinearSolve + +fn_iip = NonlinearFunction{true}((du, u, p) -> du .= u .* u .- p) +fn_oop = NonlinearFunction{false}((u, p) -> u .* u .- p) + +u0 = BigFloat[1.0, 1.0, 1.0] +prob_iip_bf = NonlinearProblem{true}(fn_iip, u0, BigFloat(2)) +prob_oop_bf = NonlinearProblem{false}(fn_oop, u0, BigFloat(2)) + +export fn_iip, fn_oop, u0, prob_iip_bf, prob_oop_bf +end + +@testitem "BigFloat Support" tags=[:misc] setup=[NonlinearSolveExoticTypeTests] begin + using NonlinearSolve, LinearAlgebra + + for alg in [NewtonRaphson(), Broyden(), Klement(), DFSane(), TrustRegion()] + sol = solve(prob_oop_bf, alg) + @test norm(sol.resid, Inf) < 1e-6 + @test SciMLBase.successful_retcode(sol.retcode) + + sol = solve(prob_iip_bf, alg) + @test norm(sol.resid, Inf) < 1e-6 + @test SciMLBase.successful_retcode(sol.retcode) + end +end