Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium WrongResult
New issue 3267 by [email protected]: Error in limit of a rational
function
http://code.google.com/p/sympy/issues/detail?id=3267
The following function comes from a classical paper on the phase transition
of a molecular zipper: C. Kittel, Phase transition of a molecular zipper,
Am. J. Phys. 37, 917 (1969).
r(x) = (N+1)*x**(N+1)/(x**(N+1)-1) - x/(x-1)
In the limit of r going to 1 (on both sides), the function r(x) should
approach N/2. When computing the limit with sympy, one gets 0:
In [8]: x = Symbol('x')
In [9]: n = Symbol('n', integer=True, positive=True)
In [10]: r = (n+1)*x**(n+1)/(x**(n+1)-1) - x/(x-1)
In [11]: limit(r, x, 1)
Out[11]: 0
This was tested with the latest git version of Sympy:
8c3c03fb44d90af8968721a881c45d1cced572d5 (Sun May 13 23:45:19 2012 -0700)
There is a trick to get the right result. If one first writes the function
as a single fraction, then the limit is computed correctly.
In [14]: r = ((n+1)*x**(n+1)*(x-1)-(x**(n+1)-1)*x)/((x**(n+1)-1)*(x-1))
In [15]: limit(r, x, 1)
Out[15]:
n
─
2
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.