From 8098e0a19323a44ba45698db6920bea03d66806b Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Wed, 11 Dec 2024 12:14:27 +0530 Subject: [PATCH] fix: respect `use_homotopy_continuation` in `NonlinearProblem` and default it to `false` --- src/systems/nonlinear/nonlinearsystem.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/systems/nonlinear/nonlinearsystem.jl b/src/systems/nonlinear/nonlinearsystem.jl index 3cb68853aa..2c788688bd 100644 --- a/src/systems/nonlinear/nonlinearsystem.jl +++ b/src/systems/nonlinear/nonlinearsystem.jl @@ -496,13 +496,15 @@ end function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem, u0map, parammap = DiffEqBase.NullParameters(); - check_length = true, use_homotopy_continuation = true, kwargs...) where {iip} + check_length = true, use_homotopy_continuation = false, kwargs...) where {iip} if !iscomplete(sys) error("A completed `NonlinearSystem` is required. Call `complete` or `structural_simplify` on the system before creating a `NonlinearProblem`") end - prob = safe_HomotopyContinuationProblem(sys, u0map, parammap; check_length, kwargs...) - if prob isa HomotopyContinuationProblem - return prob + if use_homotopy_continuation + prob = safe_HomotopyContinuationProblem(sys, u0map, parammap; check_length, kwargs...) + if prob isa HomotopyContinuationProblem + return prob + end end f, u0, p = process_SciMLProblem(NonlinearFunction{iip}, sys, u0map, parammap; check_length, kwargs...)