MHB Online Sage Commands at the Sage Cell Server

  • Thread starter Thread starter Ackbach
  • Start date Start date
  • Tags Tags
    Cell Server
Ackbach
Gold Member
MHB
Messages
4,148
Reaction score
93
The problem with WolframAlpha is several-fold: 1. You can't enter multiple commands. 2. Without paying for WolframAlpha Pro, you can't save generated graphs to your hard drive as files which you can then insert into other documents, such as a $\LaTeX$ document. 3. I've noticed WolframAlpha having trouble interpreting direct Mathematica commands - as if it doesn't know what I'm asking it to do.

Enter Sage Cell Server. You can do things like the following:
Code:
t,x,v,a=var('t x v a')
x=2*t^3-7*t^2+7*t
v=x.diff(t)
a=v.diff(t)
p1=plot(x,(t,0,2),color="brown")
p2=plot(v,(t,0,2),color="green")
p3=plot(a,(t,0,2),color="blue")
t=text("0",(-0.05,-1),color="black")
p=p1+p2+p3+t
p.axes_labels(['t [sec]','x(brown) [m], v(green) [m/s], a(blue) [m/s$^2$]'])
show(p)
p.save('2-49a.eps')
The result is a downloadable file that I can insert into a $\LaTeX$ document. You can also save as a pdf if you like, simply by changing the extension in the p.save command there at the end.

If you were looking carefully at my Sage code, you would have noticed a tiny bit of $\LaTeX$ code in there, resulting in the exponent of the m/s$^{2}$ being raised. There is a very tight integration between Sage and $\LaTeX$, which in general raises the bar for CAS packages. Mathematica's integration with $\LaTeX$ is not nearly this good, to my mind.

Downers?

1. You can't save your worksheet. Sage Cell Server mitigates this a bit by providing a "Share" button at the upper-right of any output. According to the Help page for Sage Cell Server, this button provides two links, in addition to a QR code:

Permalink
A URL which contains a compressed version of the code. This is a truly permanent link that does not depend on the server storing the code (since the text is encoded in the URL itself). This URL can be used with a different Sage Cell Server simply by changing the domain name. If the code is too long, the length of the URL may cause problems in some browsers.

Shortened Temporary Link
A shorter URL containing an identifier for the code. The code is stored in a database on the server and retrieved using the ID, so the link will be valid only with a single server, and only as long as the server database retains the input.

However, with all the input being straight ASCII text, you can save the commands to a text file if you like, for later reference.

2. You can't have output automatically $\LaTeX$-ed up, like you can in a regularly installed version of Sage. This is distinct from the occasional $\LaTeX$ stuff like in the plot above. In regular Sage, there's a little checkbox called "Typeset" that turns all of Sage's output into beautiful $\LaTeX$ output via MathJax. This checkbox is not available in the Sage Cell Server. Indeed, the $\LaTeX$ output of Sage (using MathJax, the same as MHB) is one thing prompting me to switch from Mathematica to Sage. I would give Mathematica's input a 9, and its output a 7. For Sage, I would give its input a 7 and its output a 10. However, you can get around this in Sage Cell Server by wrapping the 'view' function around anything you want to typeset in $\LaTeX$. For example:
Code:
view((x^2+2*x-1)/(2*x+4))
produces nice enough output.

3. Sage Cell Server doesn't interpret plain English nearly as well as WolframAlpha. That is, Sage Cell Server doesn't interpret plain English at all. So while WA can easily do what you want with "differentiate t^2", Sage Cell Server is going to want
Code:
x,t=var('x t')
x=t^2
x.diff()
to do the same thing. Not quite so convenient in that case.

However, I think Sage Cell Server is a viable alternative for more complex mathematical calculations, as you can enter multiple commands.
 
Mathematics news on Phys.org
Good to know about Sage Cell Server. But if someone really needs Mathematica in their work, they should buy it because it is worth the money spent. Same with MATLAB if you are not satisfied with Octave or SciLab.
 
Update: you can obtain a free version of the Wolfram Development Engine. It's basically Mathematica without the notebook. You execute code on your own machine (so no timeouts). It's great for one-offs.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top