Ask Your Question

beeson's profile - activity

2018-09-08 05:38:17 +0200 received badge  Popular Question (source)
2018-09-01 03:33:35 +0200 received badge  Notable Question (source)
2018-09-01 03:33:35 +0200 received badge  Popular Question (source)
2017-06-07 04:38:29 +0200 received badge  Popular Question (source)
2016-08-03 18:34:52 +0200 received badge  Popular Question (source)
2016-04-01 18:41:50 +0200 received badge  Scholar (source)
2016-04-01 18:41:32 +0200 received badge  Popular Question (source)
2016-04-01 18:41:32 +0200 received badge  Notable Question (source)
2016-01-22 20:54:33 +0200 commented answer wrong answer from solve?

So then, if solve returns [], that does not mean "there are no solutions". It means, "I didn't find any solutions". Similarly, if it does return a list of solutions, I guess that means "Here are the solutions I found", rather than, "Here are all the solutions." If this is the case, the documentation should say so up front. It says, "if there are no solutions it returns an empty list" but says nothing about the converse.

2016-01-22 20:48:54 +0200 received badge  Supporter (source)
2016-01-22 17:03:04 +0200 asked a question wrong answer from solve?
var('t')
test3 = -4*cos(t)^4 + 4*cos(t)^2 - 1
sage: solve(test3==0,t)
[]

When actually the equation is equivalent to (cos(t))^2 = 1/2 and it does have solutions.

2016-01-15 19:34:15 +0200 commented question can sage be made to do this algebra?

The originally posted code gave a negative result due to an extra minus sign.
The image of the results came from the code without that minus sign, so it's positive. Thanks for pointing out how to include code and images. Putting assumptions in doesn't make any difference (I did have some in but deleted them for simplicity). So the answer is, to simplify subexpressions you can cut and paste them, simplify them separately, then use substitution and a second cut-and-paste to get them substituted back in. Fine, if you are working interactively, but that doesn't work in a script. Can anyone give a script that starts with sin(4t) + sin(2t) and produces a result that is trig functions of 2*t without pre-calculating the answer (either by hand or in Sage)?

2016-01-15 17:22:34 +0200 received badge  Editor (source)
2016-01-15 17:20:21 +0200 asked a question can sage be made to do this algebra?

Enneper's wire lies on an ellipsoid. I want to prove the curvature vector of Enneper's wire always points inward (never tangent to the ellipsoid). The plan is to show that the dot product of the curvature vector with the inward normal to the ellipse is strictly positive.

So I start like this:

  R,t = var('R,t')
    X = vector((R * cos(t) - (1/3)* R^3 * cos(3*t), 
            - R * sin(t) - (1/3) *R^3 * sin(3*t),
             R^2 *cos(2*t)))
    Xtheta = X.diff(t)
    T = 1/(abs(Xtheta)) * Xtheta   # unit tangent
    kappavector = T.diff(t) 
    EllipsoidNormal = vector((-2*R*cos(t) + (2/3)*R^3*cos(3*t),
    2*R*sin(t) + (2/3)*R^3 * sin(3*t),-(4/3)*R^2*cos(2*t)))
    test = EllipsoidNormal.dot_product(kappavector).trig_simplify()
    print(test)

So far so good.

image description

In general it is difficult to get Sage to do something to PART of a formula. For example in sin(4t) + sin(2t), get Sage to apply a double angle formula to sin(4t) so everything comes out in trig functions of 2t.

2015-06-17 16:59:39 +0200 received badge  Famous Question (source)
2015-04-21 16:31:58 +0200 received badge  Notable Question (source)
2015-04-19 23:39:34 +0200 received badge  Popular Question (source)
2015-04-19 18:41:42 +0200 commented question sagetex on Mac OS 10.10.2

OK, now I have a sagetex.sty with copyright date 2012. (In case it helps anyone else, the Mac finder does not display this file buried in the Sage installation, even after specifying "show system files", which does cause the ones in (the old) Texlive to show up. Use the Unix command "locate sagetex.sty".) And I discovered that the new sagetex.sty does not generate Myfile.sage but rather Myfile.sagetex.sage. So you need to load or attach THAT file. But I'm still not home free. It seems the generated python code needs to prepend "./" to the filename. It does not do that so it can't run the generated Sage code:

