[sympy] Eigenvalues of a matrix with symbolic coefficients

2014-12-04 Thread Oscar Benjamin
I'm having some problems getting sympy to compute eigenvalues of a matrix with symbolic coefficients. A trivial example is: In [4]: M = Matrix([[y, 0], [0, z]]) In [5]: M Out[5]: ⎡y 0⎤ ⎢⎥ ⎣0 z⎦ In [6]: M.eigenvals() Out[6]: ⎧ ____ ⎫ ⎪

Re: [sympy] Eigenvalues of a matrix with symbolic coefficients

2014-12-04 Thread Oscar Benjamin
On 4 December 2014 at 17:44, Colin Macdonald macdon...@maths.ox.ac.uk wrote: In [4]: M = Matrix([[y, 0], [0, z]]) In [5]: M Out[5]: ⎡y 0⎤ ⎢⎥ ⎣0 z⎦ In [6]: M.eigenvals() Out[6]: ⎧ ____ ⎫ ⎪ ╱2╱2

[sympy] Magnitude of a complex number

2015-05-19 Thread Oscar Benjamin
Am I misunderstanding something here (using master): $ isympy Couldn't locate IPython. Having IPython installed is greatly recommended. ... z = (4+3*I)/(3-4*I) z 4 + 3⋅ⅈ ─── 3 - 4⋅ⅈ abs(z) │ 1 │ 5⋅│───│ │3 - 4⋅ⅈ│ simplify(abs(z)) │ 1 │ 5⋅│───│ │3 - 4⋅ⅈ│

Re: [sympy] diff(x^x,x)

2015-05-29 Thread Oscar Benjamin
On 29 May 2015 22:06, Thomas Leitz unruhsc...@gmail.com wrote: Hi, the online shell at http://live.sympy.org/ tells me diff(x^x,x) = 0 Why is that? ^ doesn't do what you're expecting in Python. Use ** for exponentiation. -- Oscar -- You received this message because you are subscribed

Re: [sympy] Convert between numeral systems

2015-07-03 Thread Oscar Benjamin
On 3 July 2015 at 13:48, Robert Pollak robert.pol...@mykolab.com wrote: Hello, I have got a newbie question: Does SymPy provide a way to deal with numbers in different numeral systems and e.g. to convert them between different systems? Or do I have to tell my students that they have to

Re: [sympy] Solution of small system of equations grows past manageability

2016-06-12 Thread Oscar Benjamin
On 11 June 2016 at 17:52, wrote: > > Yes, exactly, its the linear bearings that can be at different locations and > force therefore the board to different positions, those are the ones that i > am interested in! Rather than thinking about x, y and theta think about the

Re: [sympy] Solution of small system of equations grows past manageability

2016-06-15 Thread Oscar Benjamin
On 14 June 2016 at 20:30, wrote: > I had the same idea earlier, but i dropped it because my intuition was, that > three quadratic equations are worse than three linear and one quadratic > equation :-) > > Since you brought this approach up again, i tried it now, but

Re: [sympy] Status of old/new assumptions systems

2016-01-18 Thread Oscar Benjamin
On 15 January 2016 at 15:06, Aaron Meurer wrote: > > In the released version (0.7.6.1), the systems are independent. In > master, the new assumptions (ask(), Q) read the old assumptions on > Symbols (is_positive, positive=True). > > For performance purposes, this was done in a

Re: [sympy] Definite Intergral wrong. How to solve

2016-02-13 Thread Oscar Benjamin
On 13 February 2016 at 07:48, Nasir Haniffa wrote: > Hi, > > How to get the correct answer for the problems > > 1. Integral( (1+x**2)**(-3/2) ,(x,-1,1) ) > > > 2. Integral( (1+x**2+y**2)**(-3/2) ,(x,-1,1), (y,-1,1) ) > > Both gives 0 in sympy which is wrong. This is

Re: [sympy] Bug in factor() and simplify()

2016-02-26 Thread Oscar Benjamin
On 25 February 2016 at 15:30, Oscar Benjamin <oscar.j.benja...@gmail.com> wrote: > On 25 February 2016 at 10:44, Yingchi Li <liying...@gmail.com> wrote: >> >> I have found a bug in factor() and simplify() >> please look at the image below >> >>

Re: [sympy] Re: Help: simple univariate polynomial, sympy solve gives no results

2016-01-20 Thread Oscar Benjamin
On 20 January 2016 at 15:05, Denis Akhiyarov wrote: > > Oscar, you need to click on "more roots" in wolfram alpha to see the > algebraic solution, which is definitely confusing. Unless I'm misreading all of the additional roots are for the case where A=0. IOW Wolfram

Re: [sympy] Re: Help: simple univariate polynomial, sympy solve gives no results

2016-01-20 Thread Oscar Benjamin
On 20 January 2016 at 15:11, Aaron Meurer wrote: > SymPy has algorithms to find roots of quintics in radicals (when they > exist). I don't recall if the algorithms work for symbolic inputs. > > One can take a general quintic (x**5 + a*x**4 + b*x**3 + c*x**2 + d*x + e) > and

