Symbolics.jl
Symbolics.jl copied to clipboard
Symbolic programming for the next generation of numerical software
Hello, Please find below a Sympy MWE that describes my question in the title: ``` import sympy as sp def main(): x, y = sp.symbols('x, y') a22, a21, a12, a11,...
1. avoids creating a vector due to broadcast 2. avoids sorting arguments 3. make use of the data structures of `Mul` and `Add`
Working with Symbolics.jl, I came accross to the following small inconsistency (see the _`true`_ value in the (1,2) element): ``` julia> F 2×2 Matrix{Num}: 0.0 1.0 -1.0 - 10.0cos(t) -24.0...
Fixes #651
The following MWE errors in ModelingToolkit.jl because symbolic callback conditions internally passed to `build_function` are `::Num` and call the method [here](https://github.com/JuliaSymbolics/Symbolics.jl/blob/7eac91321ccd5a68254005ba39770d629201a867/src/build_function.jl#L99-L124), without kwarg slurping, which differs from the [rhss form](https://github.com/JuliaSymbolics/Symbolics.jl/blob/7eac91321ccd5a68254005ba39770d629201a867/src/build_function.jl#L248-L259)...
Here is an example: ```julia julia> using Symbolics julia> @variables x 1-element Vector{Num}: x julia> (x+π)^2 |> expand ERROR: MethodError: no method matching Int64(::Irrational{:π}) Closest candidates are: (::Type{T})(::T) where T
```jl julia> @variables a, b, c, d (a, b, c, d) julia> A = [a b; c d] 2×2 Matrix{Num}: a b c d julia> inv(A) 2×2 Matrix{Num}: (a^-1)*(true +...
* [ ] Polynomials * [ ] Factorization * [ ] Square-free decomposition * [x] Grobner bases * [ ] Partial fraction decomposition * [ ] Resultants * [x] Rootfinding...
```julia using Symbolics @variables x Dx = Differential(x) eq = sin(x) ~ x expr = Dx(eq) expand_derivatives(expr) ``` returns `0` `expand_derivatives` calls `occursin_info` https://github.com/JuliaSymbolics/Symbolics.jl/blob/da72404e92ad6894697f741747bfd828ff9df516/src/diff.jl#L163-L172 When `expr` is an `Equation`, `istree(expr)`...