Skip to content
New issue

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

symbolic_solve docstring update (using Nemo and using Groebner) #1249

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/solver/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ Currently, `symbolic_solve` supports
## Examples

### `solve_univar` (uses factoring and analytic solutions up to degree 4)
!!! note
The package `Nemo` is needed in order to use `solve_univar` as well as `solve_multipoly`,
so executing `using Nemo` as you will see in the following examples is necessary; otherwise,
the function will throw an error.
```jldoctest
julia> using Symbolics, Nemo;

julia> @variables x a b;

julia> expr = expand((x + b)*(x^2 + 2x + 1)*(x^2 - a))
Expand Down Expand Up @@ -63,6 +69,8 @@ julia> symbolic_solve(x^7 - 1, x)
1
```
### `solve_multivar` (uses Groebner basis and `solve_univar` to find roots)
!!! note
Similar to `solve_univar`, `Groebner` is needed for `solve_multivar` or to be fully functional.
```jldoctest
julia> using Groebner

Expand All @@ -85,7 +93,19 @@ julia> symbolic_solve(eqs, [x,y,z])
Dict{Num, Any}(z => -1, y => 1, x => 0)
```

!!! note
If `Nemo` or `Groebner` are not imported when needed, the solver throws an error.
```jldoctest
julia> using Symbolics

julia> @variables x y z;

julia> symbolic_solve(x+1, x)
ERROR: "Nemo is required. Execute `using Nemo` to enable this functionality."

julia> symbolic_solve([x+1, y], [x, y])
ERROR: "Groebner bases engine is required. Execute `using Groebner` to enable this functionality."
```
### `solve_multipoly` (uses GCD between the input polys)
```jldoctest
julia> symbolic_solve([x-1, x^3 - 1, x^2 - 1, (x-1)^20], x)
Expand Down
Loading