Score of 1
1 answer
55 views
sympy evalf fails when chop=True
Sympy version 1.14 Reproduce error from sympy import ( Rational, floor, log, ) from sympy.abc import x exprtest = floor(log(x, 2)) result = exprtest.evalf(chop=True,...
- reputation score 1728
Score of 0
1 answer
131 views
sympy only partially simplifies equation
README I have written a Jupyter Notebook to check if an identity is true: for example $\tan{x}=\frac{\sin{x}}{\cos{x}}$ (which is converted to Eq(sin(x)**2, (1 - cos(x))/2)) returns True whilst for ...
- reputation score 479
Score of 1
1 answer
94 views
Make sympy use ≠ when equality is False
I have written a Jupyter Notebook (Q29175.ipynb) with the following contents: $\frac{d}{d x}\cos^{3}{x}=-3\cdot (\cos^{2}{x})\cdot(\sin{x})$ import json from sympy import * from latex2sympy2_extended ...
- reputation score 479
Score of 3
0 answers
229 views
Higher order derivatives (20+) with SymPy give wrong results
(If it rings a bell but not really necessary to understand my question: I'm trying to look at high order dispersion in a medium using Sellmeier equations for the refractive index.) I have two ...
- reputation score 193
Score of 2
2 answers
108 views
Substituting values for variables in an expression does not give the expected result
I have this little piece of Sympy code import sympy as s L1, L2, x = s.symbols('L1, L2, x', real=True, positive=True) P, q = s.symbols('P, q') m, kN = s.symbols('m, kN', real=True, positive=True) E, J ...
- reputation score 25538
Score of 1
1 answer
127 views
How to replace non-commutative products in SymPy with expressions?
I want to work around sympy's limitation of assuming partially commutative behavior. If I define the non-commutative symbols import sympy as sy u = sy.Symbol('u',commutative=False) v = sy.Symbol('v',...
- reputation score 45950
Score of 3
1 answer
186 views
Infinite sum involving a parameter
How do I persuade SymPy to evaluate an infinite sum which converges and I know SymPy should be able to do? For example, the following just gives back the unevaluated infinite sum: a = Symbol('a',real=...
- reputation score 41
Score of 2
2 answers
239 views
How can I programmatically derive Taylor series?
So I know from physics that position at a given time can be calculated using its derivatives like this: Now I know this looks awfully similar to Taylor series: In fact they are exactly the same. ...
- reputation score 4191
Score of 8
2 answers
224 views
Display problem using UnevaluatedExpr in Sympy with python
When I add another expression to Unevaluated(), then try to print it, the unevaluated output is surrounded by (). The problem comes when the first coefficient in the resulting expression to be ...
- reputation score 608
Score of 1
2 answers
135 views
How to check if variable is infinite in sympy
Sympy has (at least?) three types of infinity (infinity, negative infinity, and complex infinity). I have come across the problem of testing if a sympy expression is infinite and my program failed ...
- reputation score 11
Score of 2
1 answer
120 views
parse_latex() incorrectly parsing Latex to Sympy
I'm trying to make a simple program that compares two Latex inputs and checks whether it's the same regarding math and notation. First, I wanted to check which mathematic expressions work without any ...
- reputation score 83
Score of 1
1 answer
65 views
Getting an TypeError when trying to use parse_latex() [closed]
I'm currently working on a project which needs to convert Latex strings into SymPy code. I am very new to SymPy. I've encountered a problem which I can't find the answer for myself: from sympy.parsing....
- reputation score 83