-
Notifications
You must be signed in to change notification settings - Fork 52
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
LinearAlgebra.SingularException in examples/multi-component_vle_vlle_lle_crit notebook #172
Comments
reproducer:
it is important to note that the point that fail is the last one (the critical temp). it is inherently hard to solver at those conditions. what happened probably is that the phases merged into one, i suppose? if we use
seems that the critical point for that particular model is lower than the one anotated |
this particular case was added as a test. by a refactoring on how bubble and dew pressure points are calculated, this specific error does not appear anymore with this combination of inputs |
the real reproducer:
|
Hi,
running this notebook stops at 3rd input cell with error:
LinearAlgebra.SingularException(5)
Stacktrace:
[1] checknonsingular
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/factorization.jl:19 [inlined]
[2] checknonsingular
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/factorization.jl:21 [inlined]
[3] #lu!#136
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lu.jl:85 [inlined]
[4] #lu#140
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lu.jl:273 [inlined]
[5] lu (repeats 2 times)
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lu.jl:272 [inlined]
[6] (A::Matrix{Float64}, B::Vector{Float64})
@ LinearAlgebra /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/generic.jl:1136
[7] default_newton_linsolve(d::Vector{Float64}, B::Matrix{Float64}, g::Vector{Float64})
@ NLSolvers ~/.julia/packages/NLSolvers/lRxce/src/quasinewton/approximations/newton.jl:15
[8] solve(problem::NLSolvers.NEqProblem{NLSolvers.VectorObjective{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Clapeyron.Solvers.var"#j!#1"{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}}}, Vector{Float64}}, Clapeyron.Solvers.var"#fj!#2"{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}}}}, Clapeyron.Solvers.var"#jv!#3"}, Nothing, NLSolvers.Euclidean{Tuple{0}}, NLSolvers.InPlace}, x::Vector{Float64}, method::NLSolvers.LineSearch{NLSolvers.Newton{NLSolvers.Direct, typeof(NLSolvers.default_newton_linsolve), Nothing, Nothing}, NLSolvers.Backtracking{Float64, Int64, NLSolvers.FixedInterp, NamedTuple{(:lower, :upper), Tuple{Int64, Float64}}}, NLSolvers.InitialScaling{NLSolvers.ShannoPhua}}, options::NLSolvers.NEqOptions{Float64, Int64, Nothing}, state::NamedTuple{(:z, :d, :Fx, :Jx), Tuple{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}}})
@ NLSolvers ~/.julia/packages/NLSolvers/lRxce/src/nlsolve/linesearch/newton.jl:71
[9] solve(problem::NLSolvers.NEqProblem{NLSolvers.VectorObjective{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Clapeyron.Solvers.var"#j!#1"{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}}}, Vector{Float64}}, Clapeyron.Solvers.var"#fj!#2"{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}}}}, Clapeyron.Solvers.var"#jv!#3"}, Nothing, NLSolvers.Euclidean{Tuple{0}}, NLSolvers.InPlace}, x::Vector{Float64}, method::NLSolvers.LineSearch{NLSolvers.Newton{NLSolvers.Direct, typeof(NLSolvers.default_newton_linsolve), Nothing, Nothing}, NLSolvers.Backtracking{Float64, Int64, NLSolvers.FixedInterp, NamedTuple{(:lower, :upper), Tuple{Int64, Float64}}}, NLSolvers.InitialScaling{NLSolvers.ShannoPhua}}, options::NLSolvers.NEqOptions{Float64, Int64, Nothing})
@ NLSolvers ~/.julia/packages/NLSolvers/lRxce/src/nlsolve/linesearch/newton.jl:11
[10] nlsolve(nl_problem::NLSolvers.NEqProblem{NLSolvers.VectorObjective{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Clapeyron.Solvers.var"#j!#1"{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}}}, Vector{Float64}}, Clapeyron.Solvers.var"#fj!#2"{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Clapeyron.var"#f!#261"{PCSAFT{BasicIdeal}, Float64, Vector{Float64}, Float64}, Float64}, Float64, 2}}}}}, Clapeyron.Solvers.var"#jv!#3"}, Nothing, NLSolvers.Euclidean{Tuple{0}}, NLSolvers.InPlace}, x0::Vector{Float64}, method::NLSolvers.LineSearch{NLSolvers.Newton{NLSolvers.Direct, typeof(NLSolvers.default_newton_linsolve), Nothing, Nothing}, NLSolvers.Backtracking{Float64, Int64, NLSolvers.FixedInterp, NamedTuple{(:lower, :upper), Tuple{Int64, Float64}}}, NLSolvers.InitialScaling{NLSolvers.ShannoPhua}}, options::NLSolvers.NEqOptions{Float64, Int64, Nothing})
@ Clapeyron.Solvers ~/.julia/packages/Clapeyron/kGA2x/src/solvers/nlsolve.jl:22
[11] nlsolve(f!::Function, x0::Vector{Float64}, method::NLSolvers.LineSearch{NLSolvers.Newton{NLSolvers.Direct, typeof(NLSolvers.default_newton_linsolve), Nothing, Nothing}, NLSolvers.Backtracking{Float64, Int64, NLSolvers.FixedInterp, NamedTuple{(:lower, :upper), Tuple{Int64, Float64}}}, NLSolvers.InitialScaling{NLSolvers.ShannoPhua}}, options::NLSolvers.NEqOptions{Float64, Int64, Nothing}, chunk::ForwardDiff.Chunk{2})
@ Clapeyron.Solvers ~/.julia/packages/Clapeyron/kGA2x/src/solvers/nlsolve.jl:18
[12] nlsolve(f!::Function, x0::Vector{Float64}, method::NLSolvers.LineSearch{NLSolvers.Newton{NLSolvers.Direct, typeof(NLSolvers.default_newton_linsolve), Nothing, Nothing}, NLSolvers.Backtracking{Float64, Int64, NLSolvers.FixedInterp, NamedTuple{(:lower, :upper), Tuple{Int64, Float64}}}, NLSolvers.InitialScaling{NLSolvers.ShannoPhua}}, options::NLSolvers.NEqOptions{Float64, Int64, Nothing})
@ Clapeyron.Solvers ~/.julia/packages/Clapeyron/kGA2x/src/solvers/nlsolve.jl:16
[13] bubble_pressure_impl(model::PCSAFT{BasicIdeal}, T::Float64, x::Vector{Float64}, method::ChemPotBubblePressure{Float64})
@ Clapeyron ~/.julia/packages/Clapeyron/kGA2x/src/methods/property_solvers/multicomponent/bubble_point/bubble_chempot.jl:83
[14] bubble_pressure(model::PCSAFT{BasicIdeal}, T::Float64, x::Vector{Float64}, method::ChemPotBubblePressure{Float64})
@ Clapeyron ~/.julia/packages/Clapeyron/kGA2x/src/methods/property_solvers/multicomponent/bubble_point.jl:138
[15] #bubble_pressure#274
@ ~/.julia/packages/Clapeyron/kGA2x/src/methods/property_solvers/multicomponent/bubble_point.jl:321 [inlined]
[16] top-level scope
@ In[3]:21
The text was updated successfully, but these errors were encountered: