[sympy] Re: subclassing Poly

2009-09-08 Thread William Purcell
list(_.iter_all_coeffs()) does what I want. I will still take a look at Mateusz's work. Thanks for the help guys. Bill smichr wrote: If you use .iter_all_coeffs() I think you will get what you want: ### Poly(x**2+1,x) Poly(x**2 + 1, x) list(_.iter_all_coeffs()) [1, 0, 1] ###

[sympy] combining similar powers

2009-06-01 Thread William Purcell
I am trying to combine an expression containing similar exponents that are multiplied to each other ... In [20]: wn Out[20]: (1/m)**(1/2)*(k1 + k2 + k3)**(1/2) In [21]: together(wn) Out[21]: (1/m)**(1/2)*(k1 + k2 + k3)**(1/2) but I would like something like In [21]: together(wn) Out[21]:

[sympy] Re: understanding physics.units

2009-04-07 Thread William Purcell
On Tue, Apr 7, 2009 at 7:32 PM, Fredrik Johansson fredrik.johans...@gmail.com wrote: The simplest workaround would be to recognize simpler forms for units at the pretty-printing stage. For my particular application I need a simpler 'pretty form'. I am trying to do something similar to the

[sympy] Re: Printing Precision

2009-02-20 Thread William Purcell
A hack I'm going to use for now is changing the return in str.StrPrinter._print_Real to the following class StrPrinter ... ... def _print_Real(self, expr): prec = expr._prec if prec 5: dps = 0 else: dps = prec_to_dps(expr._prec)

[sympy] Re: Printing Precision

2009-02-20 Thread William Purcell
If you want, as an exercise, try to run all sympy tests with your patch to see if something gets broken. I ran the test_evalf test. (see Issue 1052http://code.google.com/p/sympy/issues/detail?id=1052). I will try running the other tests. Is there a 'top-level' script to do this? If not, try

[sympy] Printing Precision

2009-02-19 Thread William Purcell
I have seen issues 1019 and 1052 on how to handle printing of sig. digits but haven't seen a solution. I am running the attached script and getting things like pH = [ 95.0] [-40.0] [ 60.0] I preprocessing this script with another python script and inserting

[sympy] Using a CAS effectively.

2009-02-18 Thread William Purcell
All, To introduce myself, I am in my second semester of grad school at Southern Illinois University Edwardsville. I use python for pretty much everything I do programming wise but I am far from knowledgeable (about a year experience). I really enjoy programming and I try to make an excuse to

[sympy] Re: double angle formula

2009-02-16 Thread William Purcell
Ondrej, thanks for your quick reply. I implemented this functionality to trigsimp. I added lines 751-762 to simplify.simplify.trigsimp() as follows (for the future googler): - a,b,c = map(Wild,'abc') matchers = (