## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Aug 09 10:29

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

minor changes (compare)

• Aug 09 05:13

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Fixed failing test (compare)

• Aug 09 01:30

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Fixed code quality failure (compare)

• Aug 05 12:45

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

included exp forms for bessel f… (compare)

• Aug 05 12:05

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Minor change (compare)

• Aug 05 11:59

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

• Aug 01 03:22

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Added e.is_negative case for be… (compare)

• Aug 01 02:43

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

hanled e.is_negative case for b… (compare)

• Aug 01 02:03

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Replacing exp rewrite with trig… (compare)

• Jul 31 11:41

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Minor changes (compare)

• Jul 31 11:30

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

added support when exponent of … (compare)

• Jul 31 11:00

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Fixed leading term method for b… (compare)

• Jul 28 04:15

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

• Jul 28 03:19

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Added tests for series of besse… (compare)

• Jul 28 02:51

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Added series test for besseli f… (compare)

• Jul 28 02:38

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

• Jul 28 02:25

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Added nseries method for bessel… (compare)

• Jul 27 18:26

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Fixed failing tests (compare)

• Jul 27 14:49

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

Added and fixed some tests (compare)

• Jul 27 14:20

anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

implemented leading term and ns… (compare)

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!!
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?

@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
@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
@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
Does anyone have the algorithm to resolve first degree equations?
Anutosh Bhat
@anutosh491
Hey guys , I am approaching an issue from the series/concrete module which requires a really small contribution of the solverset module which I haven't explored much yet . Hence I wanted to confirm what whether there is any way to solve something like x = sin(x) or x = log(x) ,x = e**x . First one should return 0 in the Real domain and the other 2 should return an empty set . solveset() method returns something like ConditionSet(x, Eq(x - sin(x), 0), Complexes), ConditionSet(x, Eq(x - exp(x), 0), Complexes) which is not wrong but not what I would like and solvify returns Not implemented for these !
ThePauliPrinciple
@ThePauliPrinciple
What assumptions do you have for x?
Hi all... something I can't find in docs: if I get a conditional expression returned, how to I select the expression for the case that applies for my variables?
I only want the "otherwise" result
Andreas Schuldei
@stockh0lm
hi, are user questions ok here?
Judging from scrollback, they are. :-)

I need to create a vector function in sympy with actual vectors, that can be transformed between coordinate systems.

I saw this https://stackoverflow.com/questions/46993819/how-to-create-a-vector-function-in-sympy which uses Matrix() as a workaround.

I need to transform my input and output vector from one coordinate system to another (and back). How are vector functions done in that case?

def B_el(r_vec):

r1 = r_vec.i

r2 = r_vec.j
u = sin(r1)+cos(r2)
v = -cos(r1)+sin(r2)
return Matrix([u, v, 0])
Andreas Schuldei
@stockh0lm
formatting broken?
ThePauliPrinciple
@ThePauliPrinciple
Depending on what you "vector" is, it will transform differently under a coordinate transform
e.g. a velocity and a coordinate transform completely differently with a non-linear coordinate transformation
And in the case of a velocity, you could have it transform covariantly or contravariantly
Andreas Schuldei
@stockh0lm
the input vector is a radius, so distance and direction. the output vector is a magnetic field vector.
so it is just the geometic transformation. split up the three spatial components differently, maintain the size
part of the task is to identify the coordinate transformation - the rotation angels and location vector. But that comes later, after having figured out how to write a vector function :-)
Andreas Schuldei
@stockh0lm
I still am unclear as to how to return a vector
def B_el(r_vec):

r1 = r_vec.i

r2 = r_vec.j
u = sin(r1)+cos(r2)
v = -cos(r1)+sin(r2)
return Matrix([u, v, 0])
What would i need to change in order to return a vector, which can be transformed into a different (also resting) coordinate system, differing in axis rotations and a location shift?
ellydo17
@ellydo17
Hello, I am a new member to SymPy. I look forward to contributing to SymPy as a developer. Do we have different channels for SymPy users and developers?
Andreas Schuldei
@stockh0lm
Traceback (most recent call last):
File "C:/Users/Andreas Schuldei/PycharmProjects/lissajous-achse/hgü-kabel-detektion-symbolic.py", line 109, in <module>
result = solve(equations, (CM0, theta_i, theta_j, theta_k, i, a, B_earth))
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\solvers\solvers.py", line 1096, in solve
solution = _solve_system(f, symbols, **flags)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\solvers\solvers.py", line 1730, in _solve_system
i, d = _invert(g, *symbols)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\solvers\solvers.py", line 3118, in _invert
rhs -= indep
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\numbers.py", line 2194, in __sub__
return Rational.__sub__(self, other)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\decorators.py", line 89, in __sympifyit_wrapper
return func(a, b)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\numbers.py", line 1725, in __sub__
return Number.__sub__(self, other)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\decorators.py", line 89, in __sympifyit_wrapper
return func(a, b)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\numbers.py", line 733, in __sub__
return AtomicExpr.__sub__(self, other)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\decorators.py", line 251, in _func
return func(self, other)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\decorators.py", line 126, in binary_op_wrapper
return f(self)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\core\decorators.py", line 127, in binary_op_wrapper
return func(self, other)
File "C:\Users\Andreas Schuldei\PycharmProjects\lissajous-achse\venv\lib\site-packages\sympy\vector\basisdependent.py", line 352, in __rsub__
raise TypeError("Invalid argument types for subtraction")
TypeError: Invalid argument types for subtraction
How can I inspect the individual equations in the list equations to narrow this down? The equations are relatively long, and I have no clue how to find this.
Sean Logan
@fountain23
Hello, I have discovered a bug with sympy.vector.divergence() when used in cylindrical coordinates
divergence( R rhat) gives 2, the correct answer. But divergence( 1 rhat) gives 0. Wrong! The correct answer is 1/R
N = CoordSys3D('N', transformation='cylindrical', vector_names=("r", "phi", "z"), variable_names=("R", "PHI", "Z"))
R = N.R
rhat = N.r