Gloo13 Sympy - BW
Gloo13 Sympy - BW
expr.subs‐ substitute x with 2 etc. Matrix([1, matrix constructor(mutable M.eige returns a list of tuples of the form
([(x, 2), (y, 2, 3]) matrix) nve‐ (eigenvalue, algebraic_multipli‐
4), (z, 0)]) shape(‐ shape of matrix cts() city, [eigenvectors])
sympify(s‐ convert strings into SymPy expr) M.diag returns a tuple (P, D), where D is
tr_expr) expressions M.row(0) get the first row ona‐ diagonal and M = P DP **−1
expr.eval‐ evaluate a numerical lize()
M.col(-1) get the last column
f(15, expression into a floating M.char return the characteristic
M.col_‐ delete first column
chop=True) point number poly(l‐ polynomial
del(0)
lambdify(x, converts the SymPy names amda)
M.row_‐ delete second row
expr, to the names of the given
del(1)
”numpy”) numerical library Trigonometric Simplification
M.row_ins‐ insert a row
init_prin‐ This will automatically enable trigsimp(‐ simplify expressions using
ert(1,
ting() the best printer available in expr) trigonometric identities
Matrix([[0,
your environment. expand‐ expand trigonometric functions
4]]))
simplify(‐ simplify mathematical _trig(expr)
M.col_ins‐ insert a column
expr) expressions
ert(0,
Powers
expand‐ expand polynomial expres‐ Matrix([1, -
(expr) sions 2])) powsimp(expr) use power
factor(expr) takes a polynomial and identities
M**-1 inverse of M
factors it into irreducible expand_power_exp(x**(a x**a * x**b
M.T transpose of M
factors over the rational + b))
eye(n) create a nxn identity matrix
numbers expand_power_ba‐ x**a * y**a
zeros(n,m) creates a nxm matrix of
factor_list(‐ returns a list with the factors. se((xy)*a)
zeroes
expr) More structured. powdenest((xa)b)powd‐ x**(a*b)
ones(n,m) creates a nxm matrix of ones
collec‐ collects common powers of a enest((xa)b)
t(expr, x) term in an expression diag(expr) creates a matrix with expr in
the diagonal Exponentials and logarithms
cancel‐ take any rational function and
(expr) put it into the standard M.det() computes the determinant of expand_log(expr)
canonical form M
logcombine(expr)
apart(expr) performs a partial fraction M.rref() put a matrix into reduced row
decomposition on a rational echelon form Special Functions
function M.null‐ returns a list of column
factorial(n) return the factorial of n
space() vectors that span the
binomial(n, k) return the binomial coeffi‐
nullspace of the matrix
cient of n and k
M.columns‐ returns a list of column
gamma(z) return the gamma function
pace() vectors that span the column‐
space of the matrix expr.rewrite‐ rewrite expr in terms of
(function) function
M.eige‐ eigenvals returns a dictionary
nvals() of eigenvalue: algebraic_mu‐ expand_fu‐ expand special functions
ltiplicity pairs nc(expr)
Calculus