MHB Online Sage Commands at the Sage Cell Server

  • Thread starter Thread starter Ackbach
  • Start date Start date
  • Tags Tags
    Cell Server
AI Thread Summary
WolframAlpha has limitations, such as the inability to enter multiple commands and save generated graphs without a Pro subscription, which affects its usability for complex calculations. In contrast, Sage Cell Server allows users to input multiple commands, generate downloadable files for LaTeX documents, and offers better integration with LaTeX compared to Mathematica. However, it lacks features like automatic LaTeX formatting for output and struggles with plain English commands, requiring users to input code directly. Despite these drawbacks, Sage Cell Server is seen as a viable alternative for more complex mathematical tasks. For those needing Mathematica's full capabilities, purchasing the software is recommended, although a free version of the Wolfram Development Engine is available for simpler tasks.
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...
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Back
Top