Ask Your Question

stockh0lm's profile - activity

2020-10-01 04:19:04 -0600 received badge  Popular Question (source)
2020-07-16 15:48:00 -0600 received badge  Popular Question (source)
2020-06-05 21:26:05 -0600 received badge  Popular Question (source)
2020-05-05 07:26:07 -0600 received badge  Notable Question (source)
2020-05-02 06:36:00 -0600 received badge  Nice Question (source)
2020-05-02 06:32:49 -0600 received badge  Notable Question (source)
2020-03-23 13:40:53 -0600 received badge  Popular Question (source)
2020-02-09 20:38:35 -0600 received badge  Popular Question (source)
2019-12-25 22:02:11 -0600 received badge  Popular Question (source)
2019-12-16 13:21:59 -0600 commented answer import error on debian

i run debian testing on this computer. which is a screw-up on my part. I installed binary packages from debian, and now i have a version mismatch, i guess. i try to figure out which package to install from unstable to fix the issue.

2019-12-16 10:32:22 -0600 answered a question import error on debian

the brot.sage.py file that gets generated automatically from my brot.sage file looks like this:

# This file was *autogenerated* from the file brot.sage
from sage.all_cmdline import *   # import sage library

_sage_const_3 = Integer(3); _sage_const_0p8 = RealNumber('0.8'); _sage_const_0p85 = RealNumber('0.85'); _sage_const_0p4 = RealNumber('0.4'); _sage_const_0p6 = RealNumber('0.6')
R, W, R_S, H, H_S, S = var('R W R_S H H_S S')

equations = [ S                 == R_S + H_S,
              R_S               == H_S,
              (R + R_S + W)     == _sage_const_3  * R_S,
              _sage_const_0p8 *(W+R+R_S)     == H + H_S,
              W/(W+R+R_S)       == _sage_const_0p6 ,
              R + W+ S +H       == _sage_const_0p85 ]

print solve(equations,[R, W, R_S, H, H_S,S ], algorithm="sympy", solution_dict=False)

And that looks a lot like my input file. It gets re-created if i delete it, too. I see the lines leading up to the stacetrace, too.

Its great that it works for you, though.

Where can start tracking down this problem?

2019-11-16 15:56:32 -0600 asked a question import error on debian

I get this error

 sage ~/src/brot.sage
Traceback (most recent call last):
  File "/home/andreas/src/brot.sage.py", line 3, in <module>
    from sage.all_cmdline import *   # import sage library
  File "/usr/lib/python2.7/dist-packages/sage/all_cmdline.py", line 26, in <module>
    from sage.all import *
  File "/usr/lib/python2.7/dist-packages/sage/all.py", line 102, in <module>
    from sage.modular.all    import *
  File "/usr/lib/python2.7/dist-packages/sage/modular/all.py", line 4, in <module>
    from .quatalg.all import *
  File "/usr/lib/python2.7/dist-packages/sage/modular/quatalg/__init__.py", line 4, in <module>
    from . import all
  File "/usr/lib/python2.7/dist-packages/sage/modular/quatalg/all.py", line 3, in <module>
    from .brandt import BrandtModule
  File "/usr/lib/python2.7/dist-packages/sage/modular/quatalg/brandt.py", line 206, in <module>
    from sage.modular.hecke.all import (AmbientHeckeModule, HeckeSubmodule, HeckeModuleElement)
  File "/usr/lib/python2.7/dist-packages/sage/modular/hecke/all.py", line 20, in <module>
    from .ambient_module import AmbientHeckeModule, is_AmbientHeckeModule
  File "/usr/lib/python2.7/dist-packages/sage/modular/hecke/ambient_module.py", line 38, in <module>
    from sage.modular.arithgroup.all import Gamma0 # for Sturm bound
  File "/usr/lib/python2.7/dist-packages/sage/modular/arithgroup/__init__.py", line 4, in <module>
    from . import all
  File "/usr/lib/python2.7/dist-packages/sage/modular/arithgroup/all.py", line 6, in <module>
    from .congroup_generic import is_CongruenceSubgroup, CongruenceSubgroup_constructor as CongruenceSubgroup
  File "/usr/lib/python2.7/dist-packages/sage/modular/arithgroup/congroup_generic.py", line 28, in <module>
    from sage.groups.matrix_gps.all import MatrixGroup
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/all.py", line 13, in <module>
    import sage.groups.matrix_gps.pickling_overrides
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/pickling_overrides.py", line 7, in <module>
    from sage.groups.matrix_gps.finitely_generated import FinitelyGeneratedMatrixGroup_gap
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/finitely_generated.py", line 81, in <module>
    from sage.groups.matrix_gps.matrix_group import (
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/matrix_group.py", line 61, in <module>
    from sage.groups.libgap_wrapper import ParentLibGAP
  File "sage/libs/gap/element.pxd", line 32, in init sage.groups.libgap_wrapper (build/cythonized/sage/groups/libgap_wrapper.c:9846)
ImportError: /usr/lib/python2.7/dist-packages/sage/libs/gap/element.x86_64-linux-gnu.so: undefined symbol: _GAP_SetEnterStackCount

with this file: cat brot.sage

R, W, R_S, H, H_S, S = var('R W R_S H H_S S')

equations = [ S                 == R_S + H_S,
              R_S               == H_S,
              (R + R_S + W)     == 3 * R_S,
              0.8*(W+R+R_S)     == H + H_S,
              W/(W+R+R_S)       == 0.6,
              R + W+ S +H       == 0.85]

print solve(equations,[R, W, R_S, H, H_S,S ], algorithm="sympy", solution_dict=False)


sage --version
SageMath version 8.6, Release Date: 2019-01-15

I would like to calculate my bread receipt... what is the issue here? This used to work before.

2019-04-29 13:25:14 -0600 commented answer What could be reasons for latex() output to stop working?

You are right, it was cocalc.org where the latex output worked. I think i didn't use it on my local linux yet.

2019-04-29 12:39:45 -0600 asked a question flipping a graph to plot upside down

Because in my special application positive values on my y-axis increase downwards instead of upwards.

So while normally you would do this:

x,y = var('x,y')
f(x,y) = x^2 + y^2
contour_plot(f, (x,0,1), (y,0,1)).show()

(where y plots from smaller numbers to bigger ones) I instead want to do this:

x,y = var('x,y')
f(x,y) = x^2 + y^2
contour_plot(f, (x,0,1), (y,1,0)).show()

where I expect the same picture, just flipped upside down. Except, this bombs! How can i get my desired result? the axis should be properly labeled, too.

2019-04-29 06:49:14 -0600 asked a question What could be reasons for latex() output to stop working?

In the past i used the latex() output to generate latex source to use in my paper. This stopped working at some point, on three independent linux systems. Even sage scripts that produced such latex source code in the past don't do so anymore.

for example

epsilon_0 = var('epsilon_0', latex_name=r'\varepsilon_0')
latex(epsilon_0)

produces no output, not on the command line nor in my emacs Sage output buffer.

I assume i must have broken something. Where can I look? i use debian, and the debian sage packages to install and use sage.

Edit: correction: on two of the three system the latex() command does nothing, on the third it works. I can use that third system to generate the latex source for now. But it would be swell to fix on the other systems, too. The third system where it works is an Ubuntu, where i installed sage from source.

2019-04-28 16:25:23 -0600 commented answer How can I plot error bars for functions?

i downloaded and integrated your source and resulting plot. thank you very much. you can remove the file now.

2019-04-28 10:00:09 -0600 commented answer How can I plot error bars for functions?

https://drive.google.com/drive/folder...

here is my code. i changed it like you suggested (i think) but now it plots just one error bar per pic and the last plot is funny.

2019-04-28 09:46:50 -0600 commented answer How can I plot error bars for functions?

my code does not need to stay private. You can set the expiration to never, too. I just use it frequently for sentimental reasons.

I want to express my thanks to you and your dedication to helping the community and me, specifically. You go above and beyond what is to be expected, and that with excellence and friendliness. I would have liked to write to you in private to say this, but i didnt see how this site allowed for that. so there. :-)

