forked from sympy/sympy-paper
/
solvers.tex
33 lines (29 loc) · 1.67 KB
/
solvers.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
SymPy has a module of equation solvers that can handle ordinary differential
equations, recurrence relationships, Diophantine equations, and algebraic
equations. There is also
rudimentary support for simple partial differential equations.
There are two functions for solving algebraic equations in SymPy:
\texttt{solve} and \texttt{solveset}.
\texttt{solveset} has several design changes with respect to the older
\texttt{solve} function. This distinction is present in order to resolve the
usability issues with the
previous \texttt{solve} function API while maintaining backward compatibility
with earlier versions of SymPy.
\texttt{solveset} only requires essential input information from the user.
The function signatures of \texttt{solve} and \texttt{solveset} are
\begin{verbatim}
solve(f, *symbols, **flags)
solveset(f, symbol, domain=S.Complexes)
\end{verbatim}
The \texttt{domain} parameter is typically either \texttt{S.Complexes} (the
default) or \texttt{S.Reals}; the latter causes \texttt{solveset} to only return real solutions.
An important difference between the two functions is that the output API of \texttt{solve}
varies with input (sometimes returning a Python list and sometimes a Python dictionary) whereas
\texttt{solveset} always returns
a SymPy set object.
Both functions implicitly assume that expressions are equal to 0. For
instance, \texttt{solveset(x - 1, x)} solves $x - 1 = 0$ for $x$.
\texttt{solveset} is under active development as a planned replacement for
\texttt{solve}. There are certain features which are implemented in
\texttt{solve} that are not yet implemented in \texttt{solveset}. Notably,
these include nonlinear multivariate system and transcendental equations.