Ask Your Question

Eviatar Bach's profile - activity

2020-10-15 04:49:01 -0600 received badge  Self-Learner (source)
2020-10-15 04:49:00 -0600 received badge  Self-Learner (source)
2020-07-19 16:36:16 -0600 received badge  Good Question (source)
2020-07-02 19:04:21 -0600 received badge  Notable Question (source)
2020-05-01 15:02:13 -0600 received badge  Nice Question (source)
2019-04-13 02:02:56 -0600 received badge  Famous Question (source)
2019-03-06 05:04:39 -0600 received badge  Popular Question (source)
2018-12-03 14:29:50 -0600 received badge  Popular Question (source)
2018-11-13 04:20:27 -0600 received badge  Famous Question (source)
2018-02-07 07:26:44 -0600 received badge  Popular Question (source)
2017-10-09 10:52:10 -0600 received badge  Necromancer (source)
2017-10-09 10:52:10 -0600 received badge  Self-Learner (source)
2017-10-02 01:24:53 -0600 received badge  Famous Question (source)
2017-09-29 12:03:36 -0600 received badge  Nice Answer (source)
2017-09-17 18:48:44 -0600 received badge  Self-Learner (source)
2017-09-04 13:58:17 -0600 received badge  Famous Question (source)
2017-07-31 15:04:37 -0600 received badge  Notable Question (source)
2017-07-24 14:18:18 -0600 received badge  Famous Question (source)
2017-06-04 08:45:49 -0600 received badge  Famous Question (source)
2017-03-20 19:19:10 -0600 received badge  Good Answer (source)
2017-02-19 23:53:04 -0600 received badge  Famous Question (source)
2017-02-15 18:28:57 -0600 received badge  Notable Question (source)
2017-02-15 18:28:57 -0600 received badge  Popular Question (source)
2016-12-05 01:27:54 -0600 received badge  Nice Question (source)
2016-11-30 08:50:28 -0600 received badge  Notable Question (source)
2016-11-30 08:50:28 -0600 received badge  Popular Question (source)
2016-07-27 02:32:12 -0600 received badge  Nice Answer (source)
2016-05-25 06:00:29 -0600 received badge  Notable Question (source)
2016-05-16 23:18:07 -0600 received badge  Notable Question (source)
2016-01-01 21:48:18 -0600 received badge  Notable Question (source)
2015-12-18 13:55:28 -0600 received badge  Popular Question (source)
2015-09-19 03:11:15 -0600 received badge  Nice Answer (source)
2015-03-26 22:11:58 -0600 marked best answer System of nonlinear equations


Is it possible to solve the following using Sage?

Thanks in advance.

2015-03-26 22:11:58 -0600 marked best answer Variables in TinyMCE


Is there any way to fetch Sage variables from TinyMCE? This would be useful to display results of computations inline with formatted text.

2015-03-26 22:11:50 -0600 marked best answer How to make 1:1 matrix plots?


I want to make a matrix_plot of an array, but it never displays correctly. How would I, for example, make each number in an array into a pixel? I find matrix_plot, in resizing, "corrupts" the image. For example, this is a plot of the Sierpinski triangle:

Sierpinski triangle

(it also does this on svg plots), and you can see the array isn't translating correctly to pixels. aspect_ratio=1 doesn't work. A sufficiently large figsize works, but I don't see why this is necessary. Isn't there another way?

Thank you.

2015-03-26 22:11:50 -0600 marked best answer DiGraph labels?

Labels don't seem to work on DiGraphs. For example:



This just shows 2 and 3 as labels. Is this a bug or am I doing something wrong?

Thanks in advance.

2015-03-26 22:08:32 -0600 marked best answer Radian–degree conversion


It seems to be unnecessarily hard to numerically convert radians to degrees in Sage. For example, how does one convert arctan(4/5) radians to degrees?

The following




Is there a simple way to just return a numerical answer (without multiplying by 180/pi)?

2015-03-26 22:08:25 -0600 marked best answer Specific cmap


How would I create a specific cmap, which would have a separate color value for each matrix value? For example, could I make a cmap that specifies 0:'red', 1:'green', 2:'yellow', etc? The linear interpolation cmaps don't work as I want them to because they normalize to the given range of the matrix.

Thank you.

2015-03-26 22:08:04 -0600 marked best answer Interact depending on other arguments


Is it possible to have interact arguments depend on one another? For example, having the maximum of one slider depend on the former? I tried this:

def metacontrol(a=slider(5,10)):
    def control(b=slider(0, a)):

But it doesn't work; updating the first slider deletes the second slider. It is possible with two cells, but this requires executing the cell which defeats the purpose of interact.

Thank you.

2015-03-26 22:07:36 -0600 marked best answer Tables of graphics?

I recall seeing a function that would allow one to make a table (or a series) of graphics. For example, if I wanted to display 10 plots in a series, how would I do this?

Thanks in advance.

2015-03-26 22:07:23 -0600 marked best answer Eulerian Cycle of a Digraph


Is there a function to do an Eulerian cycle of a digraph? eulerian_cycle works on undirected graphs, but not on digraphs. Basically I'm looking for an equivalent to Mathematica's EulerianCycle. Does this exist?

Thanks in advance.

2015-03-26 22:07:05 -0600 marked best answer How come abs(x) works?


I notice that abs is a Python built-in function, but it also works symbolically:

sage: abs(x)
sage: bool(abs(x) == abs_symbolic(x))
sage: preparse('abs(x)')

What's going on here? Obviously the Python function should not accept a Sage type.

2015-01-02 06:39:51 -0600 received badge  Notable Question (source)
2014-06-29 04:09:57 -0600 received badge  Famous Question (source)
2014-06-28 20:15:39 -0600 marked best answer Is there a way to update an expression with new variable values?

Is there a way to update an expression if the symbolic variables that it contains have been overwritten? For example,

sage: var('beta')
sage: eq = x == beta
sage: beta = 1
sage: eq
x == beta

Is there a way for it to change to x == 1? I wrote the following function to do this, but I wanted to know if something similar existed already.

def update(expr):
    return expr.subs(dict(zip(expr.variables(), map(lambda v:eval(str(v)), expr.variables()))))
2014-06-28 20:15:37 -0600 marked best answer Calculating terms of a series

Is there any way to calculate terms of a series which Sage is unable to find a closed-form expression for?

For example, how do I calculate the first ten terms of a in the following example?

sage: a = sum(sqrt(x), x, 0, oo)
sage: a
sum(sqrt(x), x, 0, +Infinity)
2014-06-28 20:15:17 -0600 marked best answer How to "recover" real number from expression?

How do I separate a RealNumber from an Expression, once it is constructed?

sage: b = RealField(200)(5)
sage: type(b)
<type 'sage.rings.real_mpfr.RealNumber'>
sage: type((b^x).operands()[0])
<type 'sage.symbolic.expression.Expression'>