Ask Your Question

russ_hensel's profile - activity

2020-07-05 09:38:24 -0600 received badge  Notable Question (source)
2020-07-05 09:38:24 -0600 received badge  Famous Question (source)
2019-12-24 22:56:21 -0600 received badge  Famous Question (source)
2019-11-12 09:36:18 -0600 received badge  Popular Question (source)
2019-11-12 09:36:18 -0600 received badge  Famous Question (source)
2019-11-12 09:36:18 -0600 received badge  Notable Question (source)
2019-02-18 17:18:49 -0600 received badge  Notable Question (source)
2017-07-06 05:45:39 -0600 received badge  Notable Question (source)
2017-06-16 18:14:59 -0600 received badge  Popular Question (source)
2016-09-15 17:34:56 -0600 received badge  Self-Learner (source)
2016-07-20 02:45:30 -0600 received badge  Necromancer (source)
2016-07-20 02:45:30 -0600 received badge  Teacher (source)
2016-05-04 21:04:47 -0600 received badge  Notable Question (source)
2015-11-03 23:58:06 -0600 received badge  Notable Question (source)
2015-02-08 13:01:46 -0600 received badge  Enthusiast
2015-02-03 08:04:51 -0600 commented answer Change name of worksheet in sagemath cloud

Thank you, that works. A box around the file name would make it a bit more intuitive. But it does work just fine.

2015-02-02 15:52:27 -0600 asked a question Change name of worksheet in sagemath cloud