2019-04-27 16:11:59 -0600 commented question how to append to a symbolic expression in a loop?

the = SR.zero() is the solution. I had defined expression as a symbolic variable and then it didn't work.

can you please move this to a proper answer so i can upvote it?

2019-04-27 16:05:22 -0600 marked best answer How can I plot error bars for functions?

So far i plotted an upper and lower bound to my functions (as separate overlayed functions) and I liked that solution a lot. Now a colleague said that error bars were nicer. Can sage plot those? I searched and didnt find any.

The code I use currently is from this helpful comment from rburing: https://ask.sagemath.org/question/454...

2019-04-27 16:05:22 -0600 commented answer How can I plot error bars for functions?

actually i run into problems when trying to adapt your solution to the subplot solution in the other answer. Comments are not very good for exchanging this amount of information.

this is how i inserted your code: http://paste.debian.net/1080283/

and i got this pic:https://drive.google.com/file/d/1lungXkFGTEDIaUJomy98ErBvYRrsDKzq/view?usp=sharing

2019-04-27 15:20:23 -0600 commented answer How to break up function definitions across several lines?

thank you.

For me the point is readability and that does not improve a lot with out indentation.

2019-04-27 15:18:13 -0600 asked a question how to append to a symbolic expression in a loop?

This must be super basic, but i don't get how to do the classic

for i in list:
    expression = expression + i

symbolically. I want to add new terms to the expression, and the "==" notation does not mash well with that.

An .append() method would make sense, but i was not able to find one.

2019-04-27 14:07:16 -0600 marked best answer How to break up function definitions across several lines?

if i write a function definition and i break it up across several lines, the sage prepocessor complains:

phi(epsilon, Q, r) = 1/(4*pi*
                        epsilon
)*Q/r

show(phi(1,2,3))

the sage prepocessor complains:

sage demo.sage
  File "demo.sage.py", line 6
    __tmp__=var("epsilon,Q,r"); phi = symbolic_expression(_sage_const_1 /(_sage_const_4 *pi*).function(epsilon,Q,r)
                                                                                            ^
SyntaxError: invalid syntax

While this is a very short function that is easily kept on one line, I do have rather long and intricate ones which I would like to break up (and potentially comment) over several lines.

Linebreaks with backslash as the last char of the line don't work:

cat demo.sage
phi(epsilon, Q, r) = 1/(4*pi*\
                        epsilon\
)*Q/r

show(phi(1,2,3))

% sage demo.sage
  File "demo.sage.py", line 6
    __tmp__=var("epsilon,Q,r"); phi = symbolic_expression(_sage_const_1 /(_sage_const_4 *pi* * BackslashOperator() * ).function(epsilon,Q,r)
                                                                                             ^
SyntaxError: invalid syntax

How do I do that?