Re: [sympy] Future of SymPy part 2: polynomials

2023-09-10 Thread David Bailey
On 07/09/2023 00:07, Oscar Benjamin wrote: Hi all, I have a new blog post following the last one: https://oscarbenjamin.github.io/blog/czi/post2.html This one discusses SymPy's polynomial system, improvements that can be made and in particular how to make use of python-flint to speed up

Re: [sympy] Blog post about the the future of SymPy

2023-08-21 Thread David Bailey
On 21/08/2023 21:01, Aaron Meurer wrote: Thanks Aaron for your amazingly fast response! The main reason Oscar benchmarked matrices is that that's the part of SymPy that he's focused on making faster so far. Actually, matrices are more important than you'd think. They end up being used

Re: [sympy] Blog post about the the future of SymPy

2023-08-21 Thread David Bailey
Oscar, Thanks for your very detailed reply. However, I do wonder if inversions of integer matrices of increasing size is the best test of the speed of SymPy vs another product. Maybe some messy algebra is better. For example: series(cos(k*x/(1-k*(1-k*x**2)/(1-x))),x,0,n) Where n is

Re: [sympy] Blog post about the the future of SymPy

2023-08-19 Thread David Bailey
On 16/08/2023 16:13, Oscar Benjamin wrote: Hi all, I have written a blog post about recent work on SymPy and what I think should be future development plans: https://oscarbenjamin.github.io/blog/czi/post1.html This is the first in a series of posts and in this one I describe what I think are

Re: [sympy] We should rename 'master' to 'main'

2023-07-22 Thread David Bailey
On 18/07/2023 04:25, Sangyub Lee wrote: I think that github decided to do that in 2020. And the main reason to do this is that 'master' is agreed to be politically offensive terminology: Rename offensive terminology (master) - Simon Pieters (kernel.org)

Re: [sympy] Easy way to use S()

2023-07-08 Thread David Bailey
On 07/07/2023 23:23, gu...@uwosh.edu wrote: David, I will work to get this into Algebra_with_Sympy quickly. I will post when I complete the next release. Since these ease of use issues are not cleanly addressable within SymPy proper, maybe you can think of Algebra_with_SymPy as your

Re: [sympy] Easy way to use S()

2023-07-07 Thread David Bailey
On 07/07/2023 10:09, Isuru Fernando wrote: Hi David, You could write a simple converter to convert all ints to sympy Integers if you are writing the code inside a function. See code below. Isuru Thanks, I can solve this problem to my satisfaction, but my main concern, as a pointed out to

Re: [sympy] Easy way to use S()

2023-07-06 Thread David Bailey
On 05/07/2023 21:40, Aaron Meurer wrote: For interactive use, just passing a string to S() (or equivalently sympify() or parse_expr()) is the simplest way to deal with this. However, I would avoid this for non-interactive usage (i.e., any code that gets saved to be executed later). Putting your

Re: [sympy] Easy way to use S()

2023-07-03 Thread David Bailey
On 03/07/2023 14:44, gu...@uwosh.edu wrote: David, I want to make sure I understand the behavior you would prefer, because I think I can implement it in algebra-with-sympy . The package already does some pre-parsing, so I

Re: [sympy] Easy way to use S()

2023-07-03 Thread David Bailey
On 03/07/2023 13:24, Oscar Benjamin wrote: Another option is to call S with a string:: In [27]: s = '1 + x*(m + 1/2)/(2*m + 1) + x**2*(m + 1/2)*(m + 3/2)/(2*(2*m + 1)*(2*m + 2))' In [28]: print(S(s)) x**2*(m + 1/2)*(m + 3/2)/((2*m + 2)*(4*m + 2)) + x*(m + 1/2)/(2*m + 1) + 1 -- Oscar Thanks

Re: [sympy] Easy way to use S()

2023-07-02 Thread David Bailey
On 02/07/2023 23:44, Oscar Benjamin wrote: On Sun, 2 Jul 2023 at 23:06, David Bailey wrote: Dear Group, If I want to enter m+1/2, I define m as a symbol and write: m+S(1)/2. However if I have a complicated expression with lots of fractions, such as: 1 + x*(m + 1/2)/(2*m + 1) + x**2*(m

[sympy] Easy way to use S()

2023-07-02 Thread David Bailey
Dear Group, If I want to enter m+1/2, I define m as a symbol and write:  m+S(1)/2. However if I have a complicated expression with lots of fractions, such as: 1 + x*(m + 1/2)/(2*m + 1) + x**2*(m + 1/2)*(m + 3/2)/(2*(2*m + 1)*(2*m + 2)) it would be much neater if I could automatically wrap

Re: [sympy] Inconsistency between mathematical functions

2023-06-20 Thread David Bailey
On 20/06/2023 00:47, Aaron Meurer wrote: The automatic evalf logic in Function only calls evalf if every argument is a float. It wasn't really designed for functions like besselj where one argument is supposed to be an integer. It should probably be updated to also automatically evalf if one

[sympy] Inconsistency between mathematical functions

2023-06-19 Thread David Bailey
I wonder if anyone here can explain why some mathematical functions - e.g. sin and gamma evaluate completely if given a floating point argument, while others such as besselj(0,0.2) only evaluate completely if .evalf() is used. Is this behaviour intentional? Best Wishes, David -- You

[sympy] SymPy 1.12 released

2023-05-11 Thread David Bailey
Many thanks Oscar for this release! Since it has been some time since 1.11 (or indeed 1.12rc1) was released, I guess there were some deep and messy problems to be resolved! It installed for me and runs my code. Should we expect a more normal gap between releases now that whatever the

[sympy] Conceivable idea for ChatGPT

2023-03-27 Thread David Bailey
Dear Group, This is probably not feasible, but imagine an AI program that could take a small SymPi program together with the desired output. The goal would be devise a modification of the program so that would work. Obviously such a program could not always work, but if it could solve a

Re: [sympy] Re: Summing calls to undefined functions

2023-03-24 Thread David Bailey
On 24/03/2023 15:38, Chris Smith wrote: >>> sum(f(i) for i in range(3)) == Sum(f(i), (i,0,2)).doit() == f(0) + f(1) + f(2) True On Friday, March 24, 2023 at 3:31:32 AM UTC-5 da...@dbailey.co.uk wrote: On 24/03/2023 02:25, Chris Smith wrote: > David, please start a new thread (and try

Re: [sympy] Re: Summing calls to undefined functions

2023-03-24 Thread David Bailey
On 24/03/2023 02:25, Chris Smith wrote: David, please start a new thread (and try IndexedBase instead of Function and use [] instead of ()). Thanks, I did consider that, but I thought that undefined functions can simply participate in algebraic expressions in exactly the same way as they

[sympy] Summing calls to undefined functions

2023-03-23 Thread David Bailey
Dear Group, I tried to sum a finite set of elements, each consisting of a call to an undefined function: import sympy from sympy import * k=symbols("k") f=Function("f") print("f(k)=",f(k)) print("sum=",sum(f(k),(0,k,10))) This produced the following output: f(k)= f(k) Traceback (most

Re: [sympy] Re: Releasing SymPy 1.12

2023-03-03 Thread David Bailey
Oscar, The release of SymPy 1.12 seemed to be very close, but nothing has happened! It doesn't really matter to me, but it would be interesting to explore whatever is new. David -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe

Re: [sympy] Re: Releasing SymPy 1.12

2023-01-26 Thread David Bailey
On 26/01/2023 20:48, Oscar Benjamin wrote: Hi David, There is nothing on PyPI to install yet but if you are using pip for installation then you can install the latest development version of sympy from github like this: pip install git+https://github.com/sympy/sympy.git@master That works for

Re: [sympy] Re: Releasing SymPy 1.12

2023-01-26 Thread David Bailey
On 26/01/2023 12:56, Oscar Benjamin wrote: I've opened an issue to track releasing SymPy 1.12: https://github.com/sympy/sympy/issues/24601 I went ahead and installed what I thought would be sympy 1.12, but ended up re-installing 1.11.1 ! David -- You received this message because you are

Re: [sympy] Dataclasses for symbolic computation

2022-12-14 Thread David Bailey
On 13/12/2022 22:21, Aaron Meurer wrote: Data classes are a nice syntactic convenience, and it's useful to have them if you are using something like that so you don't have to rewrite all the boilerplate. But I've never really found the "objects representing a tree of expressions" as being the

Re: [sympy] Re: SymPy 1.11rc1 released

2022-08-12 Thread David Bailey
On 12/08/2022 11:37, Oscar Benjamin wrote: On Fri, 12 Aug 2022 at 11:15, David Bailey wrote: On 09/08/2022 23:56, Oscar Benjamin wrote: I forgot to mention that to install this release you can use: pip install --pre sympy -- Oscar Oscar, When I use this command, I get this: Requirement

Re: [sympy] Re: SymPy 1.11rc1 released

2022-08-12 Thread David Bailey
On 09/08/2022 23:56, Oscar Benjamin wrote: I forgot to mention that to install this release you can use: pip install --pre sympy -- Oscar Oscar, When I use this command, I get this: Requirement already satisfied: sympy in c:\pythonsystem\lib\site-packages (1.10) Requirement already

Re: [sympy] Convert sympy tree expression to infix math string

2022-08-07 Thread David Bailey
On 07/08/2022 09:01, Anton Makarov wrote: Hi, there! I use str function to convert sympy tree expression to infix math string. It works fine, except the case when i convert the expression in power, for example: a = Symbol('a') res = str(a**2) print(res) # a**2 Is there any way to convert sympy

Re: [sympy] New SymPy shell based on JupyterLite and Pyodide

2022-05-11 Thread David Bailey
On 10/05/2022 23:14, Aaron Meurer wrote: I think this is intentional behavior. JupyterLite is designed to work more like an interactive console like IPython rather than the notebook. You can go back to a previous command using the up arrow. It would be good if it could add buttons to do this for

Re: [sympy] New SymPy shell based on JupyterLite and Pyodide

2022-05-10 Thread David Bailey
On 10/05/2022 04:20, ivan@gmail.com wrote: Hi All, Context: Thanks to developments in the JavaScript world, we can now run Python in the browser. See the projects emscripten , Pyodide , and JupyterLite

Re: [sympy] sympy exception invalid input mod

2022-04-26 Thread David Bailey
On 25/04/2022 21:32, Thomas Ligon wrote: I'm still learning...    if exp != 0:         exp = exp.subs(j, jIn, evaluate=True).subs(i, iIn, evaluate=True).subs(m, m0, evaluate=True) and     exp = simplify(exp, evaluate=True) didn't have any effect. This one     exp = exp.doit()     print('after

Re: [sympy] Re: SymPy documentation website down

2022-04-21 Thread David Bailey
On 20/04/2022 21:23, Oscar Benjamin wrote: I don't think that's how the DMCA counter claims work. HackerRank have said that they will give SymPy $25k though and it looks as if they will follow through on that. That seems to show some good will on their part, and should make them a bit more

Re: [sympy] Respecting Tradition

2022-04-21 Thread David Bailey
On 20/04/2022 21:18, Aaron Meurer wrote: Removing the ordering is not a straightforward thing to do. There is an important detail that depends on the ordering, which is that something like x*y == y*x works because it assumes that the terms are in canonical order, so it just compares them

Re: [sympy] Re: SymPy documentation website down

2022-04-20 Thread David Bailey
On 20/04/2022 12:59, Oscar Benjamin wrote: On Wed, 20 Apr 2022 at 10:50, David Bailey wrote: On 20/04/2022 08:10, Aaron Meurer wrote: The documentation is back online now. Great news! Is it possible to say anything about the problem? I mean had some proprietary information made its way onto

Re: [sympy] Re: SymPy documentation website down

2022-04-20 Thread David Bailey
On 20/04/2022 08:10, Aaron Meurer wrote: The documentation is back online now. Great news! Is it possible to say anything about the problem? I mean had some proprietary information made its way onto the SymPy website, or was it some sort of mistake? I am sure receiving something like that

Re: [sympy] Faster symbolics

2022-04-17 Thread David Bailey
On 17/04/2022 13:00, Oscar Benjamin wrote: On Sun, 17 Apr 2022 at 11:47, David Bailey wrote: On 16/04/2022 12:18, Oscar Benjamin wrote: Yes, this does work differently in SymEngine compared to SymPy. If SymPy could be changed to work the same way then it could also be a lot faster (without

Re: [sympy] Faster symbolics

2022-04-17 Thread David Bailey
On 16/04/2022 12:18, Oscar Benjamin wrote: Yes, this does work differently in SymEngine compared to SymPy. If SymPy could be changed to work the same way then it could also be a lot faster (without needing to be rewritten in C++). SymEngine has the same overall design as SymPy but makes

Re: [sympy] Creating a built in function

2022-04-15 Thread David Bailey
Thanks again for a near instantaneous reply! On 15/04/2022 23:39, Aaron Meurer wrote: You are calling arg[0], but arg is already the argument of the function. The [0] is typically only used when you have *args to accept an arbitrary number of arguments and you want to get the first one. OK -

Re: [sympy] Creating a built in function

2022-04-15 Thread David Bailey
Thanks for such an amazingly fast and detailed reply! On 15/04/2022 21:32, Aaron Meurer wrote: Yes, you can have it separate. The location of a function in the code has no bearing on its behavior. That is good! When you run 'import bailey' then 'bailey' will be the module (because you called

[sympy] Creating a built in function

2022-04-15 Thread David Bailey
Dear Group, I would like to understand the workings of SymPy a little better, and to that end, I thought it would be instructive to create a trivial 'special function' that had some or all of the properties of the SymPy in-built functions. The following link was helpful:

Re: [sympy] Sympy gamma documentation

2022-02-15 Thread David Bailey
On 15/02/2022 20:11, Aaron Meurer wrote: SymPy itself is heavily documented. https://docs.sympy.org/latest/index.html. Most of what SymPy Gamma does is call out to SymPy. SymPy Gamma itself is not really documented. You will have to read the source code to understand how it works. Note that

[sympy] Using sympy.physics.units

2022-02-04 Thread David Bailey
Dear Group, On the face of it, attaching appropriate physical units to variables sounds an excellent idea, but if, say, you import speed_of_light from sympy.physics.units, you have to extract an expression containing the speed and the physical units:

Re: [sympy] Conditional substitution

2022-01-06 Thread David Bailey
On 06/01/2022 22:19, Oscar Benjamin wrote: On Thu, 6 Jan 2022 at 21:23, David Bailey wrote: On 06/01/2022 16:41, Oscar Benjamin wrote: You can use replace to make arbitrary conditions on substitution. There are different syntaxes so here's how you do it using wild pattern-matching: In [15

Re: [sympy] Conditional substitution

2022-01-06 Thread David Bailey
On 06/01/2022 16:41, Oscar Benjamin wrote: You can use replace to make arbitrary conditions on substitution. There are different syntaxes so here's how you do it using wild pattern-matching: In [15]: expr = (a*x**14 + b*x + c) In [16]: expr Out[16]: 14 a⋅x + b⋅x + c In [17]: w =

[sympy] Conditional substitution

2022-01-06 Thread David Bailey
Dear group, A substitution like this is easy to make with SymPy: (a*x**2+b*x+c).subs(x,y) However, how can I make a conditional substitution, such as: a) One that would replace even powers of x only. b) One which would replace even powers of x by y**(n/2) resulting in a*y**7+b*x+c? I.e. one

Re: [sympy] Error in using Sympy in newton Raphson

2021-12-04 Thread David Bailey
On 03/12/2021 19:22, Swadhin Satapathy wrote: I got the following error:   File "C:\Users\Admin\.spyder-py3\temp.py", line 22, in     a = newton(p, p_prime,-10, 0)   File "C:\Users\Admin\.spyder-py3\temp.py", line 15, in newton     delta = p(x)/p_prime(x) TypeError: 'Add' object is not

Re: [sympy] Self-introduction--Interest: Making SymPy easier for new users via documentation

2021-11-30 Thread David Bailey
Thanks for responding, On 29/11/2021 18:51, Aaron Meurer wrote: Can you clarify what you mean by "3.4.6"? This is the sort of issue I plan on addressing as part of my CZI documentation project. Yes, sorry I was referring to the section 3.4.6 Sqrt is not a Function in the PDF version of the

Re: [sympy] Self-introduction--Interest: Making SymPy easier for new users via documentation

2021-11-28 Thread David Bailey
On 27/11/2021 18:20, Jeremy Monat wrote: Hello, I'm Jeremy Monat. My primary interest in helping with SymPy development is making it easier for new users to use SymPy by improving the documentation . It is plenty powerful for the application I needed; learning how to

Re: [sympy] Re: How to narrow down "Invalid argument types for subtraction" in a system of equations?

2021-10-30 Thread David Bailey
On 30/10/2021 16:06, Alan Bromborsky wrote: ("Invalid argument types for subtraction" Wouldn't it be an idea if errors like this included the types of the relevant expressions and/or copied the expressions into location where they could be retrieved? David -- You received this message

Re: [sympy] Version 1.9 improvement, and indexing a variable

2021-10-21 Thread David Bailey
On 20/10/2021 22:51, Aaron Meurer wrote: Idx lets you specify a range of values. I think it is also handled better by the code printers. If you don't need any of those features, just using a Symbol should work fine. Aaron Meurer Thanks Aaron, That clarifies things a lot, but I think if you

Re: [sympy] Version 1.9 improvement, and indexing a variable

2021-10-20 Thread David Bailey
On 20/10/2021 12:36, Oscar Benjamin wrote: On Tue, 19 Oct 2021 at 20:55, David Bailey wrote: Dear group, First I would like to say how good it was to discover that the online SymPy documentation now supports copy/paste operations without constantly switching to SymPyLive. I think

[sympy] Version 1.9 improvement, and indexing a variable

2021-10-19 Thread David Bailey
Dear group, First I would like to say how good it was to discover that the online SymPy documentation now supports copy/paste operations without constantly switching to SymPyLive. I think this will make the documentation considerably more user friendly. My question is what construct should

Re: [sympy] SymPEP: make MatchPy a SymPy dependency

2021-10-05 Thread David Bailey
On 05/10/2021 13:06, Oscar Benjamin wrote: I agree that pattern matching is a crucial part of a CAS and should really be the core of SymPy. If I was redesigning SymPy from scratch then everything would be built on top of a pattern-matching engine and almost all of the logic from the myriad

Re: [sympy] Basic plotting problem

2021-08-07 Thread David Bailey
On 07/08/2021 11:44, Davide Sandona' wrote: Hello Davide, In order to use Qt5 you need to install the following dependency: pip install PyQt5 After that it should work fine! Davide. Thank you so much for that! I had installed that originally, but then I moved computers... It would be so

[sympy] Basic plotting problem

2021-08-07 Thread David Bailey
Dear All, Has anyone else encountered this problem - which seemed to start after I moved to SymPy 1.8? Of course, it might have resulted from an 'upgrade' of Windows itself. import sympy from sympy import symbols import matplotlib matplotlib.use("Qt5Agg") from sympy.plotting import plot

Re: [sympy] zoo

2021-06-24 Thread David Bailey
On 23/06/2021 23:15, Oscar Benjamin wrote: There are some useful things that you can do with zoo like: In [1]: 1/zoo Out[1]: 0 I suppose I might question the word 'useful' in your example! I mean oo is clearly extremely useful for limits, integrals, etc, but zoo isn't, because its phase is

Re: [sympy] zoo

2021-06-22 Thread David Bailey
20, 2021 at 2:05 PM David Bailey wrote: Dear group, I recently spent some time debugging something which was producing an expression involving k*zoo. Eventually I used help on zoo and discovered it meant complex infinity! k/0 gives k*zoo Wouldn't it be more helpful to spell this out as k*Compl

[sympy] zoo

2021-06-20 Thread David Bailey
Dear group, I recently spent some time debugging something which was producing an expression involving k*zoo. Eventually I used help on zoo and discovered it meant complex infinity! k/0 gives k*zoo Wouldn't it be more helpful to spell this out as k*ComplexInfinity? Maybe oo could be

Re: [sympy] Re: Where can I find code, that evaluates add and multiplication operations?

2021-06-05 Thread David Bailey
On 05/06/2021 17:09, Chris Smith wrote: Try follow from `Numbers.__add__` Since Python can handle arbitrary precision numbers, doesn't the final evaluation happen in Python? I have always assumed that to be the case.  E.g. 3*4*x*x is converted into 12*x*x by Python (where x is an instance of

Re: [sympy] Python integer divisions should be fractions

2021-05-16 Thread David Bailey
On 16/05/2021 05:42, Aaron Meurer wrote: On Sat, May 15, 2021 at 3:02 PM David Bailey wrote: On 14/05/2021 23:01, Oscar Benjamin wrote: That's a great video but it's describing something very different. There he types exact input into the calculator and then calculator somehow makes

Re: [sympy] Python integer divisions should be fractions

2021-05-15 Thread David Bailey
On 14/05/2021 23:01, Oscar Benjamin wrote: That's a great video but it's describing something very different. There he types exact input into the calculator and then calculator somehow makes a numeric/symbolic approximation that goes wrong. I'm not talking about changing anything for exact

Re: [sympy] Introducing Equation module

2021-05-10 Thread David Bailey
On 09/05/2021 23:52, gu...@uwosh.edu wrote: David, I do not think you are being naive. The choice of representation is to keep things as close to standard mathematics as possible. However, your suggestions are approaches taken by others. For example Sagemath uses a==4 as the way to input and

Re: [sympy] Introducing Equation module

2021-05-09 Thread David Bailey
On 09/05/2021 22:59, gu...@uwosh.edu wrote: David, A pip install that does this and more is available through Algebra_with_SymPy . The Algebra with SymPy repository also has a Binder link were you

Re: [sympy] Introducing Equation module

2021-05-09 Thread David Bailey
On 09/05/2021 07:12, JSS95 wrote: Symbolic equation has been proposed and discussed since 2020. See #19479  and previous discussion . The idea is that Eq should be a boolean relation and Eqn should be

Re: [sympy] Names that aren't unique

2021-04-12 Thread David Bailey
On 12/04/2021 06:53, 'Bruce Allen' via sympy wrote: Hi David, Thanks for picking this up.  I wanted to comment that in your example, the two symbols are defined differently: Symbol("x", positive=True) Symbol("x") that is to say, with different assumptions. For the issue that I was

[sympy] Names that aren't unique

2021-04-11 Thread David Bailey
Dear group, Recently Bruce Allen discussed a problem that he had after pickling a list. However, I think he revealed a deeper problem that is nothing to do with pickling. w=sin(Symbol("x", positive=True))*cos(Symbol("x"))    sin(x)*cos(x) test=Integral(w,,x)    

Re: [sympy] Why does subs() not work as expected - a related question ?

2021-04-07 Thread David Bailey
On 07/04/2021 15:27, 'Bruce Allen' via sympy wrote: Dear Oscar, Thank you. On the upside, this shows that sympy has a robust user base -- the bug was picked up just 20 days ago and here I am stumbling on it independently. On the downside, this makes it hard to work on a calculation which

Re: [sympy] Why does subs() not work as expected - a related question ?

2021-04-07 Thread David Bailey
On 07/04/2021 12:28, Oscar Benjamin wrote: In Bruce's example both symbols seem to have the same assumptions so this shouldn't be the issue. Oscar I just checked and you can make two non-identical symbols that way: Symbol('a')+Symbol('a',Positive=True) a + a I almost wonder if that should

Re: [sympy] Why does subs() not work as expected - a related question ?

2021-04-07 Thread David Bailey
On 07/04/2021 11:59, Oscar Benjamin wrote: On Wed, 7 Apr 2021 at 10:28, 'Bruce Allen' via sympy wrote: I have a very basic sympy question, which has me stumped, and am hoping that someone here can set me straight. I have an expression for which subs() seems to have no effect: >>>

Re: [sympy] Possible error in SymPy function || GSoC

2021-03-29 Thread David Bailey
On 28/03/2021 19:48, 'Aditya Saxena 4-Year B.Tech. Electronics Engineering' via sympy wrote: Hi developers, I am Aditya Saxena, a 2nd year ECE student at IIT BHU. I wish to contribute to the SymPy community but I am new to SymPy and so to get a better understanding of it, I was going through

Re: [sympy] [SymPy] Is this a bug or a feature?

2021-02-11 Thread David Bailey
On 11/02/2021 20:44, Aaron Meurer wrote: How would you handle dividing both sides of an equation by something? I don't know if a piecewise makes sense. (a = b)/x would be "a/x = b/x if x != 0, ??? otherwise". What meaningful thing could the ??? be? You can easily manipulate an equation into

Re: [sympy] [SymPy] Is this a bug or a feature?

2021-02-10 Thread David Bailey
On 10/02/2021 00:53, Oscar Benjamin wrote: On Tue, 9 Feb 2021 at 23:58, S.Y. Lee wrote: And we would also arrive in questions like: If equation brings its own algebra system, there should be an equation of equations? How should we solve them? It's not an "algebra system": it's just a few

[sympy] [SymPy] Is this a bug or a feature?

2021-02-06 Thread David Bailey
Dear Group, While thinking about Jonathon's question, I came across this oddity: x=symbols('x') f=symbols('f',cls=Function) diff(f,x) 1 Why 1? I think I would have expected it to generate a TypeError, just like f+x does. David -- You received this message because you are subscribed to

Re: [sympy] We need some community input on the desired behavior of an equation class...

2021-02-06 Thread David Bailey
On 06/02/2021 03:07, gu...@uwosh.edu wrote: As the number of different people responding to this discussion has been small I have put together the following simple 2 question survey about expectations/preferences for differentiation of equations to try to broaden the input. This is a simple

Re: [sympy] Proposal to have a separate mailing list for GSoC applicants

2021-02-01 Thread David Bailey
On 01/02/2021 14:53, Faisal Riyaz wrote: Hi all, SymPy mailing list receives many introductory emails from prospective GSoC applicants. This makes important discussions related to projects difficult to follow. This has been a problem for a long time. I think this has been discussed before

Re: [sympy] Query about tkinter

2021-01-21 Thread David Bailey
On 20/01/2021 13:54, Oscar Benjamin wrote: I think David is using Windows so that apt-get command which is for Debian Linux can not be used. David I thought that the standard Python installers for Windows would mean that you had tkinter installed. I don't think you can install it with pip

[sympy] Query about tkinter

2021-01-20 Thread David Bailey
Hi Group, I know this isn't strictly a SymPy question, but I suspect someone here will be able to point me in the right direction. When I first acquired SymPy on my 64-bit Windows 10 machine, I downloaded what was then the official version of Python - 3.7.3, and installed SymPy and some

Re: [sympy] Re: We need some community input on the desired behavior of an equation class...

2021-01-09 Thread David Bailey
On 09/01/2021 11:57, S.Y. Lee wrote: I have previously questioned that Wolfram have a == b -> a/c == b/c transformation in conditional expression format https://reference.wolfram.com/language/ref/DivideSides.html and why you were not attempting to implement same like this, But now I'd may agree

Re: [sympy] Problem with sqrt(-1)

2021-01-05 Thread David Bailey
On 04/01/2021 23:05, Aaron Meurer wrote: On Mon, Jan 4, 2021 at 3:32 PM David Bailey wrote: There's always the risk that a syntax mistake will actually be valid syntax in some unrelated way. For example, you might accidentally write x(y + z) instead of x*(y + z). x(y + z) is valid syntax

Re: [sympy] Problem with sqrt(-1)

2021-01-04 Thread David Bailey
On 04/01/2021 21:30, Thomas Ligon wrote: Hello David, indeed, when I enter print(sqrt(-1)), I get I, just as you do. However, when I enter print(4s**2), it is flagged with an error "unexpected token 's'", so I immediately see that I have something wrong. But, when I  enter print(4j**2), I get

Re: [sympy] Problem with sqrt(-1)

2021-01-04 Thread David Bailey
On 04/01/2021 10:37, Oscar Benjamin wrote: In Python 4j is the literal syntax to create an imaginary number (0 + 4*I). You need to use 4*j. I don't understand this because Thomas Lignon imported sqrt from sympy, so why didn't he get the imaginary answer he was expecting? Indeed, trying this

Re: [sympy] Re: SymPy 1.7 released

2020-11-29 Thread David Bailey
On 29/11/2020 14:26, Oscar Benjamin wrote: As soon as I send the email I see an obvious correction. That should say: You can install sympy *1.7* with: Thanks Oscar. I already see an improvement! I tried modifying the ODE transformer code you sent me to use x=cosh(t), and at 1.6 the

Re: [sympy] Re: Substitutions within calculus

2020-11-25 Thread David Bailey
On 25/11/2020 17:42, Oscar Benjamin wrote: On Wed, 25 Nov 2020 at 16:37, David Bailey wrote: Okay now it works: I really appreciate that! We definitely do need to supply a function for doing this. It's really not trivial to get this right. If we had something like dsubs or dchange then we

Re: [sympy] Re: Substitutions within calculus

2020-11-25 Thread David Bailey
On 19/11/2020 15:37, Oscar Benjamin wrote: I obviously wasn't paying enough attention when I wrote that :) I know the feeling, because I also managed to garble the differential equation, which should read: n**2*f(x) - x*Derivative(f(x), x) + (1 - x**2)*Derivative(f(x), (x, 2)) I am pretty

[sympy] Substitutions within calculus

2020-11-18 Thread David Bailey
Dear Group, Suppose I have a differential equation such as: Eq(n^2*f(x) - x*Derivative(f(x), x) + (1 - 2*x)*Derivative(f(x), (x, 2))) (Though typically more complicated) and I want to replace the x variable - say x=cos(t) Is there a way to make that substitution within SymPy and get back a

Re: [sympy] Comparing a cse'd expr with the original

2020-10-23 Thread David Bailey
On 23/10/2020 11:59, Oscar Benjamin wrote: Hi Jason, I'm approaching this from the perspective that this is a bug in cse/lambdify and that you want to identify which part of a large expression tree triggers the bug. Since evaluating the whole expression is slow I would start by testing smaller

Re: [sympy] Trying to understand SymPy patterns

2020-09-20 Thread David Bailey
On 20/09/2020 23:22, Oscar Benjamin wrote: If we had Wilds in abc then they wouldn't have those kinds of exclusion patterns. True, but this is analogous to the fact that 'f' is defined as an ordinary symbol in abc, even though you may want to redefine it as a function symbol. Defining

Re: [sympy] Trying to understand SymPy patterns

2020-09-20 Thread David Bailey
On 20/09/2020 17:29, Oscar Benjamin wrote: The main difference as far as I tell compared to replace is the need to create the Wild symbols explicitly. Maybe we could add a bunch of those to sympy.abc with names like p1_ and p2_ (are those names standardised?). Those examples are a revelation!

Re: [sympy] Trying to understand SymPy patterns

2020-09-20 Thread David Bailey
Hi David (CCing the list), Yes, I know - I need to remember to press"Reply List" rather than "Reply" in Thunderbird! I haven't used Mathematica's pattern functionality myself so I'm interested to hear how it compares. Sure - to use your example: In[2]:= Sin[a*x + b] /. Sin[x*p1_. +

Re: [sympy] Trying to understand SymPy patterns

2020-09-20 Thread David Bailey
On 19/09/2020 23:46, Oscar Benjamin wrote: On Sat, 19 Sep 2020 at 23:35, David Bailey wrote: On 19/09/2020 20:50, Davide Sandona' wrote: Hello David, in Sympy there are three substitution methods: 1. subs: it is the most generic. 2. xreplace: it only replace the exact expression you provide

Re: [sympy] Trying to understand SymPy patterns

2020-09-19 Thread David Bailey
On 19/09/2020 20:50, Davide Sandona' wrote: Hello David, in Sympy there are three substitution methods: 1. subs: it is the most generic. 2. xreplace: it only replace the exact expression you provide. 3. replace: this is the most powerful, as it allows for "pattern matching operations". In

[sympy] Trying to understand SymPy patterns

2020-09-19 Thread David Bailey
Dear All, I was hoping to use SymPy patterns to perform a transformation equivalent to this Mathematica code: f[a + 2*b + c] /. f[x_] -> g[x]   g[a + 2 b + c] I.e. I wanted to replace calls to the (undefined) function f with calls to the function g with the same arguments. I tried

Re: [sympy] Re: Assumptions

2020-08-23 Thread David Bailey
On 23/08/2020 03:01, first last wrote: I wanted a CAS to teach me about convergence conditions. I definitely don't want a CAS where I have to write the assumptions handler before it can teach me. If I write the assumptions handler wrong, I teach myself wrong math. Totally not why I installed

[sympy] Assumptions

2020-08-14 Thread David Bailey
Dear group, Am I correct that the write-up about assumptions found here relates to the old-style assumptions: https://docs.sympy.org/latest/modules/assumptions/assume.html Is there any documentation relating to the new assumptions? It would be really helpful if the documentation for old or

Re: [sympy] Re: SEPs for SymPy (SymPy Enhancement Proposals)

2020-08-06 Thread David Bailey
On 06/08/2020 00:47, Nicolas Guarin wrote: I agree that this would be good for the project but maybe it would be a good idea to polish the documentation a bit. Some of the pages in the wiki are somewhat outdated and they are on the first results in a web search. Assuming you are talking about

Re: [sympy] SEPs for SymPy (SymPy Enhancement Proposals)

2020-08-02 Thread David Bailey
On 02/08/2020 00:23, Oscar Benjamin wrote: Hi all, I've been thinking for some time that there should be more coordination amongst sympy contributors and more involvement with the broader sympy community in the general direction that sympy takes. I want to propose the idea of SymPy Enhancement

Re: [sympy] Simplification of expression with symbols only or with mixed values and symbols

2020-07-31 Thread David Bailey
On 31/07/2020 15:59, Mikhael Myara wrote: Perhaps my example was not clear enough. I start with a fully symbolic expression. Then, I try two things : - ask a simplify on the fully symbolic expression, that works well, - replace  some symbols in the initial expression and then simplify. The

Re: [sympy] How to get around Meijerg???

2020-07-14 Thread David Bailey
On 14/07/2020 11:49, Javier Perez Rodriguez wrote: Hello Aaron, First of all, thanks for your answer. As you suggested, here I bring a piece of code with one of the problematic equations (see Section PIECE OF CODE). As a result of certain computation, I get "equ_laplace" in the Laplace

Re: [sympy] Best way to import Sympy

2020-06-30 Thread David Bailey
Aaron, thanks for responding to my question in detail. On 30/06/2020 20:00, Aaron Meurer wrote: The printer doesn't take into account your namespace. It is copy-pastable from the point of view of having all the SymPy names imported. We could add a string printer mode that prefixes all SymPy

Re: [sympy] Best way to import Sympy

2020-06-29 Thread David Bailey
On 29/06/2020 17:16, Oscar Benjamin wrote: In any significant codebase star-import is a bad idea. It makes it hard to trace the origin of an imported name when looking at the code. If I'm looking at the code and I see sp.cos then I expect that sp will be defined or imported somewhere at the top

Re: [sympy] Release 1.6.1 without release candidate?

2020-06-27 Thread David Bailey
On 27/06/2020 01:15, Oscar Benjamin wrote: Hi all, I'm preparing the SymPy 1.6.1 bugfix release and I'm considering skipping the release candidate and releasing directly and just wanted to see if anyone has any opinions on that. In the past I haven't seen much evidence that anyone has actually

Re: [sympy] SymPy and Python names: Symbol('x') is Symbol('x') ?

2020-06-04 Thread David Bailey
On 04/06/2020 00:04, James Bateman wrote: Thank you. This has been extremely helpful. Sorry once again for posting the wrong code initially. James, I found the creation of symbols in SymPy incredibly confusing and counter-intuitive - it was almost spoiling my enjoyment of using the

  1   2   >