Skip to content

Instantly share code, notes, and snippets.

@edgarcosta
Created June 4, 2021 14:41
Show Gist options
  • Save edgarcosta/6ba59b0f53a94455f83c2166288cb479 to your computer and use it in GitHub Desktop.
Save edgarcosta/6ba59b0f53a94455f83c2166288cb479 to your computer and use it in GitHub Desktop.
│ SageMath version 9.3, Release Date: 2021-05-09 │
│ Using Python 3.9.5. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: integrand=(x+(1+x)^(1/2))^(1/2)/(x^2+1)/(1+x)^(1/2)
sage: integrate(integrand, x, algorithm="giac")
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/expect.py in __init__(self, parent, value, is_name, name)
1467 try:
-> 1468 self._name = parent._create(value, name=name)
1469 # Convert ValueError and RuntimeError to TypeError for
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/interface.py in _create(self, value, name)
499 name = self._next_var_name() if name is None else name
--> 500 self.set(name, value)
501 return name
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/giac.py in set(self, var, value)
662 cmd = '%s:=%s:;'%(var,value) #if giac is not in maple mode ( maple_mode(0))
--> 663 out = self.eval(cmd)
664 if out.find("error") != -1:
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/giac.py in eval(self, code, strip, **kwds)
646 code = code.replace("\n","").strip()
--> 647 ans = Expect.eval(self, code, strip=strip, **kwds).strip()
648 return ans
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/expect.py in eval(self, code, strip, synchronize, locals, allow_use_file, split_lines, **kwds)
1380 elif split_lines:
-> 1381 return '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)
1382 for L in code.split('\n') if L != ''])
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/expect.py in <listcomp>(.0)
1380 elif split_lines:
-> 1381 return '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)
1382 for L in code.split('\n') if L != ''])
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/giac.py in _eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed)
615 if z.lower().find("error") != -1:
--> 616 raise RuntimeError("An error occurred running a Giac command:\nINPUT:\n%s\nOUTPUT:\n%s"%(line, z))
617 lines = (line for line in z.splitlines()
RuntimeError: An error occurred running a Giac command:
INPUT:
sage2:=int(sage0,x):;
OUTPUT:
*** Warning: increasing stack size to 2048000.
Unable to convert to real -5.4348792461126750008981111610946592130*E43 Error: Bad Argument Value
Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):
Check [abs(t_nostep)]
Evaluation time: 2.12
"iquo Error: Bad Argument Type"
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
<ipython-input-2-372f79d10c8f> in <module>
----> 1 integrate(integrand, x, algorithm="giac")
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/misc/functional.py in integral(x, *args, **kwds)
757 """
758 if hasattr(x, 'integral'):
--> 759 return x.integral(*args, **kwds)
760 else:
761 from sage.symbolic.ring import SR
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.integral (build/cythonized/sage/symbolic/expression.cpp:66858)()
12645 R = SR
12646 return R(integral(f, v, a, b, **kwds))
> 12647 return integral(self, *args, **kwds)
12648
12649 integrate = integral
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/symbolic/integration/integral.py in integrate(expression, v, a, b, algorithm, hold)
988 if not integrator:
989 raise ValueError("Unknown algorithm: %s" % algorithm)
--> 990 return integrator(expression, v, a, b)
991 if a is None:
992 return indefinite_integral(expression, v, hold=hold)
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/symbolic/integration/external.py in giac_integrator(expression, v, a, b)
440 ex = expression._giac_()
441 if a is None:
--> 442 result = ex.integrate(v._giac_())
443 else:
444 result = ex.integrate(v._giac_(), a._giac_(), b._giac_())
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/giac.py in integral(self, var, min, max)
1170 """
1171 if min is None:
-> 1172 return giac('int(%s,%s)' % (self.name(), var))
1173 else:
1174 if max is None:
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/interface.py in __call__(self, x, name)
293
294 if isinstance(x, str):
--> 295 return cls(self, x, name=name)
296 try:
297 # Special methods do not and should not have an option to
/Applications/sage-dev/local/lib/python3.9/site-packages/sage/interfaces/expect.py in __init__(self, parent, value, is_name, name)
1471 except (RuntimeError, ValueError) as x:
1472 self._session_number = -1
-> 1473 raise TypeError(*x.args)
1474 except BaseException:
1475 self._session_number = -1
TypeError: An error occurred running a Giac command:
INPUT:
sage2:=int(sage0,x):;
OUTPUT:
*** Warning: increasing stack size to 2048000.
Unable to convert to real -5.4348792461126750008981111610946592130*E43 Error: Bad Argument Value
Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):
Check [abs(t_nostep)]
Evaluation time: 2.12
"iquo Error: Bad Argument Type"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment