Maxima in CoCalc

54 views
Skip to first unread message

Ingo Dahn

unread,
Mar 25, 2020, 12:41:46 AM3/25/20
to CoCalc
What is the right way to use Maxima in CoCalc, preferably in a Jupyter notebook?

The following code throws an error in Cocalc in a Jupyter notebook as well as in a Sage worksheet:

%default_mode maxima
loesung: rk(t-x^2,x,1,[t,0,8,0.1])$
plot2d ([discrete, loesung])$

Samuel Lelièvre

unread,
Mar 25, 2020, 8:37:35 AM3/25/20
to CoCalc
Wed 2020-02-25 05:41:46 UTC+1, Ingo Dahn:

Samuel Lelièvre

unread,
Mar 25, 2020, 8:38:11 AM3/25/20
to CoCalc

Harald Schilly

unread,
Mar 25, 2020, 9:20:41 AM3/25/20
to Samuel Lelièvre, CoCalc
Hmm, I also tried to make this work, but I don't know enough about maxima. I only see that the "loesung" variable contains this list of points ... Maybe this is a Sage bug? Or something is off with that specific version of maxima? I don't know …

Regarding OPs question, one important detail is to put "%default_mode maxima" into its own separate block of code.

-- harald


--
CoCalc: Collaborative Calculation in the Cloud -- https://cocalc.com
---
You received this message because you are subscribed to the Google Groups "CoCalc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cocalc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cocalc/16156bc8-e924-4e97-aa0a-afe3a5ab16fe%40googlegroups.com.

Samuel Lelièvre

unread,
Mar 25, 2020, 10:53:41 AM3/25/20
to h...@cocalc.com, CoCalc
Wed 2020-03-25 13:20 UTC, Harald Schilly:
>
> Hmm, I also tried to make this work, but I don't know enough about maxima.
> I only see that the "loesung" variable contains this list of points ... Maybe
> this is a Sage bug? Or something is off with that specific version of maxima?
> I don't know …
>
> Regarding OPs question, one important detail is to put
> "%default_mode maxima" into its own separate block of code.

Thanks for pointing that out!

Last year I started a CoCalc project to try and install Maxima-Jupyter,
but I did not go very far. In particular Maxima can be built with various
Common Lisp implementations, such as CCL or SBCL or ECL.
The version in SageMath uses ECL, but Maxima-Jupyter does not
work with an ECL-based Maxima, so we need to build Maxima with
another Common Lisp implementation which first needs installing.

I am keeping a readme for that project at

https://cocalc.com/share/c7bf3756895d563831d1b4aef9a056ea2c95b395/README.md?viewer=share

If anyone wants to be added to that project to try things, let me know.

Ingo Dahn

unread,
Mar 25, 2020, 11:59:06 AM3/25/20
to samuel....@gmail.com, h...@cocalc.com, coc...@googlegroups.com
OK, so using Maxima Code isn't an option, I understand. For the specific problem: Is there some SageMath/CoCalc code for using Runge-Kutta for solving systems of differential equations?
--
CoCalc: Collaborative Calculation in the Cloud -- https://cocalc.com
---
You received this message because you are subscribed to a topic in the Google Groups "CoCalc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cocalc/ThsLbZ59UvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cocalc+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cocalc/CAEcArF3YFviY9cnnoYTbVHY93KAsiybVA4tyH-CQ3N6%2Bw-mShw%40mail.gmail.com.


Harald Schilly

unread,
Mar 25, 2020, 12:11:00 PM3/25/20
to Ingo Dahn, Samuel Lelievre, Harald Schilly, CoCalc
One of the "classics" I know of is in SciPy's integration module, for ODEs.

It's possible to select different methods (and each one of them is also directly available) and you see examples at the bottom of that page.

At the bottom is a function "plot_solution", which has a nice intro example...

-- Harald



You received this message because you are subscribed to the Google Groups "CoCalc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cocalc+un...@googlegroups.com.

Samuel Lelièvre

unread,
Mar 25, 2020, 12:19:22 PM3/25/20
to CoCalc
If you know Maxima well, nothing prevents from using Maxima
inside Sage to compute, and then use Sage for plotting.

The following works in a Jupyter notebook with the SageMath kernel:

a = maxima('loesung: rk(t-x^2,x,1,[t,0,8,0.1])')  # compute with Maxima
point2d(a)  # plot with Sage

See here:


Reply all
Reply to author
Forward
0 new messages