ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 08 Jan 2019 05:15:39 -0600Solved: Why does integrate(psi(y)*f(y),y) return an error but integrate(psi(t,y)*f(t,y),y) works?http://ask.sagemath.org/question/43287/solved-why-does-integratepsiyfyy-return-an-error-but-integratepsityftyy-works/Hi there,
I am trying get an symbolic expression for the convolution
$$ (\psi \star f)(x) := \int\limits_{\mathbb{R}} \psi(x-y) f(y) {d y} $$
of two functions
$
f, \psi: \mathbb{R} \to \mathbb{R}
$
as follows:
<code>
var('y') <br>
psi = function('psi')(y) <br>
f = function('f')(y) <br>
integrate(psi(x-y)*f(y),y)
</code>
upon which I get the error message
> RuntimeError: ECL says: Error executing code in Maxima:
If I add an extra argument to the two functions and define them as
$$ f, \psi : \mathbb{R} \times \mathbb{R} \to \mathbb{R} $$
as follows:
<code>
var('t') <br>
psi = function('psi')(t,y) <br>
f = function('f')(t,y) <br>
integrate(psi(t,x-y)*f(t,y),y)
</code>
there is a surprise, *it suddenly works!*
I get the desired symbolic expression on which I can run diff(..,x) and all the other built-in functions.
**TL;DR**
Why does <code>integrate(psi(y)*f(y),y)</code> return an error?
**Solution**
Use sympy backend for symbolic integration as in
<code>integrate(psi(x-y)*f(y),y, algorithm="sympy")</code>hausdorffWed, 08 Aug 2018 06:41:12 -0500http://ask.sagemath.org/question/43287/Can't display figureshttp://ask.sagemath.org/question/44953/cant-display-figures/hello,
i installed Sage on a new computer this morning,
but i can't display any figures.
That's the error i get :
> /home/xxx/Documents/SageMath/local/lib/python2.7/site-packages/sage/\
repl/rich_output/display_manager.py:592: RichReprWarning: Exception in
_rich_repr_ while displaying object: libtk8.6.so: cannot open shared
object file: No such file or directory
RichReprWarning,
Graphics object consisting of 1 graphics primitive
Anyone got an idea why?
i'm using the notebook of sagemaths
Thanks.tommeTue, 08 Jan 2019 05:15:39 -0600http://ask.sagemath.org/question/44953/solve() is not giving the right solutionshttp://ask.sagemath.org/question/44292/solve-is-not-giving-the-right-solutions/Hey there,
i need your help on this one. The following sage code is giving me a headache:
- f(x) = x^3 + x^2 - 0.1
- solve(f==0, x)
- -->
- [x == -1/2*(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3)*(I*sqrt(3) + 1) - 1/18*(-I*sqrt(3) + 1)/(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) - 1/3, x == -1/2*(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3)*(-I*sqrt(3) + 1) - 1/18*(I*sqrt(3) + 1)/(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) - 1/3, x == (1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) + 1/9/(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) - 1/3]
So i'm getting these 3 solutions, but they are not in R (real numbers), which they should be.
Im figuring there is some problem with really long terms or something? Is there an easy solution for this? Is the solve()-method here working as intended?
Regards,
BenbentheteacherThu, 15 Nov 2018 08:17:54 -0600http://ask.sagemath.org/question/44292/Cocalc in problem - files disappearinghttp://ask.sagemath.org/question/43366/cocalc-in-problem-files-disappearing/Just now I was working on cocalc and several files suddenly disappeared.
Could anyone tell me what is happening?
I don't need quite a certain answer, I just want some advice.pizzaMon, 13 Aug 2018 12:08:34 -0500http://ask.sagemath.org/question/43366/See and access sage-5.10 folder but get no "such file or directory" messagehttp://ask.sagemath.org/question/41295/see-and-access-sage-510-folder-but-get-no-such-file-or-directory-message/I have installed sage-5.10 in my laptop with Ubuntu 13.04. The folder with sage-5.10 is there, clicking in the folder I can see all the folders and files inside it on any level. Have being using a worksheet for a while with some calculations. I start my sage worksheet in my terminal changing directory
cd /home/alien/Desktop/Sage/sage-5.10
then
./sage
then
notebook()
But suddenly when making the cd /home/alien/Desktop/Sage/sage-5.10 I'm getting the message "No such file or directory". So can't start again sage and using my worksheet. How can I solve this problem?.alienTue, 27 Feb 2018 19:48:52 -0600http://ask.sagemath.org/question/41295/How can I log in to my sage v 7.2 notebook?http://ask.sagemath.org/question/35317/how-can-i-log-in-to-my-sage-v-72-notebook/ I remember my password but apparently forgot my username, so when I try to log in from the browser
I get
Error: Username is not in the system
Someone said try: login admin, password sage but that gives
Error: Wrong password
Someone said from the terminal prompt (I am on a Mac) do
notebook(reset=True)
that gives
-bash: syntax error near unexpected token `reset=True'
Someone said do
notebook(interface='',secure=True)
that gives
-bash: syntax error near unexpected token `interface='',secure=True'
This seems totally insane since my copy of SAGE is for my personal use only, so there should logically be no need for a
login, and all I did was force-quit SAGE to restart the computer and create disk space,
and now I am locked out of my own worksheets.
HELP, PLEASE!!!!alMon, 31 Oct 2016 17:57:21 -0500http://ask.sagemath.org/question/35317/The perimeter of a rectangle is 600 yards. What are the dimensions of the rectangle if the length is 10 yards more than the width?http://ask.sagemath.org/question/35036/the-perimeter-of-a-rectangle-is-600-yards-what-are-the-dimensions-of-the-rectangle-if-the-length-is-10-yards-more-than-the-width/The perimeter of a rectangle is 600 yards. What are the dimensions of the rectangle if the length is 10 yards more than the width? mgraceb16Mon, 03 Oct 2016 00:58:44 -0500http://ask.sagemath.org/question/35036/This is not a question - ignorehttp://ask.sagemath.org/question/34607/this-is-not-a-question-ignore/This is just a test, because I wrote a long and complex question and the forum wouldn't upload it.BobMSat, 27 Aug 2016 03:23:08 -0500http://ask.sagemath.org/question/34607/Problem installing SageMath in a MAC OS 10.11http://ask.sagemath.org/question/32915/problem-installing-sagemath-in-a-mac-os-1011/ I tried to install SageMath on my Mac but I've been not able. The install.log is the following. Any suggestions how to fix the problem?
---------
*** ALL ENVIRONMENT VARIABLES BEFORE BUILD: ***
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.lVkhkEeHUb/Render
DISPLAY=/private/tmp/com.apple.launchd.EQE2TENF0c/org.macosforge.xquartz:0
HOME=/Users/Beebee
LANG=en_US.UTF-8
LOGNAME=Beebee
MAKE=make
MAKEFLAGS=
MAKELEVEL=1
MFLAGS=
PATH=/Users/Beebee/Downloads/SageMath/build/bin:/Users/Beebee/Downloads/SageMath/src/bin:/Users/Beebee/Downloads/SageMath/local/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin
PWD=/Users/Beebee/Downloads/SageMath/build/make
PYTHONPATH=/Users/Beebee/Downloads/SageMath/local
SAGE_EXTCODE=/Users/Beebee/Downloads/SageMath/local/share/sage/ext
SAGE_LOCAL=/Users/Beebee/Downloads/SageMath/local
SAGE_LOGS=/Users/Beebee/Downloads/SageMath/logs/pkgs
SAGE_ORIG_PATH=/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin
SAGE_ORIG_PATH_SET=True
SAGE_ROOT=/Users/Beebee/Downloads/SageMath
SAGE_SHARE=/Users/Beebee/Downloads/SageMath/local/share
SAGE_SPKG_INST=/Users/Beebee/Downloads/SageMath/local/var/lib/sage/installed
SAGE_SRC=/Users/Beebee/Downloads/SageMath/src
SAGE_VERSION=7.1
SECURITYSESSIONID=186a6
SHELL=/bin/bash
SHLVL=4
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Ew8hsTGnj3/Listeners
TERM=xterm-256color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=361.1
TERM_SESSION_ID=C282CC30-020E-476B-8C1A-848A7B995B2B
TMPDIR=/var/folders/_6/0pq5yd_55ndd9bzsp1v7znq80000gn/T/
USER=Beebee
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
***********************************************
make base
sage-logger 'sage-spkg patch-2.7.5' '/Users/Beebee/Downloads/SageMath/logs/pkgs/patch-2.7.5.log'
Found local metadata for patch-2.7.5
/Users/Beebee/Downloads/SageMath/build/bin/../sage_bootstrap/cmdline.py:78: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/Users/Beebee/Downloads/SageMath/build/bin/sage-download-file", line 27, in <module>
from sage_bootstrap.cmdline import SageDownloadFileApplication
File "/Users/Beebee/Downloads/SageMath/build/bin/../sage_bootstrap/cmdline.py", line 78
except TypeError as err:
^
SyntaxError: invalid syntax
make[2]: *** [/Users/Beebee/Downloads/SageMath/local/var/lib/sage/installed/patch-2.7.5] Error 1
make[1]: *** [all-toolchain] Error 2
real 0m0.180s
user 0m0.087s
sys 0m0.086s
***************************************************************
Error building Sage.
The following package(s) may have failed to build (not necessarily
during this run of 'make all'):
The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.
BeebeeWed, 30 Mar 2016 12:32:43 -0500http://ask.sagemath.org/question/32915/Problem with numpy integers and floatshttp://ask.sagemath.org/question/10656/problem-with-numpy-integers-and-floats/1) 1st problem
sage: import numpy as np
sage: a = np.int64(4343678784233766587)
sage: b = np.int64(149)
sage: a*b
1572096270996914903
the answer is wrong; it should be 647208138850831221463
1) 2nd problem
sage: a = np.int64(3344773437777732743)
sage: b = np.int64(181)
sage: a*b
-3338562194645576845
the answer is negative, How Come ???
1) 3rd problem
sage: a = np.float64(3344773437777732743)
sage: b = np.float64(181)
sage: a*b
6.0540399223776962e+20 #the exact answer is 605403992237769626483
Why doesn't it give me all the numbers instead of this e*20 ???
Moreover, i just used normal int of sage (`<type 'sage.rings.integer.Integer'>`
) without using numpy and it works fine !!!
Thank you in advance.
Mohamed GaafarFri, 25 Oct 2013 08:11:00 -0500http://ask.sagemath.org/question/10656/Number of line segments in a group - algorithmhttp://ask.sagemath.org/question/10252/number-of-line-segments-in-a-group-algorithm/Hi experts!
Im a newby SAGE, SciPy, Numpy and Python user.
I'm trying to write an algorithm that accounts for how many straight segment groups ('clusters') of a given dimension (dimension = number of lines that form the cluster).
Each line in my algorith is random-generated and characterized by his start point (xi,yi) and his end-point (xf,yf).
For example, in the image attached
http://subefotos.com/ver/?8818abc218ccd909f8c0bba71446c3b5o.png
there are: one cluster formed by 9 line segments, one cluster consists of four line segments, one cluster consists of five line segments, two cluster formed by three line segments, four cluster formed by two line segments and one cluster consists of one single line segments.
Until now i only could write a code that generates a matrix of NxN (where N = total number of line segments ). In this matrix, the element located in row A column B is 'True' if the segment A is cut with segment B, and its value is 'False' if that two segments are NOT intersect.
¿Any idea?
Waiting for your answers.
Thanks a lot!
mresimulatorTue, 18 Jun 2013 08:39:38 -0500http://ask.sagemath.org/question/10252/updating sagehttp://ask.sagemath.org/question/9958/updating-sage/I have windows 7.
I download sage 5.7, but when I have to import to virtualbox doesn't work and only respond "error importando servicio virtualizado"; so i have to work with a previous version sage 4.72
Now i'm downloading sage 5.8 and i hope it works; if I have success importing sage to virtualbox, what should i do? Delete sage 4.72 and then install sage 5.8? What happens with all my worksheets?
Thanks!ugajardoMon, 01 Apr 2013 08:18:13 -0500http://ask.sagemath.org/question/9958/How to resolve the problem of Sage app version in Lionhttp://ask.sagemath.org/question/8860/how-to-resolve-the-problem-of-sage-app-version-in-lion/I have managed to find a solution to the ones that has lion and cannot start Sage from the applications
directory. These are the instructions:
1. Open the terminal window
2. Type `login` and enter your username as user and password as your password in Mac OSX
3. Type
cd /Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage
4. type
./sage -notebook
5. it will set the required permissions and ask for a login password. So select a password.
Congragulations! you can now start sage app whenever you want to.
NajiThu, 05 Apr 2012 05:13:04 -0500http://ask.sagemath.org/question/8860/sage -i fails to find optional package database_gaphttp://ask.sagemath.org/question/8969/sage-i-fails-to-find-optional-package-database_gap/running ./sage -optional and then ./sage -i database_gap-4.4.12.pl.spkg using sage -i as per README instructions (which is not recognized) or ./sage -i database_gap-4.4.12.pl.spkg, with or without extension .spkg produces the same message:
*Unable to download database_gap-4.4.12.pl
*Please see http://www.sagemath.org//packages for a list of valid
*packages or check the package name.
The package exists so I should be able to download it and install using wget or Firefox. The question is: Is this advisable; is this package separate from Sage and can be called by sage, or do I need to use sage -i to integrate it?Richard BentleySat, 12 May 2012 10:59:19 -0500http://ask.sagemath.org/question/8969/Import problemhttp://ask.sagemath.org/question/7486/import-problem/Hi all:
I'm editing sage.categories.quotient_fields and trying to import the algebraic_dependence() function. When i do so by inserting
from sage.rings.polynomial.multi_polynomial_sequence import algebraic_dependence
at the top of the file, saving, and rebuilding Sage, i get the following error when starting Sage. Is it some kind of circular importing problem?
AttributeError Traceback (most recent call last)
/Applications/sage/local/lib/python2.6/site-packages/IPython/ipmaker.pyc in force_import(modname, force_reload)
61 reload(sys.modules[modname])
62 else:
---> 63 __import__(modname)
64
65
/Applications/sage/local/bin/ipy_profile_sage.py in <module>()
5 preparser(True)
6
----> 7 import sage.all_cmdline
8 sage.all_cmdline._init_cmdline(globals())
9
/Applications/sage/local/lib/python2.6/site-packages/sage/all_cmdline.py in <module>()
12 try:
13
---> 14 from sage.all import *
15 from sage.calculus.predefined import x
16 preparser(on=True)
/Applications/sage/local/lib/python2.6/site-packages/sage/all.py in <module>()
66 from time import sleep
67
---> 68 from sage.misc.all import * # takes a while
69
70 from sage.misc.sh import sh
/Applications/sage/local/lib/python2.6/site-packages/sage/misc/all.py in <module>()
79 from func_persist import func_persist
80
---> 81 from functional import (additive_order,
82 sqrt as numerical_sqrt,
83 arg,
/Applications/sage/local/lib/python2.6/site-packages/sage/misc/functional.py in <module>()
34
35
---> 36 from sage.rings.complex_double import CDF
37 from sage.rings.real_double import RDF, RealDoubleElement
38
/Applications/sage/local/bin/integer.pxd in init sage.rings.complex_double (sage/rings/complex_double.c:15016)()
7
8
----> 9
10
11
/Applications/sage/local/bin/integer.pyx in init sage.rings.integer (sage/rings/integer.c:35507)()
169
170
--> 171
172
173
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/infinity.py in <module>()
198 #import sage.rings.real_mpfr
199 import sage.rings.integer
--> 200 import sage.rings.rational
201
202 from sage.rings.integer_ring import ZZ
/Applications/sage/local/bin/fast_arith.pxd in init sage.rings.rational (sage/rings/rational.c:25818)()
1
2
----> 3
4
5
/Applications/sage/local/bin/fast_arith.pyx in init sage.rings.fast_arith (sage/rings/fast_arith.c:7675)()
49
50
---> 51
52
53
/Applications/sage/local/bin/integer_ring.pyx in init sage.rings.integer_ring (sage/rings/integer_ring.c:11235)()
65
66
---> 67
68
69
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/rational_field.py in <module>()
914
915
--> 916 QQ = RationalField()
917 Q = QQ
918
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/rational_field.py in __init__(self)
210 ('x',)
211 """
--> 212 from sage.categories.basic import QuotientFields
213 ParentWithGens.__init__(self, self, category = QuotientFields())
214 self._assign_names(('x',),normalize=False) # ???
/Applications/sage/local/lib/python2.6/site-packages/sage/categories/basic.py in <module>()
46
47 from fields import Fields
---> 48 from quotient_fields import QuotientFields
49 from finite_fields import FiniteFields
50
/Applications/sage/local/lib/python2.6/site-packages/sage/categories/quotient_fields.py in <module>()
13 from sage.misc.abstract_method import abstract_method
14 from sage.misc.misc_c import prod
---> 15 from sage.rings.polynomial.multi_polynomial_sequence import algebraic_dependence
16
17 class QuotientFields(Category):
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_sequence.py in <module>()
154
155
--> 156 from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing
157 from sage.rings.quotient_ring import is_QuotientRing
158 from sage.rings.quotient_ring_element import QuotientRingElement
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_ring.py in <module>()
68
69 import sage.rings.integral_domain as integral_domain
---> 70 import sage.rings.fraction_field_element as fraction_field_element
71
72 from sage.rings.integer_ring import is_IntegerRing
/Applications/sage/local/bin/fraction_field_element.pyx in init sage.rings.fraction_field_element (sage/rings/fraction_field_element.c:9193)()
42
43
---> 44
45
46
AttributeError: 'module' object has no attribute 'ZZ'
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.
araichevThu, 02 Feb 2012 16:04:49 -0600http://ask.sagemath.org/question/7486/