Aaron Meurer | 15 Apr 22:55 2014
Picon

Taking down older versions of our docs

We currently host a lot of old versions of our docs at docs.sympy.org. I don't really like this though, because too many people end up at old versions of the docs. For example, if you google "sympy matrices" you end up at the 0.7.2 docs. 

Should we remove the old versions of the docs, possibly adding redirects to the latest pages so that links don't break?

If not, does anyone know how to automatically add a "These docs are for an old version, find the latest version here" banner to the top of every old docs page?

Aaron Meurer

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6KKgFrYzsv_c1mCAz7HSkm6hgpEPwvkvTXTpoSH9-SYUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
F. B. | 15 Apr 11:04 2014
Picon

SymPy args and multiple dispatch

In a recent PR I submitted it emerged that using sympy's Tuple instead of list or tuple seems to cause a significant slow down of the code execution. I blamed this behavior to the necessity of copying data from the list to the Tuple object once the list has been created.

Currently args in sympy objects are required to be subtypes of Basic, so that methods such as xreplace(), subs(), has(), match() become available. These are inherited from Basic. Technically, these methods could be applied also to non-sympy structures, maybe by dynamically adding new methods to existing classes at runtime. Unfortunately duck-typing does not work on builtins.

What about turning methods such as xreplace(), subs(), has(), atoms(), match() to multiple dispatched functions? They would work the same way as inherited methods, with the possibility of defining such functions on python builtins, e.g.

<at> dispatch(tuple, dict)
def xreplace(t, d):  # t -> tuple upon which to act, d -> replacements dict
   
return tuple([xreplace(i, d) for i in t])

Python is likely to recognize tuple operations an apply better optimizations than on Tuple.

In such a way it would be possible to include python builtin types and maybe even external objects (provided they are immutable) into the args tree.

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/b3d0e629-f859-4d6e-80ce-4e2e211cc185%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
A L | 15 Apr 01:35 2014
Picon

Elementary operations on rows (or columns) in Sympy

Hi all.
I am quite new to Sympy. I am studying several tutorials, starting from those on the official site and some presentation in Ipython format.
Concerning the various methods about matrices, I still did not find the commands to perform the elementary operations on rows (or columns). For example in Sage there are the following functions:
  • swap_rows() - interchange two rows
  • rescale_row() - scale a row by using a scale factor
  • add_multiple_of_row() - add a multiple of one row to another row, replacing the row

I did not find the equivalent commands in Sympy. Am I missing something? Could you please give me some indications?

Thanks.


-

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/0b81c32b-2da9-48ef-84d1-9f0253d6e239%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ymermoud | 10 Apr 16:07 2014
Picon

Solving LSE in terms of specific variables

Hi there

I have the following LSE:

Vm,Vp,Vinm,Vinp,Io,Ref,R1,R3,R4,R2a,R2b,Vo= symbols("V_- V_+ V_in- V_in+ I_out Ref R_1 R_3 R_4 R_2a R_2b V_out")

System = [(Vm-Vinm)/R3 - (Vo-Vm)/R4,\
         
(Vp-Vinp)/R1 - (Vo-Io*R2b-Vp)/R2a,\
         
Vm-Vp,\
         
]

which I want to solve for Io. So i do:

solve(System, Io)

...this returns an expression for Io which is a rewrite of eq (2).

(
-R_1*V_+ + R_1*V_out - R_2a*V_+ + R_2a*V_in+)/(R_1*R_2b)

Know I'd like to have Io expressed in therms of all variables BUT Vo, which means that the therm Vo of equation (2) needs to be substituted by eq (1).

So I tried

solve(System, Io, exclude=[Vo])

But this returns exactly the same result as above.

How can I tell sympy to resolve this LSE against Io with substituting Vo ?

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/da88c35a-fb9a-49c8-ad0e-e2e84fa5d0b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
SAHIL SHEKHAWAT | 10 Apr 15:40 2014
Picon

What "count_ops()" means?

Hey everyone, I have been working with count_ops() so that logic functions can also be counted as an operation but there has been a bit of confusion about its real meaning.

Firstly, I don't want to count "Basic(x)" as an operation as all the expression reaching this functions (even if they are Symbols) are themselves instances of "Basic" class, and "Expr(x).count_ops()" also returns 0 which is the way Sympy handles other expressions. So, Should i include it?

Secondly, Logic functions don't raise exceptions when:
   1) There are less number of arguments then required. like
               
    IN  [1] : And(x)
    OUT[1]: x
   
   2) When any argument of logic function is an empty tuple

   IN   [2]: sympify(And( x, () ))
   OUT[2]: And( (), x)
  
   3) Expressions which don't even make sense are executed without even a hiccup 

   IN   [3]: And( x, (x,y) )
   OUT[3]: And( x, (x,y) )
   
These bugs in the logic function are resulting in all types of funny results while using "count_ops()" (After my codes). So , should i take care of all these bugs in the "count_ops()" 's code?
Please help me by reviewing my PR https://github.com/sympy/sympy/pull/7303 as this is for my Gsoc's patch. 
Any type of help is highly appreciated. Thanks

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/b27dc142-59b3-42c9-848a-861738a7163f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Groover | 9 Apr 14:32 2014
Picon

Unicode Output

Hi, I am making progress with SymPy (git-master) and IronPython 2.7.5b1. Now I would like to get Unicode output working. Here is my script:

