-
-
Notifications
You must be signed in to change notification settings - Fork 48
Trivial (length 0 state) NonlinearLeastSquaresProblem always returns success #387
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
Closed
Comments
This was referenced Feb 28, 2024
It is not even hitting NonlinearSolve for some reason. If we do: julia> SciMLBase.__solve(unsatprob, GaussNewton())
ERROR: MethodError: no method matching __maybe_unaliased(::Nothing, ::Bool)
Closest candidates are:
__maybe_unaliased(::NonlinearSolve.AbstractNonlinearSolveOperator, ::Bool)
@ NonlinearSolve /mnt/research/ongoing/nlsolve/NonlinearSolve.jl/src/utils.jl:50
__maybe_unaliased(::Union{Number, StaticArraysCore.SArray}, ::Bool)
@ NonlinearSolve /mnt/research/ongoing/nlsolve/NonlinearSolve.jl/src/utils.jl:44
__maybe_unaliased(::AbstractArray, ::Bool)
@ NonlinearSolve /mnt/research/ongoing/nlsolve/NonlinearSolve.jl/src/utils.jl:45
Stacktrace:
[1] __init(::NonlinearLeastSquaresProblem{…}, ::GeneralizedFirstOrderAlgorithm{…}; alias_u0::Bool, maxiters::Int64, abstol::Nothing, reltol::Nothing, maxtime::Nothing, termination_condition::Nothing, internalnorm::Function, linsolve_kwargs::@NamedTuple{}, kwargs::@Kwargs{})
@ NonlinearSolve /mnt/research/ongoing/nlsolve/NonlinearSolve.jl/src/core/generalized_first_order.jl:152
[2] __init(::NonlinearLeastSquaresProblem{Nothing, true, SciMLBase.NullParameters, NonlinearFunction{…}, @Kwargs{}}, ::GeneralizedFirstOrderAlgorithm{nothing, :GaussNewton, Missing, Missing, NewtonDescent{…}, Nothing, Nothing, Nothing})
@ NonlinearSolve /mnt/research/ongoing/nlsolve/NonlinearSolve.jl/src/core/generalized_first_order.jl:144
[3] init_call(_prob::NonlinearLeastSquaresProblem{…}, args::GeneralizedFirstOrderAlgorithm{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{})
@ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/solve.jl:530
[4] init_call(_prob::NonlinearLeastSquaresProblem{Nothing, true, SciMLBase.NullParameters, NonlinearFunction{…}, @Kwargs{}}, args::GeneralizedFirstOrderAlgorithm{nothing, :GaussNewton, Missing, Missing, NewtonDescent{…}, Nothing, Nothing, Nothing})
@ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/solve.jl:503
[5] init_up(prob::NonlinearLeastSquaresProblem{…}, sensealg::Nothing, u0::Nothing, p::SciMLBase.NullParameters, args::GeneralizedFirstOrderAlgorithm{…}; kwargs::@Kwargs{})
@ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/solve.jl:556
[6] init_up(prob::NonlinearLeastSquaresProblem{…}, sensealg::Nothing, u0::Nothing, p::SciMLBase.NullParameters, args::GeneralizedFirstOrderAlgorithm{…})
@ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/solve.jl:551
[7] init(prob::NonlinearLeastSquaresProblem{…}, args::GeneralizedFirstOrderAlgorithm{…}; sensealg::Nothing, u0::Nothing, p::Nothing, kwargs::@Kwargs{})
@ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/solve.jl:544
[8] init(prob::NonlinearLeastSquaresProblem{Nothing, true, SciMLBase.NullParameters, NonlinearFunction{…}, @Kwargs{}}, args::GeneralizedFirstOrderAlgorithm{nothing, :GaussNewton, Missing, Missing, NewtonDescent{…}, Nothing, Nothing, Nothing})
@ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/solve.jl:534
[9] __solve(::NonlinearLeastSquaresProblem{Nothing, true, SciMLBase.NullParameters, NonlinearFunction{…}, @Kwargs{}}, ::GeneralizedFirstOrderAlgorithm{nothing, :GaussNewton, Missing, Missing, NewtonDescent{…}, Nothing, Nothing, Nothing}; kwargs::@Kwargs{})
@ NonlinearSolve /mnt/research/ongoing/nlsolve/NonlinearSolve.jl/src/core/generic.jl:3
[10] __solve(::NonlinearLeastSquaresProblem{Nothing, true, SciMLBase.NullParameters, NonlinearFunction{…}, @Kwargs{}}, ::GeneralizedFirstOrderAlgorithm{nothing, :GaussNewton, Missing, Missing, NewtonDescent{…}, Nothing, Nothing, Nothing})
@ NonlinearSolve /mnt/research/ongoing/nlsolve/NonlinearSolve.jl/src/core/generic.jl:1
[11] top-level scope
@ REPL[14]:1
[12] top-level scope
@ ~/.julia/packages/Infiltrator/TNlCu/src/Infiltrator.jl:798
Some type information was truncated. Use `show(err)` to see complete types. |
It's hitting a short circuit here https://github.com/SciML/DiffEqBase.jl/blob/master/src/solve.jl#L682-L694, which made sense for NonlinearProblem since that would also need 0 equations, but now NonlinearLeastSquaresProblem we need to make sure it's satisfied. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Here's a fun edge case:
The text was updated successfully, but these errors were encountered: