A computer algebra system written in pure Python http://sympy.org/ . To get started to with contributing https://github.com/sympy/sympy/wiki/Introduction-to-contributing
Lambda_0*((-r + x/M)*exp((-(-r + x/M)**2 - y**2/M**2)/(2*\sigma_g**2)) - (r + x/M)*exp((-(r + x/M)**2 - y**2/M**2)/(2*\sigma_g**2)))**2/(2*pi*M**2*\sigma_g**6*(exp((-(-r*sin(2*pi/m) + y/M)**2 - (-r*cos(2*pi/m) + x/M)**2)/(2*\sigma_g**2)) + exp((-(-r*sin(4*pi/m) + y/M)**2 - (-r*cos(4*pi/m) + x/M)**2)/(2*\sigma_g**2))))
and
16*Lambda_0*(-M*x_0_tau + x)**2*(M*lambda*besselj(1, 2*pi*n_a*sqrt(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)/(M*lambda)) - pi*n_a*sqrt(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)*besselj(0, 2*pi*n_a*sqrt(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)/(M*lambda)))**2/(pi*lambda**2*(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)**3)
Trying to integrate either of these across infinity in x
sympy.Integral(integrand,(x,-sympy.oo,sympy.oo)).doit()
StackTraces respective:
https://pastebin.com/FTafTjF9
https://pastebin.com/u9NTQPib
Neither converges " @evatiwari
4529255040439033800342855653030016000000000
++
Hello all, I was adding a test case for an issue where I encountered assertion error, I do not have much idea about it. Can someone guide me how it can be resolved?
Traceback (most recent call last):
File "/home/shardul/sympy/sympy/series/tests/test_series.py", line 208, in test_issue_9173
assert Q.series(y, n=3) == b_2y**2 + b_1y + b_0 + O(y**3)
AssertionError
>>> from sympy import *
>>> from sympy.abc import y
>>> var('p_0 p_1 p_2 p_3 b_0 b_1 b_2')
(p_0, p_1, p_2, p_3, b_0, b_1, b_2)
>>> Q = (p_0 + (p_1 + (p_2 + p_3/y)/y)/y)/(1 + ((p_3/(b_0*y) + (b_0*p_2 - b_1*p_3)/b_0**2)/y + (b_0**2*p_1 - b_0*b_1*p_2 - p_3*(b_0*b_2 - b_1**2))/b_0**3)/y)
>>> Q.series(y, n=3)
y*(b_0*p_2/p_3 + b_0*(-p_2/p_3 + b_1/b_0)) + y**2*(b_0*p_1/p_3 + b_0*p_2*(-p_2/p_3 + b_1/b_0)/p_3 + b_0*(-p_1/p_3 + (p_2/p_3 - b_1/b_0)**2 + b_1*p_2/(b_0*p_3) + b_2/b_0 - b_1**2/b_0**2)) + b_0 + O(y**3)
>>> simplify(y*(b_0*p_2/p_3 + b_0*(-p_2/p_3 + b_1/b_0)) + y**2*(b_0*p_1/p_3 + b_0*p_2*(-p_2/p_3 + b_1/b_0)/p_3 + b_0*(-p_1/p_3 + (p_2/p_3 - b_1/b_0)**2 + b_1*p_2/(b_0*p_3) + b_2/b_0 - b_1**2/b_0**2)) + b_0 + O(y**3))
b_2*y**2 + b_1*y + b_0 + O(y**3)
RecursionError
(for specifics, sympy/sympy#9449 )? Any hints you can give would be great as I'm seeing this part of the codebase for the first time. Should I focus on the statements before the recursion happens or during (I have tried printing values during both but still wasn't able to figure anything out)?
parse_expr()
with a bit of transformation logic to ensure the expressions are well-formatted in ways SymPy expects. I am stumped by one thing, though. Some of my expressions contain functions are logical (boolean) , so I get expressions like f(x) & g(y)
. But the default transformations turn these into Functions, which aren't considered Boolean
s, and thus cause TypeError
s when used as arguments to BooleanFunction
s like And()
or Not()
.Function
-like symbol that counts as a Boolean type for these purposes? Is there some better way to achieve this?prem
and pquo
to make the numerator order lower than the denominator order. However, the result I get makes no sense, when I subtract (quotient + remainder/denominator) from the original fraction, the answer is not zero as it should be. I've tested on a simple case of (2x + 1)/(x + 1) and the answer was fine there.