Re: [sympy] Status of old/new assumptions systems

2016-01-19 Thread Oscar Benjamin
On 18 January 2016 at 20:47, Aaron Meurer wrote: >>> For now, I would recommend using the old assumptions. However, you can >>> play with the new assumptions. The goal in making the new assumptions >>> read the old was to make this easier to do. >> >> But it also makes it a

Re: [sympy] Re: Help: simple univariate polynomial, sympy solve gives no results

2016-01-20 Thread Oscar Benjamin
On 20 January 2016 at 05:46, Denis Akhiyarov wrote: > On Tuesday, January 19, 2016 at 11:41:47 PM UTC-6, Denis Akhiyarov wrote: >> >> no algebraic roots according to this theorem: >> https://en.wikipedia.org/wiki/Abel%E2%80%93Ruffini_theorem The theorem only shows that

Re: [sympy] integration with the square root of a non-negative expressions

2016-02-14 Thread Oscar Benjamin
On 14 February 2016 at 15:17, Andrew Corrigan wrote: > I'm having trouble computing a definite integral involving the sqrt of a > non-negative expression, as implemented below (computing the length of a > quadratic line in 2D). It seems to fail. I've generally had

Re: [sympy] integration with the square root of a non-negative expressions

2016-02-15 Thread Oscar Benjamin
On 15 February 2016 at 15:01, Andrew Corrigan wrote: > Thank you both for your replies. I'm not sure I follow the discussion to be > honest as to how it applies to my original problem. In particular: >>> >>> Distilling this down you want to compute the integral of the

Re: [sympy] Simplifying trigonometric expression

2016-02-18 Thread Oscar Benjamin
On 18 February 2016 at 09:43, Paul Royik wrote: > I'm trying to simplify a*cos(b)**2+a*sin(b)**2 to a > > So, I write > > a = sympy.Wild('a') > b = sympy.Wild('b') > expr = 49*cos(x)**2+49*sin(x)**2 + 5 > expr.replace(a*sympy.sin(b)**2+a*sympy.cos(b)**2, a, exact=True) >

Re: [sympy] Sympy vs Numpy, better accuracy in precision?

2016-04-07 Thread Oscar Benjamin
On 5 April 2016 at 18:21, Isuru Fernando wrote: > > I think the current way of representing Floats is reasonable. > > Float internally keeps it in binary representation, so any non-terminating > number in base 2 is truncated when stored as a Float. That's why there is a > string

Re: [sympy] Sympy vs Numpy, better accuracy in precision?

2016-04-07 Thread Oscar Benjamin
On 5 April 2016 at 18:08, Aaron Meurer <asmeu...@gmail.com> wrote: > On Tue, Apr 5, 2016 at 12:54 PM, Oscar Benjamin > <oscar.j.benja...@gmail.com> wrote: >> >>> >>> I don't know if it should be considered a bug, but it's worth noting >>>

Re: [sympy] Re: Pretty print expressions

2016-04-07 Thread Oscar Benjamin
On 7 April 2016 at 13:50, Luv Agarwal wrote: > Also, is this the right place to ask questions? It is although I don't know the answer to your question. Be patient... -- You received this message because you are subscribed to the Google Groups "sympy" group. To

Re: [sympy] Sympy vs Numpy, better accuracy in precision?

2016-04-05 Thread Oscar Benjamin
On 5 April 2016 at 17:15, Aaron Meurer <asmeu...@gmail.com> wrote: > On Tue, Apr 5, 2016 at 6:19 AM, Oscar Benjamin > <oscar.j.benja...@gmail.com> wrote: >> >> I though that it should be possible to easily do this with sympy >> Floats but it doesn't seem

Re: [sympy] Arbitrary Precision Problem Persists

2016-04-10 Thread Oscar Benjamin
On 9 April 2016 at 19:56, Amy Valhausen wrote: > In the thread ; https://groups.google.com/forum/#!topic/sympy/eUfW6C_nHdI > > I was seeking feedback and help with the problem of type ; > > ( 1.414213562^6000) % 400) > > After reviewing all the excellent collaboration at

Re: [sympy] Sympy vs Numpy, better accuracy in precision?

2016-04-11 Thread Oscar Benjamin
On 11 April 2016 at 03:55, Amy Valhausen wrote: > In tried ; > > import mpmath > x = Float("1.4142", 950) > x**6000%400 > > But got the same sort of error message again ; > x = Float("1.4142", 950) > Traceback (most recent call last): > File "", line 1, in >

Re: [sympy] Bug in factor() and simplify()

