MHB Online Sage Commands at the Sage Cell Server

  • Thread starter Thread starter Ackbach
  • Start date Start date
  • Tags Tags
    Cell Server
Click For Summary
SUMMARY

The discussion highlights the advantages of using Sage Cell Server over WolframAlpha for mathematical computations. Users can input multiple commands, save outputs as files compatible with $\LaTeX$, and utilize a tight integration with $\LaTeX$ for enhanced presentation. However, limitations include the inability to save worksheets directly and the lack of plain English interpretation for commands. Overall, Sage Cell Server is positioned as a viable alternative for complex calculations, while Mathematica remains a premium choice for users requiring advanced features.

PREREQUISITES
  • Understanding of Sage Cell Server functionalities
  • Familiarity with $\LaTeX$ typesetting for mathematical documents
  • Basic knowledge of calculus for differentiation commands
  • Awareness of WolframAlpha's capabilities and limitations
NEXT STEPS
  • Explore Sage Cell Server's command syntax and features
  • Learn how to integrate Sage outputs into $\LaTeX$ documents
  • Investigate the Wolfram Development Engine for local computations
  • Compare Sage Cell Server and Mathematica for specific use cases
USEFUL FOR

Mathematicians, educators, and researchers looking for efficient computational tools, as well as anyone interested in integrating mathematical outputs into $\LaTeX$ documents.

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.
 
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.
 

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
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
13K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K