Changing the arguments when substituting a function
After a page of sympy manipulations I get and expression involving LambertW, but the answer given is for the zeroth branch cut. I can tell that I wanted the -1 branch. So, I’d like to change every occurrence of LambertW(y)
into LambertW(y, -1).real
, where y is an arbitrary sympy expression (that is different in each instance), in a set of expressions that are large enough so that doing it by hand is error prone.
Integral that Sympy cannot solve but Wolfram Alpha can
I am using the following code, which returns the integral itself and not its result:
Changing variables in sympy
According to the documentation one can make substitutions as:
Numerical method used by sympy nsolve
How does sympy
‘s nsolve
do what it does?
sympy matrix scientific notation
I’m trying to display a sympy matrix in scientific notation, and it is only working for values less than 1. I can’t understand why applyfunc
is behaving differently. Is there a better way to do this?
sympy matrix scientific notation
I’m trying to display a sympy matrix in scientific notation, and it is only working for values less than 1. I can’t understand why applyfunc
is behaving differently. Is there a better way to do this?
Define an unused new symbol inside function scope
I find difficult to really encapsulate a lot of logic in a reusable manner when writing sympy
code
Define an unused new symbol inside function scope
I find difficult to really encapsulate a lot of logic in a reusable manner when writing sympy
code
SymPy and dictionary variables
I need to use for SymPy operations a number of variables that depend on other parameters in the code. As I understand, a dictionary is used normally when the number of variables is not known in advance. However, SymPy does not allow to declare dictionary variables (say, d[1][1]) symbols and use them in symbolic operations like deriving expressions with respect to them.
What would be a proper solution for this situation?
SymPy and dictionary variables
I need to use for SymPy operations a number of variables that depend on other parameters in the code. As I understand, a dictionary is used normally when the number of variables is not known in advance. However, SymPy does not allow to declare dictionary variables (say, d[1][1]) symbols and use them in symbolic operations like deriving expressions with respect to them.
What would be a proper solution for this situation?