-
-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Question❓
I am working on components for a chemical reactor. The problem is possibly numerically tricky, as it involves compression of liquid with thermodynamics from Clapeyron.jl.
I have successfully compiled the symbolic model (sys_rx), and successfully created a numeric problem:
julia> prob_rx = ODEProblem(sys_rx, [], tspan)
ODEProblem with uType Vector{Float64} and tType Float64. In-place: true
Initialization status: FULLY_DETERMINED
Non-trivial mass matrix: true
timespan: (0.0, 30.0)
u0: 8-element Vector{Float64}:
298.15
298.15
298.15
358.15
-1.2078062302879227e10
5969.36198084991
199.9832285042051
33891.033956759304
When I try to solve the model, I get an error message... Are you guys able to see where the problem lies? Note: pb_e is one of three instances of a PressureBoundaryR component I have created. It has a single port a, and mass fraction vector x (three elements).
julia> sol_rx = solve(prob_rx,Rodas5())
UndefVarError: `pb_e₊a₊x` not defined in `ModelingToolkitBase`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
[1] macro expansion
@ C:\Users\Bernt\.julia\packages\Symbolics\29fkz\src\build_function.jl:143 [inlined]
[2] macro expansion
@ C:\Users\Bernt\.julia\packages\RuntimeGeneratedFunctions\9kbBw\src\RuntimeGeneratedFunctions.jl:200 [inlined]
[3] macro expansion
@ .\none:0 [inlined]
[4] generated_callfunc(::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc9f8d13b, 0x149ba748, 0xea26c03f, 0xcdd5fdda, 0x0aafbe4f), Nothing}, ::Tuple{Vector{Float64}, Vector{Vector{Float64}}}, ::Tuple{SciMLBase.NonlinearSolution{Float64, 1, Vector{Float64}, Vector{Float64}, @NamedTuple{p::Nothing}, Nothing, Nothing, Nothing, Nothing, Nothing}}, ::MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}})
@ ModelingToolkitBase .\none:0
[5] iteratively_build_sols(alg::SCCNonlinearSolve.SCCAlg{NonlinearSolveBase.NonlinearSolvePolyAlgorithm{Val{6}, Tuple{NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.GoodBroydenUpdateRule, NonlinearSolveQuasiNewton.NoChangeInStateReset{Nothing}, NonlinearSolveQuasiNewton.IdentityInitialization{Nothing, NonlinearSolveQuasiNewton.FullStructure}, Val{false}}, NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.KlementUpdateRule, NonlinearSolveQuasiNewton.IllConditionedJacobianReset, NonlinearSolveQuasiNewton.IdentityInitialization{Nothing, NonlinearSolveQuasiNewton.DiagonalStructure}, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, NonlinearSolveFirstOrder.GenericTrustRegionScheme{NonlinearSolveFirstOrder.RadiusUpdateSchemes.__Simple, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}}, NonlinearSolveBase.Dogleg{NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveBase.SteepestDescent{Nothing}}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, NonlinearSolveFirstOrder.GenericTrustRegionScheme{NonlinearSolveFirstOrder.RadiusUpdateSchemes.__Bastin, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}}, NonlinearSolveBase.Dogleg{NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveBase.SteepestDescent{Nothing}}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, NonlinearSolveFirstOrder.LevenbergMarquardtTrustRegion{Float64}, NonlinearSolveBase.GeodesicAcceleration{NonlinearSolveBase.DampedNewtonDescent{Nothing, Float64, NonlinearSolveFirstOrder.LevenbergMarquardtDampingFunction{Float64, Float64, Float64}}, Float64, Float64}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{true}}}}, Nothing}, probs::Tuple{NonlinearProblem{Vector{Float64}, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x47db40c9, 0xe298923d, 0xb41b6f8a, 0x7aefd986, 0x69b98c8b), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc6ae11a3, 0xbcc3220a, 0x19add288, 0x6a187cca, 0xb2e71098), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, System, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, NonlinearProblem{Vector{Float64}, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x697b509a, 0xd09feca7, 0xa845e4f0, 0x0a8725ae, 0x6bd5de47), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x65040671, 0x92ffaf79, 0x5c6df019, 0x81e065de, 0x987668b7), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, System, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, NonlinearProblem{Vector{Float64}, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xfd9f3524, 0xa2c748d2, 0x76d6c94e, 0x46380581, 0x3cb7586f), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x44200bc6, 0xd4d163b8, 0x0ab21b94, 0xc677f686, 0xba7df4d3), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, System, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}}, explicitfuns::Tuple{ModelingToolkit.CacheWriter{ModelingToolkitBase.GeneratedFunctionWrapper{(3, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc6013997, 0xd53377e6, 0x0997f324, 0xe074eff3, 0x338bbd24), Nothing}, Nothing}}, ModelingToolkit.CacheWriter{ModelingToolkitBase.GeneratedFunctionWrapper{(3, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc9f8d13b, 0x149ba748, 0xea26c03f, 0xcdd5fdda, 0x0aafbe4f), Nothing}, Nothing}}, ModelingToolkit.CacheWriter{ModelingToolkitBase.GeneratedFunctionWrapper{(3, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x3809ac20, 0x4313bc5d, 0x5b071d07, 0xa511ee84, 0x356e452b), Nothing}, Nothing}}}, ::Val{3}; kwargs::@Kwargs{abstol::Float64, reltol::Float64})
@ SCCNonlinearSolve C:\Users\Bernt\.julia\packages\SCCNonlinearSolve\xmKJS\src\SCCNonlinearSolve.jl:113
[6] _scc_solve(prob::SCCNonlinearProblem{Vector{Float64}, false, Tuple{NonlinearProblem{Vector{Float64}, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x47db40c9, 0xe298923d, 0xb41b6f8a, 0x7aefd986, 0x69b98c8b), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc6ae11a3, 0xbcc3220a, 0x19add288, 0x6a187cca, 0xb2e71098), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, System, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, NonlinearProblem{Vector{Float64}, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x697b509a, 0xd09feca7, 0xa845e4f0, 0x0a8725ae, 0x6bd5de47), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x65040671, 0x92ffaf79, 0x5c6df019, 0x81e065de, 0x987668b7), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, System, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, NonlinearProblem{Vector{Float64}, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xfd9f3524, 0xa2c748d2, 0x76d6c94e, 0x46380581, 0x3cb7586f), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x44200bc6, 0xd4d163b8, 0x0ab21b94, 0xc677f686, 0xba7df4d3), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, System, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}}, Tuple{ModelingToolkit.CacheWriter{ModelingToolkitBase.GeneratedFunctionWrapper{(3, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc6013997, 0xd53377e6, 0x0997f324, 0xe074eff3, 0x338bbd24), Nothing}, Nothing}}, ModelingToolkit.CacheWriter{ModelingToolkitBase.GeneratedFunctionWrapper{(3, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc9f8d13b, 0x149ba748, 0xea26c03f, 0xcdd5fdda, 0x0aafbe4f), Nothing}, Nothing}}, ModelingToolkit.CacheWriter{ModelingToolkitBase.GeneratedFunctionWrapper{(3, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x3809ac20, 0x4313bc5d, 0x5b071d07, 0xa511ee84, 0x356e452b), Nothing}, Nothing}}}, NonlinearFunction{false, SciMLBase.FullSpecialize, Returns{Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, System, Nothing, Nothing}, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{Vector{Float64}, Vector{Vector{Float64}}}}, Val{true}}, alg::SCCNonlinearSolve.SCCAlg{NonlinearSolveBase.NonlinearSolvePolyAlgorithm{Val{6}, Tuple{NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.GoodBroydenUpdateRule, NonlinearSolveQuasiNewton.NoChangeInStateReset{Nothing}, NonlinearSolveQuasiNewton.IdentityInitialization{Nothing, NonlinearSolveQuasiNewton.FullStructure}, Val{false}}, NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.KlementUpdateRule, NonlinearSolveQuasiNewton.IllConditionedJacobianReset, NonlinearSolveQuasiNewton.IdentityInitialization{Nothing, NonlinearSolveQuasiNewton.DiagonalStructure}, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, NonlinearSolveFirstOrder.GenericTrustRegionScheme{NonlinearSolveFirstOrder.RadiusUpdateSchemes.__Simple, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}}, NonlinearSolveBase.Dogleg{NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveBase.SteepestDescent{Nothing}}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, NonlinearSolveFirstOrder.GenericTrustRegionScheme{NonlinearSolveFirstOrder.RadiusUpdateSchemes.__Bastin, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}, Rational{Int64}}, NonlinearSolveBase.Dogleg{NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveBase.SteepestDescent{Nothing}}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{false}}, NonlinearSolveFirstOrder.GeneralizedFirstOrderAlgorithm{Missing, NonlinearSolveFirstOrder.LevenbergMarquardtTrustRegion{Float64}, NonlinearSolveBase.GeodesicAcceleration{NonlinearSolveBase.DampedNewtonDescent{Nothing, Float64, NonlinearSolveFirstOrder.LevenbergMarquardtDampingFunction{Float64, Float64, Float64}}, Float64, Float64}, Nothing, ADTypes.AutoForwardDiff{1, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, Nothing, Val{true}}}}, Nothing}; kwargs::@Kwargs{abstol::Float64, reltol::Float64})
@ SCCNonlinearSolve C:\Users\Bernt\.julia\packages\SCCNonlinearSolve\xmKJS\src\SCCNonlinearSolve.jl:153
[7] _scc_solve
@ C:\Users\Bernt\.julia\packages\SCCNonlinearSolve\xmKJS\src\SCCNonlinearSolve.jl:153 [inlined]
[8] #scc_solve_up#6
@ C:\Users\Bernt\.julia\packages\SCCNonlinearSolve\xmKJS\src\SCCNonlinearSolve.jl:62 [inlined]
[9] scc_solve_up
@ C:\Users\Bernt\.julia\packages\SCCNonlinearSolve\xmKJS\src\SCCNonlinearSolve.jl:58 [inlined]
[10] #solve#5
@ C:\Users\Bernt\.julia\packages\SCCNonlinearSolve\xmKJS\src\SCCNonlinearSolve.jl:52 [inlined]
[11] solve
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested