Sagemath tips

CoCalc kills itself

...before it ever gets around to executing your cell.

There is some indication that matplotlib "leaks memory": The more figures you plot, the more memory (on your CoCalc "project" virtual server) is set aside...until you run out.

Execute these two commands (can be together in one cell) to free up any memory being used to hang on to past plotting figures:

import matplotlib.pyplot as plt
plt.close('all')

Assumptions

Using greek letters in calculations

You can use greek letters as Sagemath variables:

CoCalc lets you use $\pi$ in such a way that you can write expressions that include it in a result. I would love to use symbols like $\hbar$ in that same fashion! Let me know if you find a way...

Matrices, Eigenvalue problems

Numbering equations

I haven't figured out how to number every equation, automatically.

But you can specify a *particular* number for an equation, label the equation, and then refer back to it with a label reference like this:

$$\ddot \phi(t)\approx -\frac gR \phi(t) \label{some_diff_eq} \tag{24}$$
which _does_ have an exact solution.  See Eq (\ref{some_diff_eq}).
Renders as:
    $$\ddot \phi(t)\approx -\frac gR \phi(t)\label{some_diff_eq} \tag{24}$$ which does have an exact solution. See Eq (\ref{some_diff_eq}).

But yikes! this is fiddly: Luke M R reports that if you make an error and need to edit this, it seems like the label is "stuck in memory", and you may have to change the label if you want to edit any part of this scheme!

(Paul writes a note to self:) In MathJax you can also use non-numeric labels like \label{***} but does it work in CoCalc markdown?