Online Sage Commands at the Sage Cell Server

  • Context: MHB 
  • Thread starter Thread starter Ackbach
  • Start date Start date
  • Tags Tags
    Cell Server
Click For Summary

Discussion Overview

The discussion centers around the capabilities and limitations of the Sage Cell Server as an alternative to WolframAlpha and Mathematica for performing mathematical computations and generating visual outputs. Participants explore the functionality of Sage Cell Server, including its integration with LaTeX, command input methods, and output options, while comparing it to other computational tools.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants highlight the limitations of WolframAlpha, such as the inability to enter multiple commands and save generated graphs without a paid subscription.
  • One participant describes the advantages of Sage Cell Server, including the ability to enter multiple commands and save outputs as files for use in LaTeX documents.
  • Concerns are raised about the inability to save worksheets directly in Sage Cell Server, although sharing options are available through permalinks and temporary links.
  • Participants note that Sage Cell Server does not automatically format output in LaTeX as a standard installation of Sage does, but suggest workarounds using the 'view' function.
  • Some participants express that Sage Cell Server does not interpret plain English commands as effectively as WolframAlpha, requiring more explicit coding for operations like differentiation.
  • Another participant suggests that if someone requires Mathematica for their work, purchasing it is justified, indicating a preference for established software over alternatives.
  • Updates mention the availability of a free version of the Wolfram Development Engine, which allows users to execute Mathematica code on their own machines without timeouts.

Areas of Agreement / Disagreement

Participants express a mix of opinions regarding the effectiveness of Sage Cell Server compared to WolframAlpha and Mathematica. While some see Sage Cell Server as a viable alternative for complex calculations, others advocate for the purchase of Mathematica for those who need its capabilities. The discussion remains unresolved regarding the overall superiority of one tool over the others.

Contextual Notes

Limitations include the lack of automatic LaTeX formatting in Sage Cell Server, the need for explicit command input rather than natural language, and the potential issues with long URLs when sharing code. These aspects may affect user experience and functionality.

Ackbach
Gold Member
MHB
Messages
4,148
Reaction score
94
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.
 
Physics 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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 21 ·
Replies
21
Views
6K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 0 ·
Replies
0
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K