-> 282 sagef = open(self.filename + '.sagetex.sage', 'r') 283 m = hashlib.md5() 284 for line in sagef:

IOError: No such file or directory

2015-04-18 18:21:54 +0200 asked a question sagetex on Mac OS 10.10.2

I am encountering errors. So, I attempted to ensure that I have the right sagetex.sty file as that seems to be crucial. There was an old one somewhere in LiveTex so I updated to LiveTex 2014. Turns out that does not include any sagetex.sty. The one I have shows a creation date of March 19,2009. The error I get is "module does not have an openout method." When I look at the errors in detail it looks like a python module is automatically generated that tries to insert something into the path, and what it tries to insert is incorrect, mentioning Applications/sage instead of Applications/Sage-6.5.app. (See copy of the errors at the end of this message). Now to come to the questions: (1) is this indeed fixable by getting the right version of sagetex.sty? (2) if so where do I get it?

/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach) 265 with open(preparse_file_named(fpath)) as f: 266 code = compile(f.read(), preparse_file_named(fpath), 'exec') --> 267 exec(code, globals) 268 else: 269 # Preparse in memory only for speed.

/Users/beeson/.sage/temp/Michaels-MacBook.local/68123/SageTexTest.sageyxLpLD.py in <module>() 7 sys.path.insert(_sage_const_0 , '/Applications/sage') 8 import sagetex ----> 9 sagetex.openout('SageTexTest')

2015-04-13 18:46:39 +0200 asked a question wrong answer for integral

Sage 6.5:

sage: (A,t) = var('A,t')
sage: assume(A > 0)
sage: assume(A < 1/3)
sage: num = A^2 * cos(t)^2 + 2*abs(A* cos(2*t))
sage: denom = 2 + A^2*cos(t)^2 + 2*abs(A*cos(2*t))
sage: beta = -num/denom
sage: integral(beta,t,0,2*pi)
-2*pi

This can't be right as beta has absolute value less than 1 so its integral over 0 to 2 pi has to have absolute value less than 2 pi.

2015-04-08 21:11:48 +0200 asked a question complex, real, common ring, crash in 'vector' constructor
(x,y,z) = var('x,y,z')
x = z.real_part()
y = z.imag_part()
test = vector((x,1,1))
test = vector((x,y,1))
test = vector((z.real_part,1,1))

Last line causes an error, can't find common ring for all elements.
These variables all have type "Expression"; but some expressions denote complex numbers and some denote real numbers. How do I tell sage about that? (Sage 6.5 on Mac OS 10).

2015-04-01 12:13:56 +0200 received badge  Nice Question (source)
2015-03-31 17:12:14 +0200 asked a question working on part of an expression

I came across a complicated expression containing cos(4t). I wanted to change it to 1-sin(2t)^2. The tools are trig_reduce, trig_expand, and trig_simplify. One of them expresses everything in trig functions of t and the other two are useless. And all three will work on the entire expression, not just on one part. So this is a very general question: how can I get sage to do something to just one part of an expression, rather than the whole expression? (I suppose I could extract the part, work on it, and then substitute the result back in, but that would be difficult!)

And even on a standalone basis, I don't know how to change cos(4t) to 1-sin(2t)^2.

2015-03-31 17:05:44 +0200 asked a question notebook versus terminal session

Can someone point me to some explanation why I would use a notebook rather than a terminal session? Someone has gone to a lot of work to make the notebooks, and I don't understand why, as I like to be able to paste a sage file, or parts of it, into a "verbatim" environment in TeX so a reader could duplicate the computations. Is it that a notebook can be used to make an interactive web page?

2015-03-31 17:04:22 +0200 asked a question installation report

I have two Mac computers. On both I found that Sage 6.5 won't work with OS 10.9. So, I installed OS 10.2 on both Macs, deleted the old Sage.app 6.5 for OS 10.9, and installed the new Sage.app for OS 10.10. One one Mac, everything worked. On the other Mac, I had difficulties. Repeatedly I found that I couldn't start a terminal session and found in the log, "another Sage Notebook server is running". I discovered that by choosing Stop Server from the Server menu a couple of times I could cure this problem and start a terminal session. This happened even after a restart. Well, now I know what to do so it isn't blocking any work, but I thought I would report it. Possibly I double-clicked the Sage icon in the dock? Would that start two servers? Why, anyway, would having two Notebook Servers running interfere with a terminal session? This is supposed to be a "question" so that last sentence is the official "question" here.

