2016-08-18 00:20:13 +0200 | received badge | ● Favorite Question (source) |
2015-06-16 05:12:29 +0200 | received badge | ● Famous Question (source) |
2015-03-26 17:39:04 +0200 | received badge | ● Famous Question (source) |
2014-08-20 15:21:47 +0200 | received badge | ● Great Question (source) |
2014-06-29 03:12:45 +0200 | marked best answer | summing over a list of variables? Hi all, I'm new to SAGE (I'm trying to move over from Mathematica), and I was wondering if someone could help me define the following function: $$ r_k(x_1, x_2, x_3, x_4) = \left( \sum_{i=k+1}^{4} x_i^2 \right)^{1/2} $$ I figured I could do something like: But this returns the error:
Worse yet, when I enter sage:x, it returns x, and forgets x was a list of variables. And to complicate things, when I try I get the error
even after I do "clear_vars()" and try everything all over again. Can anyone tell me what's going on? |
2014-06-26 19:25:58 +0200 | received badge | ● Famous Question (source) |
2014-05-04 08:47:13 +0200 | received badge | ● Famous Question (source) |
2013-08-03 16:15:17 +0200 | received badge | ● Famous Question (source) |
2013-07-22 14:31:33 +0200 | received badge | ● Notable Question (source) |
2013-02-04 10:36:54 +0200 | received badge | ● Notable Question (source) |
2012-12-22 23:44:33 +0200 | received badge | ● Notable Question (source) |
2012-11-29 01:52:46 +0200 | received badge | ● Notable Question (source) |
2012-11-20 05:18:43 +0200 | received badge | ● Popular Question (source) |
2012-09-08 04:20:33 +0200 | received badge | ● Great Question (source) |
2012-09-01 17:30:27 +0200 | received badge | ● Taxonomist |
2012-08-21 07:07:21 +0200 | received badge | ● Notable Question (source) |
2012-06-27 01:34:26 +0200 | received badge | ● Popular Question (source) |
2012-06-20 13:17:40 +0200 | received badge | ● Popular Question (source) |
2012-03-19 12:19:23 +0200 | received badge | ● Popular Question (source) |
2012-03-07 11:57:15 +0200 | received badge | ● Popular Question (source) |
2011-08-22 15:57:51 +0200 | commented question | Using Pydev (eclipse) and Sage? Just type "sage -python" in your terminal, and it will open up the sage_python interpreter. |
2011-08-22 12:08:04 +0200 | received badge | ● Nice Question (source) |
2011-08-14 21:43:14 +0200 | received badge | ● Good Question (source) |
2011-08-14 09:37:33 +0200 | received badge | ● Commentator |
2011-08-14 09:37:33 +0200 | commented answer | when/how to use parallel? Right. I'm not sure I know what a "linear algorithm" is. Let me edit my question, so I can be more specific. |
2011-08-14 06:34:14 +0200 | received badge | ● Nice Question (source) |
2011-08-14 01:17:47 +0200 | asked a question | when/how to use parallel? So I've scouted around some of the questions posed here that involve the terms parallel or the decorator @parallel and I want to know: is there any documentation out there that introduces novices to parallel computing (in sage)? At present (i.e. with the parallel? documentation being what it is), I don't really know how (or even when) to take advantage of @parallel. If I have a dual-core CPU, should I be trying to decorate every function with @parallel? Can someone educate this fool? Thanks, Steven EDIT:I suppose the best answer here would give an example of situations where @parallel can be of use, and where it cannot. I'm going to throw two examples out there, someone let me know if this is correct. Feel free to add you own, if my examples are two superficial.
Is it fair to say that @parallel should speed up the time to make and process list_of_curves? Where as it won't speed up the function numerical_integral? 2pi)[0]2pi)[0]2*pi)[0] |
2011-08-14 01:02:18 +0200 | commented answer | Why does @parallel change my outputs? Thanks. I wish the documentation for @parallel was more clear. |
2011-08-13 21:59:33 +0200 | commented answer | Why does @parallel change my outputs? Sorry, why are you printing x[0][0][0], why doesn't x[0] suffice? |
2011-08-13 21:57:01 +0200 | commented answer | A way to rotate a tachyon plot While this isn't my thread, I'd like to thank the poster: this totally answers a question I was wondering about. |
2011-08-13 17:54:33 +0200 | commented answer | problem computing a numeric double integral So I looked at the link and converted my code to http://sagenb.org/home/TeamSkynet/6/cells/1/__sagenb_servers_sage_notebook_sagenb_sagenb_home_TeamSkynet_6_code_sage112_spyx.html however when I run calcMobiusEnergy, I now get the error "Exception TypeError: 'unable to simplify to float approximation' in '_sagenb_servers_sage_notebook_sagenb_sagenb_home_TeamSkynet_6_code_sage\ 112_spyx_0.arcLength' ignored"... What gives? |
2011-08-13 13:38:16 +0200 | commented answer | problem computing a numeric double integral So, I just finished running calcMobiusEnergy on (cos(t), sin(t), 0), and found an energy equal to 400.8287... The number is a bit unsettling (it should probably be less that 6*pi + 4), but what's more troublesome is the speed in which the calculation is completed. Running sage from my computer (not the notebook) it took well over 10 minutes to calculate this. Any way to speed this up? |
2011-08-13 12:21:44 +0200 | commented answer | problem computing a numeric double integral Thanks for the reply. I'll have to play around with your code. As far as I can tell, the circle cannot have mobius energy = 0, since you're summing non-negative quantities, and this would suggest that the integrand is constantly zero (something we know isn't true). P.S. how to do I do that %cython thing when not using the notebook? / Is there any documentation on that I could see? P.P.S. ed should be raised to the -2 inside your final return statement in mobiusEnergyIntegrand. |
2011-08-12 21:51:54 +0200 | answered a question | How do do more complex shell commands in Sage? This may be entirely newbish, but I was under the impression any terminal command can be run inside the sage console. For example: I don't really know how echo works, so I can't really help you there. Does this help/address your question? |
2011-08-12 21:42:58 +0200 | asked a question | problem computing a numeric double integral So, I'd like to compute $$ \int_{0}^{2\pi} \int_{0}^{2\pi} \left( \frac{1}{\left| \gamma(u) - \gamma(v)\right|^2} - \frac{1}{D(\gamma(u), \gamma(v))^2}\right) \left| \gamma'(u) \right| \left| \gamma'(v)\right| du dv $$ where $\gamma : [0,2\pi] \to \mathbb{R}^3$ is a curve, and $D(\gamma(u), \gamma(v))$ is the length of the shortest path (on the curve) between $\gamma(u)$ and $\gamma(v)$ (the geodesic arclength). Here's my code: However, when I try and test this on something simple like I get Is my entire strategy just not right? Does anyone have any ideas on how to make this work? I used the response to this old question as a model for the function "calcMobiusEnergy". Thanks, Steven |
2011-08-03 18:52:12 +0200 | commented answer | Knot Theory and Sage? I've checked out the Knot Atlas, but the fact that I needed to use mathematica to harness their software kept me from seriously considering anything over there. I'm surprised that no one has tried contacting the Knot Atlas people regarding a Sage port. As far as I know the two admin's are U of Toronto professors, right? So they shouldn't be that opposed to an open-source frame-work to their project... Thanks for the reply, by the way. |
2011-08-03 17:31:02 +0200 | received badge | ● Good Question (source) |
2011-08-03 12:10:27 +0200 | received badge | ● Nice Question (source) |
2011-08-02 16:24:37 +0200 | asked a question | Knot Theory and Sage? I was wondering what kind of Knot Theory tools Sage has? I've done a couple google searches, as well as a doc search in the Sage reference manual; everything's turned up bunk. Does anyone know of any Knot Theory tools in sage? In particular, knot tables? Thanks, Steven |
2011-07-20 16:02:11 +0200 | marked best answer | summing over a list of variables? There are two unrelated problems here. One - assigning a function also reassigns the variables used to define it: This causes your x to dissapear. You just need to give r's variables a different name. Second - y[j] cannot function as a symbolic expression - I believe unlike Mathematica sage does not implement "indexing" as a symbolic expression (see also here). So 'sum( y[j], j, 0, 1)' cannot work. The way to sum over a list y is simply sum(y), but this still won't solve your first problem. You can do something like But r(k) will not work for k a variable. |
2011-07-20 16:02:11 +0200 | received badge | ● Scholar (source) |
2011-07-20 15:36:31 +0200 | edited question | Using Pydev (eclipse) and Sage? Hi, I've been googling around to find a way to set up pydev and sage, and have had nothing but the worst of luck. sage 4.7 is located in /home/steven/sage-4.7, and I've created a "sage_python" python interpreter who's location is "/home/steven/sage-4.7/local/bin/python". I've set the following environment variables: Now, when I run the following script (test.py): When I run the script with sage_python as the interpreter I get the following error:
Can anyone help me out with this? Thanks, Steven p.s. I've noticed this post on the sage support google groups, but even when I open eclipse via I get the same error. |