ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 09 Sep 2016 09:24:17 -0500Displaying mathematical notation as "strings"http://ask.sagemath.org/question/34784/displaying-mathematical-notation-as-strings/ Hello!
I can't seem to find if there is a command (or if sage is even capable) to display mathematical notation as a string to be printed, rather than evaluated.
For example, if I try;
foo = exp(x)
foo2 = str(foo)
Then using "foo2" displays e^x, rather than the actual superscript x. Although this isn't terribly surprising to me, I'm curious if there is a way to get the actual correct notation?
An even more important one would be limit notation. I can't figure out how to display the text "Lim" with "x -> 0" underneath the text "Lim" at all in sage.
If these features aren't possible that would be good to know, but it seems like a common and straight forward issue. Unfortunately googling gets drown in irrelevant hits and I don't know the appropriate term to search for. A pointer in the right direction would be much appreciated.Jason021Fri, 09 Sep 2016 09:24:17 -0500http://ask.sagemath.org/question/34784/Interpreting solution of a system of linear equationshttp://ask.sagemath.org/question/10430/interpreting-solution-of-a-system-of-linear-equations/Hi I am solving the following system:
var('C_at C_au C_bt C_bu I J k_1 k_2 gamma_1 gamma_2')
ss = solve([I-k_1*C_at,k_1*C_at - gamma_1*C_au, k_2*C_bu - gamma_2*C_bt, k_2*C_bu - gamma_2*C_bt],C_at,C_au,C_bt,C_bu)
ss
and I get the following solution:
[[C_at=I/k_1,C_au=I/?_1,C_bt=k_2*r8/?_2,C_bu=r8]]
what is **r8**?
fccoelhoTue, 13 Aug 2013 04:27:35 -0500http://ask.sagemath.org/question/10430/Changing notation in differential formshttp://ask.sagemath.org/question/10204/changing-notation-in-differential-forms/Dear all:
I'm trying to compute the curvature of a Schwarzschild metric using differential forms (Cartan formalism),
sage: reset()
sage: var('t,r,theta,phi')
sage: coords = [t,r,theta, phi]
sage: U = CoordinatePatch((t,r,theta, phi))
sage: Omega = DifferentialForms(U)
sage: X = function('X', r, latex_name=r"\Xi")
sage: f = exp(X)
sage: vi =[]
sage: for i in xrange(len(coords)):
... vi.append(DifferentialForm(Omega,1))
sage: vi[0][0] = f
sage: vi[1][1] = 1/f
sage: vi[2][2] = r
sage: vi[3][3] = r*sin(theta)
sage: dvi=[]
sage: for i in xrange(len(coords)):
... dvi.append(diff(vi[i]))
...
sage: dvi
[-e^X(r)*D[0](X)(r)*dt/\dr, 0, dr/\dtheta, sin(theta)*dr/\dphi + r*cos(theta)*dtheta/\dphi]
I'd like to know if it's possible to manipulate the result in a way that:
- the term `D[0](X)(r)` in the last line could be written as `X'(r)` or just `X'`.
- the `dvi` is expressed in terms of the `vi`-forms instead of the `Omega`-basis.
Any help is thanked.DoxFri, 07 Jun 2013 05:36:47 -0500http://ask.sagemath.org/question/10204/Nice naming of variables with subscript or superscript, avoiding variable names like phi_jm1_np1 ($\phi_{j-1}^{n+1}$)http://ask.sagemath.org/question/9996/nice-naming-of-variables-with-subscript-or-superscript-avoiding-variable-names-like-phi_jm1_np1-phi_j-1n1/In my worksheets I have many variables with subscripted/superscripted names like *phi_jm1_np1*, where the mathematical notation is simple, $\phi_{j-1}^{n+1}$. Is there a compact notation, or simply a better way, of dealing with subscripts and superscripts using sage?boyfarrellSat, 06 Apr 2013 03:46:25 -0500http://ask.sagemath.org/question/9996/Forcing Prime Notationhttp://ask.sagemath.org/question/9564/forcing-prime-notation/I want sage to implicitly differentiate a function for me, say
d/dx f(x)^2 = 2f(x)* f'(x).
I can do this by entering:
var('x')
f=function('f', x)
(f^2).diff(x)
This returns
2 f(x) D[0] (f) (x)
which is correct, but hard for me to read. Can I make sage return:
2 f(x) f'(x)
Thanks.hwong557Sun, 25 Nov 2012 17:19:07 -0600http://ask.sagemath.org/question/9564/Should evaluating 1.0e-15 produce an Unhandled SIGILLhttp://ask.sagemath.org/question/9053/should-evaluating-10e-15-produce-an-unhandled-sigill/Since downloading Sage 5.0 evaluating 1.0e-15 produces an Unhandled SIGILL in the notebook on Mac OSX. Has the input format changed from what it was in 4.7?
Now it seems I have to type 1.0*10.0^-15 (a lot more characters!)
...or is this a bug?
sage: 10.0^-1
0.100000000000000
sage: 1.0e-1
------------------------------------------------------------------------
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(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
------------------------------------------------------------------------martinBSat, 09 Jun 2012 05:40:06 -0500http://ask.sagemath.org/question/9053/Why is 3e1 not equivalent to 30?http://ask.sagemath.org/question/8983/why-is-3e1-not-equivalent-to-30/I thought that 3e1 is completely equivalent to 30.
However, it is not:
sage: (1/30).n(digits=30)
0.0333333333333333333333333333333
sage: (1/3e1).n(digits=30)
0.0333333333333333328707404064062
Then I thought that 3e1 is always 53-bit real number or something like that.
But I was wrong again:
sage: 1/3e1.n(digits=30)
0.0333333333333333333333333333333
Now I am just confused. Is this a bug? If not, how should I
understand the second input above, and where can I find it documented? (Sage 5.0)kkumerFri, 01 Jun 2012 00:47:51 -0500http://ask.sagemath.org/question/8983/