SciML / SciML/ProcessSimulator.jl

Avoid issue with symbolic differentiation

Open
#3 0 comments 0 reactions 1 assignee View on GitHub

@avinashresearch1 is already working on this.

Since Jan 30, 2024.

bug
Dominant language
Julia
Stars
44
Forks
8
Avg merge
2d 10h
Merged PRs (30d)
6

Description

ERROR: Differentiation with array expressions is not yet supported
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] occursin_info
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:59 [inlined]
  [3] (::Symbolics.var"#225#227"{…})(a::Symbolics.ArrayOp{…})
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:92
  [4] iterate
    @ Base ./generator.jl:47 [inlined]
  [5] collect_to!(dest::Vector{Bool}, itr::Base.Generator{Vector{…}, Symbolics.var"#225#227"{…}}, offs::Int64, st::Int64)
    @ Base ./array.jl:892
  [6] collect_to_with_first!(dest::Vector{…}, v1::Bool, itr::Base.Generator{…}, st::Int64)
    @ Base ./array.jl:870
  [7] _collect(c::Vector{…}, itr::Base.Generator{…}, ::Base.EltypeUnknown, isz::Base.HasShape{…})
    @ Base ./array.jl:864
  [8] collect_similar
    @ Base ./array.jl:763 [inlined]
  [9] map
    @ Base ./abstractarray.jl:3282 [inlined]
 [10] occursin_info(x::SymbolicUtils.BasicSymbolic{Real}, expr::SymbolicUtils.BasicSymbolic{Real}, fail::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:92
--- the last 8 lines are repeated 2 more times ---
 [27] (::Symbolics.var"#225#227"{…})(a::SymbolicUtils.BasicSymbolic{…})
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:92
 [28] iterate
    @ Base ./generator.jl:47 [inlined]
 [29] _collect(c::Vector{…}, itr::Base.Generator{…}, ::Base.EltypeUnknown, isz::Base.HasShape{…})
    @ Base ./array.jl:854
 [30] collect_similar
    @ Base ./array.jl:763 [inlined]
 [31] map
    @ Base ./abstractarray.jl:3282 [inlined]
 [32] occursin_info(x::SymbolicUtils.BasicSymbolic{Real}, expr::SymbolicUtils.BasicSymbolic{Real}, fail::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:92
 [33] (::Symbolics.var"#225#227"{…})(a::SymbolicUtils.BasicSymbolic{…})
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:92
 [34] iterate
    @ Base ./generator.jl:47 [inlined]
 [35] collect_to!(dest::Vector{Bool}, itr::Base.Generator{Vector{…}, Symbolics.var"#225#227"{…}}, offs::Int64, st::Int64)
    @ Base ./array.jl:892
 [36] collect_to_with_first!(dest::Vector{…}, v1::Bool, itr::Base.Generator{…}, st::Int64)
    @ Base ./array.jl:870
 [37] _collect(c::Vector{…}, itr::Base.Generator{…}, ::Base.EltypeUnknown, isz::Base.HasShape{…})
    @ Base ./array.jl:864
 [38] collect_similar
    @ Base ./array.jl:763 [inlined]
 [39] map
    @ Base ./abstractarray.jl:3282 [inlined]
 [40] occursin_info(x::SymbolicUtils.BasicSymbolic{Real}, expr::SymbolicUtils.BasicSymbolic{Real}, fail::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:92
--- the last 14 lines are repeated 1 more time ---
 [55] occursin_info(x::SymbolicUtils.BasicSymbolic{Real}, expr::SymbolicUtils.BasicSymbolic{Real})
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:57
 [56] expand_derivatives(O::SymbolicUtils.BasicSymbolic{Real}, simplify::Bool; occurrences::Nothing)
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:169
 [57] expand_derivatives(O::SymbolicUtils.BasicSymbolic{Real}, simplify::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:163
 [58] derivative(O::Num, v::Num; simplify::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:424
 [59] derivative(O::Num, v::Num)
    @ Symbolics ~/.julia/packages/Symbolics/B3bDY/src/diff.jl:420
 [60] ∂f∂T(model::ShomateIdeal, V::Num, T::Num, z::Symbolics.Arr{Num, 1})
    @ ClapeyronSymbolicsExt ~/.julia/packages/Clapeyron/VMkvl/ext/ClapeyronSymbolicsExt.jl:70
 [61] VT_entropy(model::ShomateIdeal, V::Num, T::Num, z::Symbolics.Arr{Num, 1})
    @ Clapeyron ~/.julia/packages/Clapeyron/VMkvl/src/models/ideal/ideal.jl:24
 [62] entropy(model::ShomateIdeal, p::Num, T::Num, z::Symbolics.Arr{Num, 1}; phase::Symbol, threaded::Bool, vol0::Nothing)
    @ Clapeyron ~/.julia/packages/Clapeyron/VMkvl/src/methods/pT.jl:17
 [63] entropy(model::ShomateIdeal, p::Num, T::Num, z::Symbolics.Arr{Num, 1})
    @ Clapeyron ~/.julia/packages/Clapeyron/VMkvl/src/methods/pT.jl:15
 [64] Entropy_TP(T::Num, P::Num, H₀_S₀::Matrix{…}, ξ::Symbolics.Arr{…}, ν::Matrix{…}, model::ShomateIdeal, f_feed::Symbolics.Arr{…})
    @ Main ~/Desktop/PROCESS_SIMULATOR/ProcessSimulator.jl/src/Reactors/Gibbs_Reactor/GibbsReactor_symbolic.jl:56
Some type information was truncated. Use `show(err)` to see complete types.

This happens even if the Gibbs reactor is registered symbolically.

Reference: https://github.com/ClapeyronThermo/Clapeyron.jl/issues/186

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.