Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve(nlcache) errors for complex types #364

Closed
jamblejoe opened this issue Feb 1, 2024 · 3 comments
Closed

solve(nlcache) errors for complex types #364

jamblejoe opened this issue Feb 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jamblejoe
Copy link

Describe the bug 🐞

solve(prob) does not error for complex valued problems, but solve(nlcache) does.

Minimal Reproducible Example 👇

f(u, p) = u .* u .- p
u0 = [1.0im]
prob = NonlinearProblem(f, u0, [1])

Now

solve(prob)

returns successfully. But

nlcache = init(prob)
solve(nlcache)

errors.

Error & Stacktrace ⚠️

ERROR: MethodError: no method matching init(::NonlinearSolve.NonlinearSolvePolyAlgorithmCache{false, 4, Tuple{…}, NonlinearSolvePolyAlgorithm{…}})

Closest candidates are:
  init(::SciMLBase.AbstractJumpProblem, Any...; kwargs...)
   @ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:545
  init(::NonlinearProblem{<:Union{Number, var"#s157"} where var"#s157"<:AbstractArray, iip, <:Union{var"#s156", var"#s155"} where {var"#s156"<:ForwardDiff.Dual{T, V, P}, var"#s155"<:(AbstractArray{<:ForwardDiff.Dual{T, V, P}})}}, ::Union{Nothing, SciMLBase.AbstractNonlinearAlgorithm}, ::Any...; kwargs...) where {T, V, P, iip}
   @ NonlinearSolve ~/.julia/packages/NonlinearSolve/UPIol/src/internal/forward_diff.jl:37
  init(::PDEProblem, ::SciMLBase.AbstractDEAlgorithm, ::Any...; kwargs...)
   @ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:1140
  ...

Stacktrace:
 [1] solve(args::NonlinearSolve.NonlinearSolvePolyAlgorithmCache{…}; kwargs::@Kwargs{})
   @ CommonSolve ~/.julia/packages/CommonSolve/JfpfI/src/CommonSolve.jl:23
 [2] top-level scope
   @ REPL[97]:1
Some type information was truncated. Use `show(err)` to see complete types.

Environment (please complete the following information):

  NonlinearSolve v3.5.3
  • Output of versioninfo()
julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores
@jamblejoe jamblejoe added the bug Something isn't working label Feb 1, 2024
@ChrisRackauckas
Copy link
Member

You meant solve!?

@avik-pal
Copy link
Member

avik-pal commented Feb 2, 2024

Just changing to solve! works.

@avik-pal avik-pal closed this as completed Feb 2, 2024
@jamblejoe
Copy link
Author

Sorry, I get confused with solve and solve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants