ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 20 Sep 2020 21:41:24 +0200can't append to graphics objecthttps://ask.sagemath.org/question/53519/cant-append-to-graphics-object/ I created a graphics object with grafs=Graphics() after just appending a plot to a plain list didn't seem to work.
Then I used grafs.[tab] and found it had an append attribute
So I tried appending a graphic object to it and got: AttributeError: 'Graphics' object has no attribute 'append'
I tried "add_primitive" instead of "append" and got a warning on that.
So how do I append to a graphics object and why can't it be a simple append or simple list?
cybervigilanteSun, 20 Sep 2020 21:41:24 +0200https://ask.sagemath.org/question/53519/Creating an object of the Magmatic Algebras categoryhttps://ask.sagemath.org/question/48953/creating-an-object-of-the-magmatic-algebras-category/ For the moment being, the category of Sage for nonassociative algebras is called MagmaticAlgebras. I want to know which methods are available in this category, and specifically how to create an object (i.e., a nonassociative algebra). In particular, what I want is to get the free nonassociative algebra in four variables (a,b,c,d) over the rational field. The MagmaticAlgebras reference page is of no use to me. Thank you!Jose BroxThu, 05 Dec 2019 18:36:44 +0100https://ask.sagemath.org/question/48953/TypeError: 'sage.rings.integer.Integer' object is not callablehttps://ask.sagemath.org/question/36226/typeerror-sageringsintegerinteger-object-is-not-callable/Hi there.
I am new to SAGE and I am getting this error when doing an integration. I am not sure if I am doing correctly the power 2 of the sech function.
I defined `f` function and my code is:
var('c,H,k,d,x,t')
f=(c * H * (sech^2(k / d * (x - c * t))))/(d + H * (sech^2(k / d*(x - c * t))))
f.integral(t)
The error is:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_7.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + support_.preparse_worksheet_cell(base64.b64decode("dmFyKCdjLEgsayxkLHgsdCcpCmY9KGMgKiBIICogKHNlY2heMihrIC8gZCAqICh4IC0gYyAqIHQpKSkpLyhkICsgSCAqIChzZWNoXjIoayAvIGQqKHggLSBjICogdCkpKSkKZi5pbnRlZ3JhbCh0KQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpGxgMcP/___code___.py", line 4, in <module>
f=(c * H * (sech**_sage_const_2 (k / d * (x - c * t))))/(d + H * (sech**_sage_const_2 (k / d*(x - c * t))))
TypeError: 'sage.rings.integer.Integer' object is not callable
Any corrections and/or suggestions will be welcome.
Thanks in advance.
P.S. - Hope the edit improved the reading of the topic, but could not find how to display colors as you did in TypeError, etc.
---
UPDATE:
So after correcting the `sech` above to `sech(x)^2`, I calculate the integral of `f` between the limits 0 and t, and changed the second line of the code above to:
limit(f=(c * H * (sech(k / d * (x - c * t))^2))/(d + H * (sech(k / d*(x - c * t))^2)),t=t)
Now I get the following errors:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_18.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("dmFyKCdjLEgsayxkLHgsdCcpCmxpbWl0KGY9KGMgKiBIICogKHNlY2goayAvIGQgKiAoeCAtIGMgKiB0KSleMikpLyhkICsgSCAqIChzZWNoKGsgLyBkKih4IC0gYyAqIHQpKV4yKSksdD10KQpmLmludGVncmFsKHQp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpJsB9eB/___code___.py", line 4, in <module>
limit(f=(c * H * (sech(k / d * (x - c * t))**_sage_const_2 ))/(d + H * (sech(k / d*(x - c * t))**_sage_const_2 )),t=t)
TypeError: limit() takes at least 1 argument (0 given)
Any idea what is wrong here?
The syntax of limit seems correct but how to specify both limits of 0 and t for the integral?
Thanks in advance.VLMon, 09 Jan 2017 13:13:59 +0100https://ask.sagemath.org/question/36226/TypeError: 'sage.rings.integer.Integer' object is not callablehttps://ask.sagemath.org/question/36229/typeerror-sageringsintegerinteger-object-is-not-callable/ Hi there.
I am new to SAGE and I am getting this error when doing an integration. I am not sure if I am doing correctly the power 2 of the sech function.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_6.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("dmFyKCdjLEgsayxkLHgsdCcpCmY9KGMqSCooc2VjaF4yKGsvZCooeC1jKnQpKSkpLyhkK0gqKHNlY2heMihrL2QqKHgtYyp0KSkpKQpmLmludGVncmFsKHQp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpC99A8h/___code___.py", line 4, in <module>
f=(c*H*(sech**_sage_const_2 (k/d*(x-c*t))))/(d+H*(sech**_sage_const_2 (k/d*(x-c*t))))
TypeError: 'sage.rings.integer.Integer' object is not callable
Any corrections and/or suggestions will be welcome.
Thanks in advance.VLMon, 09 Jan 2017 15:27:29 +0100https://ask.sagemath.org/question/36229/Object Persistence db_save errorhttps://ask.sagemath.org/question/9598/object-persistence-db_save-error/Take the following class. Why can't I use `db_save` to store an instance of this class? The reason I am using this class instead of just a set is because I will eventually derive this class from RingElement rather than SageObject, because I'm looking to create a Ring of Sets.
class FakeSet(SageObject):
def __init__(self,_set):
self.values = _set
self.iterator = self.__iter__()
if self.values != set():
self.next = self.iterator.next()
def __iter__(self):
for this_entry in self.values:
yield this_entry
def get_set(self):
return self.values
def __repr__(self):
return str(list(self.values))
def __getattr__(self,attr):
return getattr(self.values,attr)
Then I enter:
sage: fake = FakeSet([1,2,3])
sage: print fake
sage: db_save(fake,"test")
to which the interpreter responds:
Traceback (click to the left of this block for traceback)
...
cPickle.PicklingError: Can't pickle <type 'generator'>: attribute
lookup __builtin__.generator failed
SLOtoSFSun, 02 Dec 2012 20:06:17 +0100https://ask.sagemath.org/question/9598/Object Persistencehttps://ask.sagemath.org/question/9466/object-persistence/Is Object Persistence faster than just recreating the object? Why? And how do I do it, what are the steps? I read this: http://www.sagemath.org/doc/reference/sage/misc/persist.html, but am unclear about the parameters and how it works. Does this object only get associated with me as a user of the notebook, or can I share this object with other users (like if want to explore the properties of a clique graph on 20 nodes, which took 20 minutes to construct, how can I make that available to others?)
Sorry for all the questions, primarily I'm interested in how I can user Object Persistence to make my life easier.SLOtoSFWed, 24 Oct 2012 20:29:13 +0200https://ask.sagemath.org/question/9466/Notebook List Object Data Storage/Retrieval? (Start/Restart)https://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/How do you best store list data (between stopping and restarting notebook sessions) when there's too much for the notebook to handle as repr() output (when re-parsed upon re-evaluation)?ccanoncWed, 18 Aug 2010 23:07:18 +0200https://ask.sagemath.org/question/7558/