Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 29 10:28

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Added expand to log rewrites (compare)

  • Jun 29 09:23

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    updated test for asin,atan,acot… (compare)

  • Jun 27 12:01

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    removed wrong test (compare)

  • Jun 27 11:21

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Modified test (compare)

  • Jun 26 00:22

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Fixed leading term for acos/ase… (compare)

  • Jun 25 09:43

    anutosh491 on series_for_arg

    Updated code (compare)

  • Jun 24 13:33

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Improved code quality (compare)

  • Jun 22 14:25

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Fixed code quality (compare)

  • Jun 22 14:17

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Added test for 21721 (compare)

  • Jun 22 10:02

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Fixed Failing tests (compare)

  • Jun 20 13:32

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Code Cleanup (compare)

  • Jun 18 02:50

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Fixed error in test_sums_produc… (compare)

  • Jun 17 14:28

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    Fixed all failing tests (compare)

  • Jun 17 13:41

    anutosh491 on GSOC_Pr1_Refactoring_Log_leading_term_method

    prevent unnecessary hashing add type hints to printing/late… Merge pull request #23588 from … and 34 more (compare)

  • Jun 10 13:16
    anutosh491 commented #22373
  • Jun 10 13:15
    anutosh491 commented #22373
  • Jun 10 12:42
    anutosh491 commented #22806
  • Jun 10 12:39
    anutosh491 commented #22806
  • Jun 10 12:21
    github-actions[bot] commented #23614
  • Jun 10 12:15
    github-actions[bot] commented #23541
anonbox.netuser
@anonbox.netuser:matrix.org
[m]
Hi, is sympy 1.9 officially released? I saw it is tagged on github, but the usual files for downloading are missing and pypi also only lists 1.9cr1 as latest version. The sympy.org website is also not helpful in this regard, showing the release of 1.7.1 as latest news.
Anutosh Bhat
@anutosh491
Hi guys , I was solving an issue regarding functions/limits and I came across something which might help . So do we have any method /function in sympy that checks whether some function/expression might encapsulate or bound another expression . Like is there any way I could check something like -1/x < cos(x)/x < 1/x or even one sided
ThanhVu (Vu) Nguyen
@nguyenthanhvuh
Hi, it seems that the .subs function is quite slow. When I have a long expression e (can contain nonlinear terms like x**2, y*x*z), calling e.subs(some_dict) takes quite sometime (a sec or so). In fact subs is often slower than solving for large equations. Am I using subs correctly?
빈백에 박제가 되어버린 로듐을 아시오?
@45Rh_science_twitter
image.png
hi guys i'm new with sympy, so can anyone help me with solving this problem?
I was trying it on my own, but i can't get a grip on how to solve this Error
image.png
import sympy as sp
from sympy import exp, oo

sp.init_printing()

x = sp.Symbol("x")
a, m, h = sp.symbols("a, m, h", positive = True)
A = sp.Symbol("A")

f = exp(-2 * a * m * x**2 / h)
int_f = sp.integrate(f, (x, 0, oo))

eq1 = 2 * (abs(A))**2 * (int_f) - 1

print(sp.solve(eq1, A))
ThePauliPrinciple
@ThePauliPrinciple
A = sp.Symbol("A",real=True) seems to give a solution (although I have not verified it is the correct solution)
빈백에 박제가 되어버린 로듐을 아시오?
@45Rh_science_twitter
I'll give it a try thanks!
wow it works thank u!!!!
Henry smith
@Henrysm41987301_twitter
Hello all. Henry here , I'm using sympy for the first time for one of my course project reports at my University. The course is based on series and summations overall and while trying to get familiar I realized that Sum((-1)**(x+1) + (-1)**(x+2) , (x, 1, oo)).is_convergent() is not returning the expected result and raises a TypeError saying Invalid NaN comparison , is this a meaningful error or Am I missing something useful ?Maybe I could raise an issue ?
anonbox.netuser
@anonbox.netuser:matrix.org
[m]
Try: sym.simplify(sym.Sum((-1)**(x+1)+(-1)**(x+2),(x,1,sym.oo)))
So basically try to simplify the expression, may yield some more insight also in other cases.
Anutosh Bhat
@anutosh491
@Henrysm41987301_twitter hey Thanks for pointing this out . No need to raise an issue ,there is a fix for similar errors in sympy/sympy#22200 which is currently being reviewed by @oscargus and others .Maybe after that is fixed you could use this expression!
Henry smith
@Henrysm41987301_twitter
Thanks for the suggestions
ThePauliPrinciple
@ThePauliPrinciple
tests finished: 9644 passed, 436 skipped, 355 expected to fail, 4 expected to fail but passed, in 2343.62 seconds <- this means there is nothing wrong correct?
1 reply
ThePauliPrinciple
@ThePauliPrinciple
What is the logic in sympy for when to import at the top of a module or inside the code?
Kalevi Suominen
@jksuom
@ThePauliPrinciple Imports should preferably be at the top of a module but sometimes they lead to circular imports and then those must be put in a function or method in order to delay the import.
ThePauliPrinciple
@ThePauliPrinciple
That makes sense, thanks!
ThePauliPrinciple
@ThePauliPrinciple
Ah, I had no choice in the first place, I was doing a circular import anyways
Steven Lee
@stevenleeS0ht
What is the latest progress of migrating sympy-live from python 2 to python 3?
ThePauliPrinciple
@ThePauliPrinciple
I notice a lot of old issues and pull requests, is there any procedure for getting them closed? E.g. by replying with a comment showing that it is no longer an issue/something similar has already been merged into sympy?
1 reply
ThePauliPrinciple
@ThePauliPrinciple
When we create an undefined function using Function(name), it is possible to add attributes to it using kwargs, e.g. F=Function('F', foo=bar), which will expose F.foo, as well as consider it a different function if foo is not the same. I'm looking for similar behaviour when subclassing Function, is there a way to do so?
ThePauliPrinciple
@ThePauliPrinciple
in particular I want foo to not be in F.args
Rohit Nagar
@nagar2817
Heyy!!! I am a newbie to the open-source, I need to Contribute to your project. How can I contribute to your organization?? Need help!!
1 reply
Anutosh Bhat
@anutosh491
Guys , how can I use simplify() without changing factorial to a gamma function . I want to simplify it without affecting the factorial
ThePauliPrinciple
@ThePauliPrinciple
I don't think it is the best solution, but I find that substituting what I want untouched with a Symbol, then simplifying and then substituting back to often help in those cases
It might help if you create the symbol with the same assumptions as whatever you are substituting
lesshaste
@lesshaste
How do you solve simultaneous diophantine equations in sympy? For example 5x+6y+8z==1 and 6x-11y + 7z ==9
lesshaste
@lesshaste
it looks like you need to do https://stackoverflow.com/a/65438529/2287805
it would be great if this was all inside diophantine
Megan Ly
@meganly

Last year expansion was causing slowdowns in the .equals method. In sympy/sympy#19673 we had

In [10]: e1 = 100*(x**3 + 1)**99                                                                                                               

In [11]: e2 = 300*x**2*(x**3 + 1)**99                                                                                                          

In [12]: %time e1.equals(e2)                                                                                                                   
CPU times: user 1.13 s, sys: 9.37 ms, total: 1.14 s
Wall time: 1.15 s
Out[12]: False

It seems like the .equals method has gotten faster. Anyone know what's changed?

Yashvardhan Prasad
@yasphy
Which easy to fix issues can I resolve now and how do I see if they are still open to be solved or not?
2 replies
lesshaste
@lesshaste
@yasphy There are quite a lot of things. It might depend how easy you want it to be
Yashvardhan Prasad
@yasphy
Any example to elaborate??
lesshaste
@lesshaste
@yasphy for example systems of linear diophantine equations.
they have code but it just isn't reviewed and merged
Yashvardhan Prasad
@yasphy
Ok..thanks for the response
Anutosh Bhat
@anutosh491
Hello guys , I wanted to know whether there is a way that I could expand (1+x)**n as a binomial expansion , not sure I could find one . I ask this because I'm working on an issue which involves something like (1+x)**n- x**n, now the issue works perfectly when we use numbers like (1+x)**3 - x**3 and we could solve this through gammasimp() giving 3*x**2 + 3*x + 1 but symbolically not sure how we could approach it . Maybe if we could expand the (1+x)**n as a binomial expansion and cancel out the first term which would always be x**n then the maybe the issue wouldn't be that tough to solve . Currently gammasimp() isn't of much help ! and returns back the same expression !
Kalevi Suominen
@jksuom
@anutosh491 Can you use the explicit binomial expansion? Something like Sum(binomial(n, k)*x**k, (k, 0, n)) for (1 + x)**n.
Anutosh Bhat
@anutosh491
Yeah @jksuom that works , would surely go for that ! Just wanted to confirm whether we had some method to deal with this . The issue I'm trying to tackle is this
>>> k, n  = symbols('k, n', positive=True, integer=True)                                                                                                                              >>> from sympy import oo
>>> limit((n+1)**k/((n+1)**(k+1) - (n)**(k+1)), n, oo)
oo
>>> limit((n+1)**2/((n+1)**(3) - (n)**(3)), n, oo)
1/3
>>> limit((n+1)**2/((n+1)**(3) - (n)**(3)).gammasimp(), n, oo)
1/3
>>> limit((n+1)**k/((n+1)**(k+1) - (n)**(k+1)).gammasimp(), n, oo)
0
This is somewhat required to solve a somewhat bigger issue i'm trying to approach !
Anutosh Bhat
@anutosh491
works fine numerically but symbolically should return 1/k+1 , also there is somewhat involvement of gammasimp() there, so have to get that case correctly too ! Never thought a gammasimp() would alter limits from oo to 0 but it does .Maybe if I find it too buggy and some more places where it the (n+1)**k - n**k combo goes wrong , i'll raise this !
Anutosh Bhat
@anutosh491
 >>> limit((n+1)**k/(n*(-n**k + (n + 1)**k) + (n + 1)**k), n, oo)
1/(k + 1)
Apparently this arrangement of (n+1)**k -(n)**k gives the correct answer . I am not sure why this may be happening but obviously it feels a bit strange if different arrangements of the same expression can lead to different answers! The gammasimp of that expression which returns 0 is (-n*n**k + n*(n + 1)**k + (n + 1)**k)
falematte
@falematte
Hello guys, I have an expression that I am expanding using "series" with respect to the expression epsilon. I would like to tell sympy that some expressions must be considered of order epsilon instead of order 0. Is this possible? How to do this?
Héctor Rodríguez
@Hector_rodi_19_twitter
Does anyone have the algorithm to resolve first degree equations?