We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following code works:
using ModelingToolkit, LinearAlgebra @variables t pos(t)[1:3] = [0.0, 0.0, 10.0] pos/norm(pos)
the following code crashes:
using ModelingToolkit, LinearAlgebra @variables t pos(t)[1:3] = [0.0, 0.0, 10.0] normalize(pos)
with the following message:
ERROR: TypeError: non-boolean (Num) used in boolean context Stacktrace: [1] copyto!(dest::OffsetArrays.OffsetVector{Num, Vector{Num}}, src::Symbolics.Arr{Num, 1}) @ Base ./abstractarray.jl:1059 [2] copymutable_oftype(A::Symbolics.Arr{Num, 1}, ::Type{Num}) @ LinearAlgebra ~/.julia/juliaup/julia-1.10.0-rc2+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/LinearAlgebra.jl:404 [3] normalize(a::Symbolics.Arr{Num, 1}, p::Int64) @ LinearAlgebra ~/.julia/juliaup/julia-1.10.0-rc2+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/generic.jl:1881 [4] normalize(a::Symbolics.Arr{Num, 1}) @ LinearAlgebra ~/.julia/juliaup/julia-1.10.0-rc2+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/generic.jl:1879 [5] top-level scope @ REPL[3]:1
So I think there is an additional method needed for the function normalize() with a vector of symbols as parameter.
julia> versioninfo() Julia Version 1.10.0-rc2 Commit dbb9c46795b (2023-12-03 15:25 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 32 × AMD Ryzen 9 7950X 16-Core Processor WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, znver3) Threads: 1 on 32 virtual cores Environment: LD_LIBRARY_PATH = /lib:/usr/lib:/usr/local/lib
The text was updated successfully, but these errors were encountered:
There might be a fix in the works already, see: https://discourse.julialang.org/t/modelingtoolkit-and-normalize/107349/2
Sorry, something went wrong.
Per the discussion, it seems like this needs to be fixed in Symbolics.jl, not in LinearAlgebra.
No branches or pull requests
The following code works:
the following code crashes:
with the following message:
So I think there is an additional method needed for the function normalize() with a vector of symbols as parameter.
The text was updated successfully, but these errors were encountered: