Online Sage Commands at the Sage Cell Server

In summary, Sage Cell Server is a useful alternative for complex mathematical calculations that allows multiple commands and integration with $\LaTeX$, but it does not interpret plain English and does not have the option to automatically typeset output like regular Sage. Additionally, while WolframAlpha has the convenience of interpreting plain English, it has limitations such as not being able to enter multiple commands and needing to pay for the Pro version to save generated graphs. However, there is a free version of the Wolfram Development Engine available for one-off calculations.
  • #1
Ackbach
Gold Member
MHB
4,155
92
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
  • #2
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.
 
  • #3
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.
 
  • #4

FAQ: Online Sage Commands at the Sage Cell Server

What is the Sage Cell Server?

The Sage Cell Server is an online platform that allows users to run Sage commands in their web browser without needing to install Sage on their local computer. It provides a convenient way for users to experiment with Sage and perform calculations using a variety of mathematical and scientific tools.

How do I access the Sage Cell Server?

To access the Sage Cell Server, simply go to the website https://sagecell.sagemath.org/ in your web browser. You do not need to create an account or log in to use the server.

What types of commands can I run on the Sage Cell Server?

You can run a wide range of commands on the Sage Cell Server, including basic arithmetic, algebra, calculus, linear algebra, graph theory, and more. The server also supports various programming languages, such as Python and R, allowing for more advanced calculations and data analysis.

Can I save my work on the Sage Cell Server?

Yes, you can save your work on the Sage Cell Server by clicking on the "Save" button on the top right corner of the cell. This will generate a unique URL that you can use to access your saved work in the future. Note that this URL is not permanent and will expire after a certain period of time.

Is the Sage Cell Server free to use?

Yes, the Sage Cell Server is completely free to use. It is an open-source project and is supported by donations and contributions from the community. However, please note that the server is not meant for large-scale computations and has limited resources, so it is not suitable for heavy or continuous use.

Back
Top