|
|
last edited 15 years ago by page |
1 2 3 4 | ||
Editor: page
Time: 2007/09/19 00:53:07 GMT-7 |
||
Note: |
changed: - Running SymPy in a SageBlock SymPy initialization: \begin{sageblock} #sys.path.append("/home/page/sympy") import sympy # the follow command is only needed because we are running SymPy inside Sage Integer = int \end{sageblock} We are running SymPy version: $\sage{sympy.__version__}$ First simple confidence test: \begin{sageblock} from sympy import Symbol a=Symbol('a') b=Symbol('b') c=Symbol('c') e=( a*b*b+2*b*a*b )**c \end{sageblock} The resulting SymPy expression is: \begin{verbatim} print e \end{verbatim} \begin{equation} \sage{e} \end{equation} Limits Here is a simple limit in SymPy \begin{sageblock} from sympy import limit x = Symbol("x") e=limit((3**(1/x)+5**(1/x))**x, x, 0) \end{sageblock} and the result is: \begin{equation} \sage{e} \end{equation} Unfortunately for this limit Axiom gives: $\sage{axiom('limit((3**(1/x)+5**(1/x))**x, x=0)::OutputForm')}$. And Maxima gives: $\sage{maxima('limit((3**(1/x)+5**(1/x))**x, x, 0)')}$. So the Axiom and Maxima developers have some more work to do! But worse, Reduce actually gets it wrong... \begin{reduce} limit((3**(1/x)+5**(1/x))**x, x,0); \end{reduce} From robert.dodier Fri Apr 20 15:22:26 -0500 2007 From: robert.dodier Date: Fri, 20 Apr 2007 15:22:26 -0500 Subject: question about limit Message-ID: <20070420152226-0500@wiki.axiom-developer.org> Hello, about this limit problem, limit((3^(1/x) + 5^(1/x))^x, x, 0), I seem to find that the limit is different depending on whether 0 is approached from above or below. (I get 5 as the limit from above, and 3 as the limit from below.) So either "failed" or "und" (undetermined) seems like an acceptable response, and 5 is OK only with qualification; it doesn't seem right to return 5 unqualified. From kratt6 Fri Apr 20 15:56:42 -0500 2007 From: kratt6 Date: Fri, 20 Apr 2007 15:56:42 -0500 Subject: see Gruntz Message-ID: <20070420155642-0500@wiki.axiom-developer.org> Very likely, the implementation computes by default the limit from above. I guess that Gruntz' algorithm is restricted to the real case, but I do not know. Martin From billpage Fri Apr 20 17:59:01 -0500 2007 From: billpage Date: Fri, 20 Apr 2007 17:59:01 -0500 Subject: left and right limits can be different (not two-sided) but ... Message-ID: <20070420175901-0500@wiki.axiom-developer.org> For this limit, approaching from the right, Axiom gives: $\sage{axiom('limit((3**(1/x)+5**(1/x))**x, x=0,"right")::OutputForm')}$ and from the left: $\sage{axiom('limit((3**(1/x)+5**(1/x))**x, x=0,"left")::OutputForm')}$; while Maxima gives: left (from below): $\sage{maxima('limit((3**(1/x)+5**(1/x))**x, x, 0,minus)')}$, right (from above): $\sage{maxima('limit((3**(1/x)+5**(1/x))**x, x, 0,plus)')}$. From billpage Fri Apr 20 18:26:50 -0500 2007 From: billpage Date: Fri, 20 Apr 2007 18:26:50 -0500 Subject: Dominik Gruntz Message-ID: <20070420182650-0500@wiki.axiom-developer.org> "Axiom Reference":http://portal.axiom-developer.org/refs/articles/gruntz-limits-th11432.pdf/file_view **On Computing Limits in a Symbolic Manipulation System;** Dominik Gruntz. "ETH Diss 11432":http://www.cs.fh-aargau.ch/~gruntz/publications2.html "abstract":ftp://ftp.inf.ethz.ch/pub/publications/dissertations/th11432.abstract "postscript":ftp://ftp.inf.ethz.ch/pub/publications/dissertations/th11432.ps.gz , 1996.
Running SymPy in a SageBlockSymPy initialization:
\begin{sageblock} #sys.path.append("/home/page/sympy") import sympy # the follow command is only needed because we are running SymPy inside Sage Integer = int \end{sageblock}
We are running SymPy version: $\sage{sympy.__version__}$
First simple confidence test:
\begin{sageblock} from sympy import Symbol a=Symbol(
a
) b=Symbol(b
) c=Symbol(c
) e=( abb+2bab )*c \end{sageblock}The resulting SymPy expression is:
\begin{verbatim} print e \end{verbatim}
\begin{equation} \label{eq1} \sage{e} \end{equation}
Limits
Here is a simple limit in SymPy
\begin{sageblock} from sympy import limit x = Symbol("x") e=limit((3(1/x)+5(1/x))**x, x, 0) \end{sageblock}
and the result is:
\begin{equation} \label{eq2} \sage{e} \end{equation}
Unfortunately for this limit Axiom gives: $\sage{axiom(
limit((3**(1/x)+5**(1/x))**x, x=0)::OutputForm
)}$.And Maxima gives: $\sage{maxima(
limit((3**(1/x)+5**(1/x))**x, x, 0)
)}$.So the Axiom and Maxima developers have some more work to do!
But worse, Reduce actually gets it wrong...
limit((3**(1/x)+5**(1/x))**x, x,0); | reduce |
Martin
limit((3**(1/x)+5**(1/x))**x, x=0,"right")::OutputForm
)}$
and from the left:
$\sage{axiom(limit((3**(1/x)+5**(1/x))**x, x=0,"left")::OutputForm
)}$;
while Maxima gives:
left (from below): $\sage{maxima(limit((3**(1/x)+5**(1/x))**x, x, 0,minus)
)}$,
right (from above): $\sage{maxima(limit((3**(1/x)+5**(1/x))**x, x, 0,plus)
)}$.
On Computing Limits in a Symbolic Manipulation System; Dominik Gruntz. ETH Diss 11432 abstract postscript , 1996.
sage: unset PYTHONPATH; PATH=/usr/local/bin:$PATH HOME=/var/zope/var/LatexWiki sage 4110322647062224839-18px.sage
Traceback (most recent call last):
File "4110322647062224839-18px.py", line 26, in <module>
e=limit((Integer(3)(Integer(1)/x)+Integer(5)(Integer(1)/x))**x, x, Integer(0))
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, *kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 138, in __new__
return InfLimit(expr.subs(x, xlim+1/xoo), xoo)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 223, in __new__
result = S.Exp(expr.exp S.Log(expr.base)).inflimit(x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic.py", line 995, in inflimit
return Basic.InfLimit(self, x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 228, in __new__
result = expr.func([a.inflimit(x) for a in expr.args])
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic.py", line 995, in inflimit
return Basic.InfLimit(self, x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, *kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 231, in __new__
result = mrv_inflimit(expr, x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, *kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 257, in mrv_inflimit
r = c.inflimit(x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic.py", line 995, in inflimit
return Basic.InfLimit(self, x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, *kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 231, in __new__
result = mrv_inflimit(expr, x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, *kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 257, in mrv_inflimit
r = c.inflimit(x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic.py", line 995, in inflimit
return Basic.InfLimit(self, x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, *kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 231, in __new__
result = mrv_inflimit(expr, x)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/core/basic_methods.py", line 122, in wrapper
func_cache_it_cache[k] = r = func(args, *kw_args)
File "/usr/local/sage-2.6/local/lib/python2.5/site-packages/sympy/series/limits_newcore.py", line 238, in mrv_inflimit
raise RuntimeError(Detected recursion while computing mrv_inflimit(%s, %s)
% (expr, x))
RuntimeError: Detected recursion while computing mrv_inflimit(1/_xoolog(exp(_xoolog(3)) + exp(_xoo*log(5))), _xoo)