2016-03-01 Thread Oscar Benjamin
On 26 February 2016 at 17:15, Aaron Meurer wrote: >> I traced this to here: >> >> In [1]: expr = x*sin(y)**2 + x*cos(y)**2 + 0.1*sin(y)**2 + 0.1*cos(y)**2 >> >> In [2]: p = Poly(expr, x, cos(y), sin(y), domain='RR') >> >> In [3]: p >> Out[3]: Poly(1.0*x*cos(y)**2 +

Re: [sympy] Sympy vs Numpy, better accuracy in precision?

2016-04-05 Thread Oscar Benjamin
On 5 April 2016 at 01:56, Amy Valhausen wrote: > > import numpy > (np.longdouble(1.4142)** 6000 )%400 ... > > # The library mpmath is a good solution import sympy as smp mp = smp.mpmath > mp.mp.dps = 50 # Computation precision is 50 digits 50 digits is

Re: [sympy] dsolve fails to integrate simple ODE

2018-09-11 Thread Oscar Benjamin
ral, but if you call doit() it computes it. > > >>> dsolve(eqn, g(x)).integrate(x).doit() > Eq(Integral(g(x), x), C1*log(x) + exp(x) - Ei(x)) > > I opened https://github.com/sympy/sympy/issues/15218 for this. > > Aaron Meurer > > On Tue, Sep 11, 2018 at 4:53 PM,

[sympy] dsolve fails to integrate simple ODE

2018-09-11 Thread Oscar Benjamin
Hi, I'm not sure if I'm missing a trick but I've been trying to use dsolve and it seems it doesn't work in many simple cases. I've put some examples below, tested with sympy 1.2 installed using pip. I don't know if any of the below is me using dsolve incorrectly or should be considered a bug or

Re: [sympy] dsolve fails to integrate simple ODE

2018-09-11 Thread Oscar Benjamin
Done: https://github.com/sympy/sympy/issues/15219 On Wed, 12 Sep 2018 at 00:30, Aaron Meurer wrote: > IndexError indicates a bug. Can you open an issue for it? > > Aaron Meurer > > On Tue, Sep 11, 2018 at 5:28 PM, Oscar Benjamin > wrote: > > Thanks for the quick r

Re: [sympy] Solving Integral with Symbolic Computation (Sympy), Division and Tricky Limits

2018-10-19 Thread Oscar Benjamin
On Fri, 19 Oct 2018 at 22:09, Aaron Meurer wrote: > > You can pass the limits to integrate directly: > > >>> integrate(1/(x**2+y**2)**Rational(3,2), (y, -L/2, L/2)) > L/(x**3*sqrt(L**2/(4*x**2) + 1)) > > It's generally recommended to do this as it isn't always correct to > substitute the upper

Re: [sympy] Solving Integral with Symbolic Computation (Sympy), Division and Tricky Limits

2018-10-19 Thread Oscar Benjamin
On Fri, 19 Oct 2018 at 17:17, bb wrote: > > A physics teacher on an online course [presented][1] this integral, I haven't looked at the video but... > from sympy import integrate, sqrt, Symbol, pprint > y = Symbol('y') > x = Symbol('x') > print (integrate('1/

[sympy] Operations on Eq objects

2018-10-27 Thread Oscar Benjamin
Hi all, I find the behaviour of operations involving Eq strange. I would really like to be able to use Eqs for algebra but they don't seem to do anything useful. Is this behaviour intentional or is it something that could be improved? Setup: >>> from sympy import * >>> x = Symbol('x') >>> y =

Re: [sympy] Re: Operations on Eq objects

2018-10-27 Thread Oscar Benjamin
Thanks, I've commented there. On Sat, 27 Oct 2018 at 20:40, Chris Smith wrote: > > See this issue for previous discussion. > > On Saturday, October 27, 2018 at 12:44:09 PM UTC-5, Oscar wrote: >> >> Hi all, >> >> I find the behaviour of operations involving Eq strange. I would >> really like to

[sympy] Create a Matrix from blocks

2018-11-07 Thread Oscar Benjamin
Is there a straight-forward way to create a matrix from blocks? The Matrix.diag function is nice for creating a block diagonal matrix: In [1]: Matrix.diag(2*eye(2),3*eye(3)) Out[1]: ⎡2 0 0 0 0⎤ ⎢ ⎥ ⎢0 2 0 0 0⎥ ⎢ ⎥ ⎢0 0 3 0 0⎥ ⎢ ⎥ ⎢0 0 0 3 0⎥ ⎢

[sympy] Running SymPy's tests with pytest

2019-01-21 Thread Oscar Benjamin
Hi all, For the past two months I've been working on making it possible to run SymPy's test suite using pytest. It is now possible to do this so I thought I'd write something here to explain how to use it and why it can be useful. There are two options in particular that I find very useful while

Re: [sympy] Running SymPy's tests with pytest

2019-01-21 Thread Oscar Benjamin
On Mon, 21 Jan 2019 at 23:58, Aaron Meurer wrote: > > > SymPy's test runner just skips xfail tests. > > This should not be the case, except for slow xfail tests. Sorry I've just checked and you're right. bin/test does run the xfail tests and does report them as xpass with an X if they pass

[sympy] Unrelated PRs failing Travis tests due to test_sympify

2018-11-21 Thread Oscar Benjamin
Hi all, Travis tests are failing in unrelated PRs due to the same issue. You can see an example here: https://travis-ci.org/sympy/sympy/jobs/457806002 The test run that fails is for optional dependencies on Python 3.6. I guess that either a bug has snuck into master or there has been some change

Re: [sympy] Introduction and Question

2018-11-17 Thread Oscar Benjamin
On Sat, 17 Nov 2018 at 07:20, Pulkit Arora wrote: > > Hi! I'm Pulkit Arora a 2nd year undergraduate, I came across sympy a week ago > and i was having some trouble finding my way in the Huge codebase SymPy has, > can someone help me out a bit? Hi Pulkit. What exactly are you looking for? >

[sympy] Defining custom invertible functions

2018-09-12 Thread Oscar Benjamin
Hi, I was just looking at a way to solve ODEs algebraically and came up with the code below which almost works (just needs integration constants). I have a few questions though. 1. What is the right way to define an arbitrary invertible function and its inverse? 2. Is the code below abusing

Re: [sympy] SymPy 1.4 release candidate 1 ready for testing

2019-04-02 Thread Oscar Benjamin
I think it is now possible to upload pre-releases to PyPI so that users can ask pip to install them: https://pip.pypa.io/en/stable/reference/pip_install/#pre-release-versions https://packaging.python.org/guides/distributing-packages-using-setuptools/#pre-release-versioning Also most Python

Re: [sympy] SymPy 1.4 release candidate 1 ready for testing

2019-04-02 Thread Oscar Benjamin
nk it should be an >> easy thing to add to the release script. I'll look into if it is >> possible. >> >> Aaron Meurer >> >> On Tue, Apr 2, 2019 at 3:28 PM Oscar Benjamin >> wrote: >> > >> > I think it is now possible to upload pre-releases t

Re: [sympy] problem with Imaginary in sympy

2019-04-04 Thread Oscar Benjamin
You can do it like this: In [7]: setupstr='LI(OAMHolo(OAMHolo(XX,e,6),f,2),a,f)' In [8]: from sympy import S In [9]: S(setupstr) Out[9]: LI(OAMHolo(OAMHolo(XX, e, 6), f, 2), a, f) On Thu, 4 Apr 2019 at 15:41, Xuemei Gu wrote: > > Thank you very much! > > I have another question: > > I get a

Re: [sympy] Gsoc Project idea " Efficient Equation ofMotionGenerationwith Python" discussion.

2019-03-27 Thread Oscar Benjamin
ons, we can use >>>>> polynomial algorithms that operate on rational functions. These always >>>>> keep rational functions in canonical form, and the zero equivalence >>>>> testing becomes literally "expr == 0" (no simplification required). >>>

Re: [sympy] GSoC 2019 Proposal: Differential Equations

2019-04-06 Thread Oscar Benjamin
Hi Grace, I don't know where it is you're looking to see the proposals for differential equations but I can tell you that the ODE systems code is a bit of a mess right now. See the label solvers.dsolve on Github for relevant issues/PRs. At the moment there are many methods for very specific

Re: [sympy] Implementation of ODE's solution.

2019-03-17 Thread Oscar Benjamin
Great. The separation ansatz and the Bessel function idea are both good. I believe someone started a PR at some point for Bessel/Airy functions so probably good to look at that as well. For Lie groups the existing code needs substantial improvement. It is largely untested and has many bugs. If

Re: [sympy] Gsoc Project idea " Efficient Equation ofMotionGenerationwith Python" discussion.

2019-03-14 Thread Oscar Benjamin
I haven't looked at SymPy's specific code for generating equations of motion but I have used SymPy for generating equations of motion and other mechanics related problems. The example here: https://github.com/sympy/sympy/issues/16207 comes from a mechanics problem and was slow because of slow

Re: [sympy] Gsoc Project idea " Efficient Equation ofMotionGenerationwith Python" discussion.

2019-03-14 Thread Oscar Benjamin
(Replying on-list) On Thu, 14 Mar 2019 at 20:37, Alan Bromborsky wrote: > > Since most pc these days have multiple cores and threads what not use > parallel algorithyms. For honesty I must state I have a vested interest > since I have a pc with a threadripper cpu with 16 cores and 32 threads.

Re: [sympy] Introduction and a question

2019-03-10 Thread Oscar Benjamin
There probably is a better way of doing this in your problem but I just want to point out a way to "manually" extract parts of an expression. Let's create an expression with a few parts: In [1]: a, b, c, x = symbols('a b c x') In [2]: p = a*x**2 + b*x + c In [3]: r1, r2 = solve(p, x) In [4]:

Re: [sympy] End user question - usage on Ubuntu with PyPy

2019-03-10 Thread Oscar Benjamin
I generally use virtual environments to test development versions of Python libraries. Within the virtual environment you can install the library using pip install -e. Create and activate virtualenv: enojb@IT035770:~/current/tmp$ mkdir pypydemo enojb@IT035770:~/current/tmp$ cd pypydemo/

Re: [sympy] Can sympy solve (1. - (x ** n)) ** (1/n) = y , and similar?

2019-03-08 Thread Oscar Benjamin
On Fri, 8 Mar 2019 at 17:25, Stuart Reynolds wrote: > > Dear Sympy users, > > I'm new to sympy and interested in using it for function design. > I'm curious about what types of things I should be able to expected > sympy.solve to solve. In particular, trying to solve: > (1. - (x ** 2)) ** (1. /

Re: [sympy] Introduction and a question

2019-03-10 Thread Oscar Benjamin
I'm not sure if this would work for your real problem but for this example you can do: In [8]: factor(test-d)+d Out[8]: d - (a - b)⋅(c - 1) On Sun, 10 Mar 2019 at 07:56, Mark Juers wrote: > > I'm a 4th-year PhD student in evolutionary biology at Indiana University in > Bloomington, IN. I've

Re: [sympy] Help regarding location of labels of bugs

2019-02-16 Thread Oscar Benjamin
Unfortunately only "members" (those with merge access) can change the labels on issues/PRs. I think that's just how Github works and cannot be changed by us. SymPy has used Easy-to-fix for some time but I note that Github now suggests Good-first-issue in its hints. Rishik do you think that is a

Re: [sympy] Start Contribution

2019-01-29 Thread Oscar Benjamin
Hi Vishesh, Since you mentioned your experience with differential equations maybe you would be interested in this issue (that I just opened): https://github.com/sympy/sympy/issues/15881 If you have questions about it then probably best to ask on the issue. On Mon, 28 Jan 2019 at 22:31, Vishesh

Re: [sympy] rounding difference between Python 3 and SymPy

2019-04-10 Thread Oscar Benjamin
The fact that the numbers are stored in binary is significant: In [16]: nums = [eval('1.%d5' % n) for n in range(10)] In [17]: nums Out[17]: [1.05, 1.15, 1.25, 1.35, 1.45, 1.55, 1.65, 1.75, 1.85, 1.95] In [18]: [round(n, 1) for n in nums] Out[18]: [1.1, 1.1, 1.2, 1.4, 1.4, 1.6, 1.6, 1.8, 1.9,

Re: [sympy] rounding difference between Python 3 and SymPy

2019-04-11 Thread Oscar Benjamin
I think that Python's float.__round__ is correct. AIUI it rounds correctly based on the true value represented by the float: In [4]: round(1.05, 1) Out[4]: 1.1 In [5]: import decimal In [6]: decimal.Decimal(1.1) Out[6]: Decimal('1.100088817841970012523233890533447265625') That's

Re: [sympy] ArrayComprehension or List

2019-06-04 Thread Oscar Benjamin
In normal Python the main purpose of list is to be mutable. When you want an immutable list you can use tuple. If SymPy had List would it be mutable? If so then it couldn't be a Basic subclass. If not what purpose would it serve? On Tue, 4 Jun 2019 at 04:46, Chris Smith wrote: > > From

Re: [sympy] Prevent expression evaluation in repr()/latex()

2019-06-02 Thread Oscar Benjamin
Hi Jean, What version of SymPy are you using? This seems to work fine on SymPy master and with the most recent version (1.4): In [1]: repr(Mul(-1, 2, 5, evaluate=False)) Out[1]: '-2*5' -- Oscar -- You received this message because you are subscribed to the Google Groups "sympy" group. To

Re: [sympy] f`(0)

2019-06-04 Thread Oscar Benjamin
Yeah, it would be nice to be able to do that. Unfortunately SymPy has no notion of the derivative of an unapplied function. I'd like to have a differential operator so you could do something like `D(sin) == cos` etc. I believe there are some long-standing issues on Github about this. -- Oscar On

Re: [sympy] Problem in solving non linear equation equation

2019-06-06 Thread Oscar Benjamin
SymPy will find the solution eventually I think. This is a polynomial of order 8 having only even powers so with a substitution omega**2 -> x it's a quartic in x with complicated symbolic coefficients. The general formula for a quartic is horrendous and in this case your coefficients are already

Re: [sympy] Concatenate Matrix

2019-06-19 Thread Oscar Benjamin
gt; phi[2,0] > theta[0.0] > theta[1,0] > theta[2,0] > theta[3,0] > theta[4,0] ]) > > Is this how sympy has stored it even though it does not display it like this? > > Thanks, > > Lucy > > On Wed, 19 Jun 2019 at 16:51, Oscar Benjamin > wrote: >>

Re: [sympy] Concatenate Matrix

2019-06-19 Thread Oscar Benjamin
Hi Lucy, Running on master I get this: In [13]: sym.BlockMatrix([[a], [phi], [theta]]) Out[13]: ⎡⎡0⎤⎤ ⎢⎢ ⎥⎥ ⎢⎢0⎥⎥ ⎢⎢ ⎥⎥ ⎢⎣0⎦⎥ ⎢ ⎥ ⎢ φ ⎥ ⎢ ⎥ ⎣ θ ⎦ In [14]: sym.BlockMatrix([[a], [phi], [theta]]).shape Out[14]: (11, 1) Note that I've used extra square brackets to indicate that I want these

[sympy] Using the mechanics API

2019-05-13 Thread Oscar Benjamin
Hi all, I haven't really looked much at SymPy's mechanics module even though mechanics is very much one of my interests and something that I like to think I know a bit about. Today I finally took a look at it and I found the whole API surprisingly complicated. I teach mechanics to undergraduate

Re: [sympy] Using the mechanics API

2019-05-14 Thread Oscar Benjamin
; simpler interfaces that give a way to "assemble" bodies as you would in >> reality (with joints, etc) but it is still not polished for production. I >> could imagine a layer that makes it simpler to do 2D mechanics too, among >> other things. >> >> I'll be work

Re: [sympy] Using the mechanics API

2019-05-14 Thread Oscar Benjamin
gt; > > > Sent from Mail for Windows 10 > > > > From: Oscar Benjamin > Sent: 14 May 2019 02:12 > To: sympy > Subject: [sympy] Using the mechanics API > > > > Hi all, > > > > I haven't really looked much at SymPy's mechanics module even though > &g

Re: [sympy] Interested in working on SymPy's quantum physics module

2019-05-19 Thread Oscar Benjamin
Hi Tilman, It's great that you're interested in doing this! I don't know the quantum module very well myself but it probably does need work. As far as I know no one is really working on it right now. A good place to start thinking about improving it would probably be looking over the open

Re: [sympy] is compatibility builtins broken?

2019-05-08 Thread Oscar Benjamin
On Wed, 8 May 2019 at 22:38, Chris Smith wrote: > > None of them work That's what I get for not trying them out! > >>> import sympy.core.compatibility.builtins as builtins > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named builtins > > >>> from

Re: [sympy] Gsoc Project idea " Efficient Equation ofMotionGenerationwith Python" discussion.

2019-05-14 Thread Oscar Benjamin
On Thu, 14 Mar 2019 at 21:19, Aaron Meurer wrote: > > I agree. The biggest challenge with symbolic matrices is expression > blow up. In some cases it is unavoidable, for instance, symbolic > eigenvalues/eigenvectors use the symbolic solutions to polynomials, > which are complicated in the general

Re: [sympy] Blog post about SymPy 1.4

2019-05-02 Thread Oscar Benjamin
On Thu, 2 May 2019 at 23:09, Ondřej Čertík wrote: > > Once we drop Python 2.7, we should experiment with using the type annotation > and MyPy to statically check (eventually) the whole code base. I think this > will find bugs, improve the development experience and make it much easier to >

Re: [sympy] is compatibility builtins broken?

2019-05-08 Thread Oscar Benjamin
On Wed, 8 May 2019 at 08:23, Chris Smith wrote: > > Am I doing something wrong here when running Python 2? > > >>> from sympy.core.compatibility import builtins > >>> from builtins import type > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named builtins

Re: [sympy] Grid in sympy plotting

2019-06-26 Thread Oscar Benjamin
Hi Lee, SymPy's plotting module uses matplotlib so it is reasonable to use the matplotlib API for adding a grid. I just tried this and it works fine: In [1]: plot(x**2) Out[1]: In [2]: from matplotlib.pyplot import grid In [3]: grid() Oscar On Wed, 26 Jun 2019 at 01:59, Lee Smith wrote: >

Re: [sympy] Grid in sympy plotting

2019-06-27 Thread Oscar Benjamin
t; functions! > Suggestions? > [image: Sympy_grid.PNG] > > On Wed, Jun 26, 2019 at 3:26 AM Oscar Benjamin > wrote: > >> Hi Lee, >> >> SymPy's plotting module uses matplotlib so it is reasonable to use the >> matplotlib API for adding a grid. >> >> I ju

Re: [sympy] Re: MatPow bug or inconsistency?

2019-07-11 Thread Oscar Benjamin
I don't have a computer to test but what happens if x is declared as an integer? For non-integer (or non-real) x the result doesn't necessarily hold. On Thu, 11 Jul 2019, 19:39 Tomasz Pytel, wrote: > Yes, various, try it with [[0,1],[1,0]] > > On Thursday, July 11, 2019 at 1:30:45 PM UTC-3,

Re: [sympy] Newbie: display product

2019-07-13 Thread Oscar Benjamin
Hi Gary, I wonder if we are overcomplicating things here. Does this do what you want? x, y = symbols('x, y') a = x + y b = x * y print(a * b) -- Oscar On Tue, 9 Jul 2019 at 03:11, Gary Pajer wrote: > > I'm sure I'm not the first person having trouble getting started. If there > is a good

Re: [sympy] Newbie

2019-07-13 Thread Oscar Benjamin
Hi Tanvi, It's great that you want to contribute! Take a look here (I guess you already did): https://github.com/sympy/sympy/wiki/introduction-to-contributing Every part of SymPy can be improved in some way. You mention matrices - there is a lot of work going on for matrices and many issues:

Re: [sympy] Newbie: display product

2019-07-13 Thread Oscar Benjamin
On Sat, 13 Jul 2019 at 21:40, Gary Pajer wrote: > > Oscar, > > That does seem to do what I want ... I think. > What's the difference between this and Chris Smith's answer? I think that both Chris and Gagandeep thought that you were trying to do something more complicated than you actually were.

Re: [sympy] Re: Interested in working on SymPy's quantum physics module

2019-07-13 Thread Oscar Benjamin
Hi Tilman, It's a shame the project didn't work out but I'm glad to hear you're still interested in contributing. Let us know if you start working on this and want any guidance/help. -- Oscar On Sat, 6 Jul 2019 at 18:20, Tilman Roeder wrote: > > Hey everyone, > > After talking to the people at

Re: [sympy] simplifying large boolean expressions/equations

2019-07-13 Thread Oscar Benjamin
Can you show a (short) example of some code that you've tried? ‪On Sun, 7 Jul 2019 at 17:18, ‫רועי גרמיזו‬‎ wrote:‬ > > Hi, what is the best way to simplify a boolean equation with more than 8 > variables? setting force to true on simplify_logic just takes too long, and > to_dnf sometimes

Re: [sympy] Newbie: display product

2019-07-14 Thread Oscar Benjamin
On Sun, 14 Jul 2019 at 13:29, David Bailey wrote: > > On 13/07/2019 22:36, Oscar Benjamin wrote: > > > Generally it is a lot easier to understand SymPy if you are > experienced with Python. A lot of our users are new to both Python and > SymPy and I think that makes it h

Re: [sympy] Using commands from SymPy website

2019-06-26 Thread Oscar Benjamin
Hi David, This isn't a trivial point. I just checked to see what you mean and it is annoying. I think that there should be a way to copy to clipboard or access the raw code. I don't see how to do it though... Unless someone else knows I think you should open an issue. -- Oscar On Wed, 26 Jun

Re: [sympy] given a plane equation to extract the coefficients a,b,c,d

2019-06-25 Thread Oscar Benjamin
I'm not sure exactly what you mean. Does this help? In [1]: a, b, c, d, x, y, z = symbols('a, b, c, d, x, y, z') In [2]: eq = a*x + b*y+ c*z - d In [3]: eq Out[3]: a⋅x + b⋅y + c⋅z - d In [4]: eq.coeff(x) Out[4]: a In [5]: eq.coeff(y) Out[5]: b In [6]: eq.coeff(z) Out[6]: c On Tue, 25 Jun

Re: [sympy] Saving large symbolic expressions

2019-08-14 Thread Oscar Benjamin
This seems to be a bug. I think I can reproduce it with: In [9]: import pickle In [10]: from sympy.physics.mechanics import dynamicsymbols In [11]: q1 = dynamicsymbols('q1') In [12]: pickle.dumps(q1) --- PicklingError

Re: [sympy] Should symbolic integration fail gracefully?

2019-08-20 Thread Oscar Benjamin
Hi David, Can you open an issue on Github please. That's a bug that should be fixed. Oscar On Tue, 20 Aug 2019 at 21:08, David Bailey wrote: > > It seems as though the symbolic integration process fails when it can't find > a solution: > > integrate(sin(x**n),x) > Traceback (most recent call

Re: [sympy] Can't get sympy.functions.atan2 to work with _eval_evalf

2019-08-20 Thread Oscar Benjamin
There's a "return" missing: $ git diff diff --git a/sympy/functions/elementary/trigonometric.py b/sympy/functions/elementary/trigonometric.py index 635e7f2..b7a0ad1 100644 --- a/sympy/functions/elementary/trigonometric.py +++ b/sympy/functions/elementary/trigonometric.py @@ -3070,4 +3070,4 @@ def

Re: [sympy] How to avoid automatic xi symbols appearing with diff of chained functions

2019-08-24 Thread Oscar Benjamin
I would say that you should use doit but I just tried that and it crashed: In [*9*]: e=Function('g')(Function('f')(x1,x2),Function('h' )(x1,x2)).diff(x1) In [*10*]: e Out[*10*]: ⎛ ∂ ⎞│⎛ ∂ ⎞│ ⎛ ∂ ⎞│

Re: [sympy] Re: fcode example in documentation not working?

2019-08-24 Thread Oscar Benjamin
On Sat, 24 Aug 2019 at 01:29, manaxf wrote: > > Has this issue been fixed? I don't know but judging from Bjorn's comments maybe it isn't that hard to fix. Are you interested in sending a PR? -- You received this message because you are subscribed to the Google Groups "sympy" group. To

Re: [sympy] Should symbolic integration fail gracefully?

2019-08-21 Thread Oscar Benjamin
On Wed, 21 Aug 2019 at 11:50, David Bailey wrote: > > On 20/08/2019 21:10, Aaron Meurer wrote: > > "TypeError: cannot determine truth value of Relational" generally > indicates a bug in SymPy. And yes, integrate() should always return > unevaluated when it can't compute the integral. > > I

Re: [sympy] Should symbolic integration fail gracefully?

2019-08-21 Thread Oscar Benjamin
I've opened an issue: https://github.com/sympy/sympy/issues/17473 On Wed, 21 Aug 2019 at 12:11, Oscar Benjamin wrote: > > On Wed, 21 Aug 2019 at 11:50, David Bailey wrote: > > > > On 20/08/2019 21:10, Aaron Meurer wrote: > > > > "TypeError: cannot determine t

Re: [sympy] solving simultaneous equations involving sine and cosine functions

2019-09-13 Thread Oscar Benjamin
This is a bug. Can you open an issue on github please? https://github.com/sympy/sympy/issues The error comes from: In [2]: factor_terms(pi/4+oo*I) --- TypeError: can't convert oo to int Probably another error has left to

Re: [sympy] Re: Query Regarding Contributing towards Sympy

2019-09-08 Thread Oscar Benjamin
Graph theory has already been ruled out for SymPy: https://github.com/sympy/sympy/issues/8186 Most graph-theoretic algorithms are not symbolic and don't really have any connection to the symbolic manipulation that SymPy does. That being said there is plenty of scope to use graph theoretic

Re: [sympy] SymPy project

2019-09-07 Thread Oscar Benjamin
Posting here is a good idea. There's probably somewhere on the wiki that lists related projects. Otherwise perhaps mailing lists related to Jupyter or Spyder might be relevant. I suggest uploading it to pypi so it can be installed with pip first though. That substantially lowers the barrier to

Re: [sympy] Coding guidelines

2019-09-08 Thread Oscar Benjamin
Preventing assignment isn't necessary for the internal workings of SymPy. The only advantage it has is potentially avoiding confusion for users. I don't particularly see users getting confused about this though (although maybe that's because of the widespread use of properties). What I think is

Re: [sympy] Coding guidelines

2019-09-08 Thread Oscar Benjamin
I should clarify that what I said is opinionated (my opinion in particular!) so it's possible others disagree. Certainly there is a lot of code in SymPy that doesn't follow the advice above. If we want a cached_property decorator then we can add this somewhere in sympy/utilities or perhaps

Re: [sympy] New here,willing to contribute,tried to work on an issue(#17333)

2019-08-05 Thread Oscar Benjamin
Hi Dinesh, It's great that you are interested in contributing to SymPy. If you want to work on a particular issue then the best thing is to ask/comment on that issue i.e. here: https://github.com/sympy/sympy/issues/17333 Oscar On Sun, 4 Aug 2019 at 17:38, Dinesh ch wrote: > Hello, > I'm

Re: [sympy] can SymPy be more explicit about assumptions?

2019-08-05 Thread Oscar Benjamin
See also https://github.com/sympy/sympy/issues/17224 On Sun, 4 Aug 2019 at 13:32, Chris Smith wrote: > > Symbols default to commutative=True but I wonder if we should also default to > `finite=True` since that is consistent with the behavior of `x - x` being 0. > (If x is infinite then `x -

Re: [sympy] which AccumBounds result is correct

2019-07-20 Thread Oscar Benjamin
I guess this is the dependency problem in interval arithmetic: https://en.wikipedia.org/wiki/Interval_arithmetic#Dependency_problem (Note that x**2+x is the example used there) The issue is that we have to know the identity of the intervals. For example if x and y are distinct intervals both

Re: [sympy] Symbolic integrator using a neural network

2019-09-28 Thread Oscar Benjamin
Neural nets are trained for a particular statistical distribution of inputs and in the paper they describe their method for generating a particular ensemble of possibilities. There might be something inherent about the examples they give that means they are all solved using a particular approach.

Re: [sympy] Can SymPy's existing set implementation handle parameterized curves?

2019-10-01 Thread Oscar Benjamin
Yes, you can do that with ImageSet: In [11]: ImageSet(Lambda(t, (t, t)), Interval(0, 1)) Out[11]: {(t, t) | t ∊ [0, 1]} In [14]: ImageSet(Lambda(t, (t**2, t, 1-t)), Interval(0, 1)) Out[14]: ⎧⎛ 2 ⎞ ⎫ ⎨⎝t , t, 1 - t⎠ | t ∊ [0, 1]⎬ ⎩ ⎭ On Tue, 1 Oct

Re: [sympy] Re: Can SymPy's existing set implementation handle parameterized curves?

2019-10-01 Thread Oscar Benjamin
Yeah, a lot of work is needed in sets. I see that error on master but not on my PR: https://github.com/sympy/sympy/pull/17593 There it doesn't raise but just returns unevaluated: In [3]: simplify(a.intersect(b)) Out[3]: {(t, t) | t ∊ [0, 1]} ∩ {(1 - t, t) | t ∊ [0, 1]} There is no code to

Re: [sympy] PROPOSAL: ban explicit class constructors in SymPy

2019-11-09 Thread Oscar Benjamin
I do plan to do this after the next release. There are some details to work through in making something that works for all of Basic. The Function model with eval works well but I'm not sure that it would work for everything else. I think that we need to move the logic that is currently in __new__

Re: [sympy] How to release SymPy more often

2019-11-17 Thread Oscar Benjamin
On Sun, 17 Nov 2019 at 05:01, Aaron Meurer wrote: > > Thinking more about the automation, I think we need to have the > release be 100% automated. Right now it is 90% automated (not counting > the problem of fixing blocker issues). > > Oscar, it will be a good idea to make a note of anything in

[sympy] SymPy 1.5 Beta 1 released

2019-11-17 Thread Oscar Benjamin
Hi SymPy users and contributors, It is my pleasure to announce the *beta release* of SymPy 1.5. This is is intended for advance testing rather than production use. I have just made version 1.5b1 available to install as a pre-release from PyPI. You can install this with $ pip install --pre

  1   2   3   4   5   6   7   8   >