import sympy
from sympy import *

# output chinese character
val
= u'\u76d8'
print val
print

# output integral
x
= Symbol('x')
pprint(Integral(sqrt(1/x), x), use_unicode=True)

And here is the output:

http://www.britishideas.com/forumimages/sympy-unicode.png

You can see that the Chinese character printed OK. My terminal is using UTF-16. If I set it ti UTF-8 then SymPy only outputs junk.

Any hints or things to try? Thanks.

Andy

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/4bf6b581-9d74-4f76-9238-e7e00ed10966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
farrokh959 | 9 Apr 08:00 2014
Picon

Sympy Installation Problem

I have gotten into trouble with sympy installation on my PC. I wanna to install it on win 7 64 bit with python 2.6.2 amd 64 but I get the following error:

Traceback (most recent call last):
File "D:\Python26\Lib\site-packages\sympy-0.7.5\setup.py", line 37, in <module

import sympy

File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy__init__.py", line 35, i
n
from .polys import *
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\polys__init__.py", line
5, in
from . import polytools
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\polys\polytools.py", lin
e 52, in
from sympy.polys.domains import FF, QQ
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\polys\domains__init__.p
y", line 9, in
from . import finitefield
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\polys\domains\finitefiel
d.py", line 7, in
from sympy.polys.domains.groundtypes import SymPyInteger
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\polys\domains\groundtype
s.py", line 13, in
from .pythonrational import PythonRational
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\polys\domains\pythonrati
onal.py", line 12, in
from sympy.printing.defaults import DefaultPrinting
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\printing__init__.py", l
ine 3, in
from .pretty import pager_print, pretty, pretty_print, pprint, \
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\printing\pretty__init__
.py", line 7, in
pprint_try_use_unicode()
File "D:\Python26\Lib\site-packages\sympy-0.7.5\sympy\printing\pretty\pretty_s
ymbology.py", line 90, in pretty_try_use_unicode
s.encode(encoding)
LookupError: unknown encoding: cp720

Please let me know if there is a solution.

Thank you in advance.

Mojtaba

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/b9dbf3b7-baef-411a-9546-291905a1d469%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ondřej Čertík | 9 Apr 00:06 2014
Picon

Finding roots of higher order polynomial

Hi,

We have this problem here -- we need to find numerical roots of a
higher order polynomial and it's immediate in Mathematica, and
virtually infinite in SymPy:

https://github.com/sympy/sympy/issues/7386

For our application, we just need few digits, but ultimately, we would
like arbitrary precision as well. The polynomial has integers that can
be larger. See the issue for more details.

If anybody has any ideas what the state of the art algorithms are for
finding the roots, please let me know.

Ondrej

--

-- 
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@...
To post to this group, send email to sympy@...
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CADDwiVAwrk%3D8ekQ_EJ2TSzhc_-MTyPQKCPWJpGDCRBnKN_2nTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Björn Dahlgren | 7 Apr 17:34 2014
Picon

Express Dervivative in terms of finite differences.

After reading Aaron's recommendation about looking for unanswered sympy questions at stackoverflow I stumbled upon:

http://stackoverflow.com/questions/18701290/derivatives-discretization-with-sympy

I implemented a solution for this and it is available as a WIP PR over here:
https://github.com/sympy/sympy/pull/7382

I would love to hear your feedback on this.

Best regards
/Björn

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/a59c9945-2132-42b6-a65a-c3f7c595bb3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Groover | 6 Apr 15:09 2014
Picon

SymPy and IronPython

OK, I really would like to get this working with the current release of IronPython (2.7.4). Any suggestions are appreciated. Using git master:

>>>import sympy

unicode_escape_decode
() takes no arguments (1 given)

I defined a replacement function for the codecs module:

import codecs
def my_unicode_escape_decode(x):
   
return x
codecs
.unicode_escape_decode = my_unicode_escape_decode

Now:

>>>import sympy
'module' object has no attribute 'mpmath'

>>>import sympy.mpmath
'module'object has no attribute 'mpmath'

Displaying sys.path shows "..\..\PythonLib".

PythonLib is where all the standard Python 2.7 libraries are. In there I have copied sympy into a sub-folder. So I have:

PythonLib\sympy\__init__.py
PythonLib\sympy\assumptions\__init__.py
etc, etc.

Any suggestions on what to try next? Thanks.

Andy


--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/10f03aa6-dfea-4454-bd00-6a860f4bf8a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Groover | 5 Apr 13:00 2014
Picon

zip() argument after * must be a sequence

Hello,

It's been 20 years since I did any calculus, so please be gentle. :)

Using SymPy 0.7.2 and IronPython 2.7.4.

import sympy
from sympy import *

# calculate arc length
x = symbol('x')
d = diff(2 * pow(x, 2), x)
print d
length = integrate(sqrt(1 + pow(d, 2)), (x, 5, 10))
print length

This outputs '4*x' as expected then 'zip() argument after * must be a sequence, not dictionary-itemiterator'.

I believe the integration is solvable to 75.173 [1], so I assume I have an error in my Python and/or SymPy syntax. Can anyone please give me some pointers? Thanks!

[1] http://www.integral-calculator.com/#expr=sqrt%281%2B%284x%5E2%29%29&ubound=10&lbound=5

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/dfee71bf-d071-44a8-8772-f8d8f75ae855%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane