Open KPCCoiL opened 2 weeks ago
Symbolic functions created with @variables accept multiple arguments and can be manipulated normally:
@variables
julia> @variables x f(..) 2-element Vector{Any}: x f⋆ julia> julia> 2f(x) 2f(x) julia> 2f(x, x) 2f(x, x)
On the other hand, ones created with Symbolics.variable fed more than one argument cannot be multiplied by a number:
Symbolics.variable
julia> @variables x 1-element Vector{Num}: x julia> f = Symbolics.variable(:f, T=Symbolics.FnType) f⋆ julia> 2f(x) 2f(x) julia> 2f(x, x) ERROR: ArgumentError: The function * cannot be applied to f(x, x) which is not a Number-like object.Define `islike(::Num, ::Type{Number}) = true` to enable this. Stacktrace: [1] assert_like(::Function, ::Type, ::Num) @ SymbolicUtils ~/.julia/packages/SymbolicUtils/dtCid/src/methods.jl:43 [2] assert_like @ ~/.julia/packages/SymbolicUtils/dtCid/src/methods.jl:45 [inlined] [3] *(a::Int64, b::Num) @ Symbolics ~/.julia/packages/SymbolicUtils/dtCid/src/methods.jl:74 [4] top-level scope @ REPL[5]:1
Not totally sure if this is a bug, but confusing at least.
It's missing its eltype:
yy = Symbolics.variable(:y, T = Symbolics.FnType{Tuple, Real})
That error is a bit confusing in how it's reported.
Symbolic functions created with
@variables
accept multiple arguments and can be manipulated normally:On the other hand, ones created with
Symbolics.variable
fed more than one argument cannot be multiplied by a number:Not totally sure if this is a bug, but confusing at least.