Probably something just sitting in front of me when in my account on the cloud but I be dammed if I can find it. ( also cannot find any beginner documentation on sagemath cloud ( of course lots of stuff about sage and the sage notebook but not the cloud )

2015-01-31 13:09:20 -0600 received badge  Popular Question (source)
2015-01-14 05:15:01 -0600 received badge  Popular Question (source)
2014-06-29 11:26:04 -0600 received badge  Popular Question (source)
2014-06-29 11:26:04 -0600 received badge  Notable Question (source)
2014-06-29 11:26:04 -0600 received badge  Famous Question (source)
2014-06-28 20:15:10 -0600 marked best answer Arbitrary Precision Physics Calculation

I would like to do some physics problems in high precision. I cannot find any examples or sample worksheets that are accessable on a basic level. I just want real numbers ( including large and small in scientific notation ) I am pretty sure this is not too hard, perhaps it is too simple to be explained? Any help would be appreciated.

2014-06-28 20:15:07 -0600 marked best answer Is n() the same as N() if not why not

I am trying to use Sage as a simple numerical calculator but sometimes have to fight with more advanced features, things I think are number are not. I starting using n() to fix this up, but in some cases it did not work. Bug big N N() did. Is this the way it is supposed to be ( if so why ). Identical commands ( symbols..... ) except for capitilization seems like a bad idea. Here is the code:

# Is n() the same as N() if not why not


xll = 1. / ( pi * ( 2. ^ .5 )   ) 

xll = 22. * 2

print "xll is of type", type( xll )
print ""

print "Big N next" 
print N( ll )

print "" 
print "Little n next" 
print n( xll )

produced output:

xll is of type <type 'sage.rings.real_mpfr.RealNumber'>

Big N next 
0.0000120042175487614

Little N next 
Traceback (click to the left of this block for traceback) ...       
TypeError: 'sage.rings.real_mpfr.RealLiteral' object is not callable
2014-06-21 12:36:04 -0600 received badge  Popular Question (source)
2014-03-28 05:29:30 -0600 answered a question Trouble Installing Plotly on a Sage VirtualBox

following a suggestion at: http://ask.sagemath.org/question/1382...

it seemed that ./sage --python -m easy_install <package_name>

might work at the command line. plotly was in the python index so I tried

./sage --python -m easy_install plotly

which threw an error, perhaps because of my current directory, but

sage --python -m easy_install plotly

seemed to work, and after a restart of the virtual machine ( which might really be the key to success ) plotly did work in the notebook.

2014-03-27 06:09:40 -0600 asked a question Trouble Installing Plotly on a Sage VirtualBox

Trouble Installing Plotly on a Sage VirtualBox

I am trying to use plotly on a virtual box vm using the downloaded virtual machine image of SageMath.

I can get to the command line, <right-ctrl and="" f1="">

I did not have pip which is used to install plotly but got it with

"sudo yum -y install python-pip"

then ran pip to get plotly

"sudo /usr/bin/pip-python ///install plotly"

back in sage <right-ctrl and="" f2="">

"import plotly"

fails

but at the linux command line

"python"

"import plotly"

works, so possibly I installed to the wrong copy of python?

from http://ask.sagemath.org/question/3481... also tried some variaions on "sage --python /usr/bin/pip-python install" all of which failed

any help?

2014-02-19 05:01:22 -0600 commented answer Printing stuff from Sage notebook

Later when editing the worksheet the cell was almost unreachable, to get at it I deleted the %hideall in the text mode, make sure you use the save at the top of the text box ( by text I mean the text mode accessed with the upper right <edit> button).

2014-02-18 04:20:23 -0600 answered a question Adding Code To My SageMath Notebook
# Answering my own question: this seems to make it work
# put this in the LRC.pyFile before any code "from sage.all import *"

import sys
sys.path.append('/media/sf_D_DRIVE//unixshare/forLRC') # move your python files here


import LRC

from LRC import *

# try it out
lrc    = LRC()
print lrc

And it printed what I expected

2014-02-18 04:06:31 -0600 answered a question Printing stuff from Sage notebook

Poking around on this I found that %hideall on the first line of the cell worked. This is on a notebook version 5.1 under virtual box

2014-02-17 14:11:05 -0600 asked a question Adding Code To My SageMath Notebook

I have written a class, “LRC”, using the Sage Notebook which works just fine. Now I would like to put it into my sage environment without including it on each worksheet.

Before I go on I should describe my environment a bit. I am running a windows 7 machine with Virtual Box. I imported a Sage Notebook virtual machine and run it. The virtual box shares some of the drive space with the windows machine, in particular a spot called D:\unixshare

So I extracted the code from the cell to a file and placed it at D:\unixshare\forLRC\LRC.py which at least in theory available to the virtual box machine.

In a new worksheet I put this in a cell.

import sys sys.path.append('/media/sf_D_DRIVE//unixshare/forLRC') # move your python files here

import LRC

lrc = LRC()

.-.-.-.-.-.-.-.-.-.-

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "_sage_input_4.py", line 10, in <module>

exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("aW1wb3J0IHN5cwpzeXMucGF0aC5hcHBlbmQoJy9tZWRpYS9zZl9EX0RSSVZFLy91bml4c2hhcmUvZm9yTFJDJykgIyBtb3ZlIHlvdXIgcHl0aG9uIGZpbGVzIGhlcmUKCmltcG9ydCBMUkMKCmxyYyAgICA9IExSQygp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))

File "", line 1, in <module>

File "/tmp/tmpMF8IdA/___code___.py", line 5, in <module> import LRC File "/media/sf_D_DRIVE//unixshare/forLRC/LRC.py", line 22, in <module> class LRC( object ): File "/media/sf_D_DRIVE//unixshare/forLRC/LRC.py", line 31, in LRC var( "myOmega" ) # sometimes used as the angular frequency

NameError: name 'var' is not defined

I did get a new file: D:\unixshare\forLRC\LRC.pyc

So I have a problem that does not let me go any farther. I am not a particularly experienced python programmer, but have programmed in various languages for some time. Some help? Thanks.

2013-11-19 16:11:05 -0600 received badge  Popular Question (source)
2013-05-08 10:16:33 -0600 answered a question Adding some *.py files to sagemath notebook?

This is the original poster with an update. Tried both of the above from the notebook after moving the files to /etc/mesa

Neither worked -- then I remembered that linux is full of gotchas so I broke out of the notebook right-ctrl and f1, then logged in as root ( password sage ) and from the command line changed the file rights: chmod uog=rwx -R /etc/mesa

Then I restarted the sage vm. So far it seems to work ( the import sys method, the other may work as well, I will try later. )

Thanks very much.

2013-05-08 09:48:27 -0600 commented question Adding some *.py files to sagemath notebook?

not sure, in this case it is a module from a course which does not have an install utility.

2013-05-07 13:38:16 -0600 asked a question Adding some *.py files to sagemath notebook?

Ok I have spent hours going thru online docs for such a simple question but now give up, so now I am asking:

I am running the sage appliance in virtual box ( sage5.1 ) under windows 7.

I have some python file, but no setup.py file for them.

I would like to add them to sage so in the notebook I can import them.

Can anyone tell me where to put them, hopefully without expecting me to know my well very well around linux ( I can copy move make directories, and modify some access rights, but I do not want to learn bash scripting ) If you could give command on a close to cut and paste basis that would be wonderful.

2013-05-07 12:43:18 -0600 commented answer How do I install python modules, or use a different version of python? (with sage)

other references show single - prior to python in any case my system responds python: can't open file 'setup.py': ........ So I am screwed I shoul note that I am using the sage appliance for the notebook.

2013-04-09 08:08:39 -0600 asked a question Problems with Solve?

` running in the notebook ( Sage 5.1 )

 --- this input ---

 var( "Z", "A" )
 equ   = 1.*Z/A^(1/3) + 2.*(A - 2*Z)/A == 0
 print equ
 sol = solve( equ, A )
 print sol

 --- gives ---
 Z/A^(1/3) - 2*(-A + 2.00000000000000*Z)/A == 0
 [
 A == -2*(A^(4/3) - 2*A^(1/3)*Z)/Z
 ]

--- my problem ---

if I have solved for A, why is A still on the RHS, I expected only Z as a variable. This problems is similar to the real one I am having with a much more complicated formula. `

2012-04-15 05:07:05 -0600 received badge  Nice Question (source)
2012-02-16 08:05:54 -0600 marked best answer Arbitrary Precision Physics Calculation

Your question is a little vague. We do have arbitrary (fixed) precision real and complex numbers.

sage: R = RealField(1000)
sage: a = R(5.0000001^5.0000001)
sage: a
3125.00081544945942368940450251102447509765625000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
sage: a^5-log(1/a)+e^sqrt(a)
1.89584501327280735942937534086913418233822028367104009709035254982102232998750469378667609600087589163781468732285228512947454542091917091499584315533762570369369905169521733670930846238772029824301668021456411893832087472189344604700518827443459286621575319448702380078978194800389265094467157413734e24

See RealField? for more info.