2015-03-28 17:28:39 +0200 answered a question parametric_plot3d fails with floating-point parameter

I installed Mac OS 10 and the corresponding version of Sage. Then it worked fine.

Also, I followed the instruction that says you can answer first and then log in. But after logging in, my answer seemed to disappear, so this is the second time I answered. If two answers turn out to appear, that's why.

2015-03-27 21:02:26 +0200 asked a question crash on integral attempt

Sage version 6.5 app on Mac OS 10.95. Following code tries to evaluate the total curvature of a certain space curve. The answer should be given as a complete elliptic integral of the second kind (which I then hoped to numerically evaluate for a range of values of r). But I get "Error executing code in Maxima".

r,t = var('r,t')
assume(r > 0)
X = vector((r * cos(t) - (1/3)* r^3 * cos(3*t), 
             - r * sin(t) - (1/3) *r^3 * sin(3*t),
             r^2 *cos(2*t)))
Xtheta = X.diff(t)
AbsXtheta = abs(Xtheta)
T = (1/AbsXtheta) * Xtheta    ## unit tangent
kappa = abs(T.diff(t))
kappa = kappa.expand().trig_simplify().canonicalize_radical()
print(kappa)
Curvature = integral(kappa,t,0,2*pi)
2015-03-26 18:00:14 +0200 commented question parametric_plot3d fails with floating-point parameter

I downloaded the correct binary, according to my memory. I don't know how to verify that.

2015-03-26 17:36:38 +0200 commented question parametric_plot3d fails with floating-point parameter

From a terminal session, using "attach" to load the file, this plot command does not work even with parameter 1. In the console one can find some error messages: 3/26/15 9:32:43.876 AM com.apple.appkit.xpc.openAndSavePanelService[1061]: assertion failed: 13F34: liblaunch.dylib + 25164 [A40A0C7B-3216-39B4-8AE0-B5D3BAF1DA8A]: 0x25 3/26/15 9:32:43.896 AM com.apple.appkit.xpc.openAndSavePanelService[1061]: assertion failed: 13F34: liblaunch.dylib + 25164 [A40A0C7B-3216-39B4-8AE0-B5D3BAF1DA8A]: 0x25 3/26/15 9:32:43.931 AM com.apple.appkit.xpc.openAndSavePanelService[1061]: Bogus event received by listener connection: <error: 0x7fff78af4b50=""> { count = 1, contents = "XPCErrorDescription" => <string: 0x7fff78af4e60=""> { length = 18, contents = "Connection invalid" } } 3/26/15 9:32:46.948 AM com.apple.IconServicesAgent[303]: main Failed to composit image for binding VariantBinding [0x3e5] flags: 0x8 binding: FileInfoBinding [0x5bf] - extension: eps, UTI: com.adobe.encapsulated-postscript, fileType: ????. 3/26/15 9:32:46.949 AM quicklookd[1064]: Warning ... (more)

2015-03-26 16:44:00 +0200 commented question parametric_plot3d fails with floating-point parameter

Which Mac OS are you guys running? Maybe it works with 10.10 but not with 10.9 ?

2015-03-26 15:06:03 +0200 received badge  Student (source)
2015-03-25 21:54:04 +0200 commented question parametric_plot3d fails with floating-point parameter

I am using version 6.5 downloaded today (as this code, which used to run in 4.8, won't run in 4.8 under Mac OS 10.9)

2015-03-25 19:28:58 +0200 asked a question parametric_plot3d fails with floating-point parameter

The following code

u,v = var('u,v')
X =   u * cos(v) - (1/3)* u^3 * cos(v*3)
Y =   - u * sin(v) - (1/3) *u^3 * sin(3*v)
Z =   u^2 *cos(2*v)
p = parametric_plot3d([X,Y,Z], (u,0,1),(v,0,2*pi),frame=False, color="blue")

works but with 0.9 in place of 1 in range of u produces an error. Namely,

Unhandled SIGILL: An illegal instruction occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Sage will now terminate.