wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
480 stars 99 forks source link

wxMaxima + jacobian function | parsing bug? #1043

Open cooch17 opened 6 years ago

cooch17 commented 6 years ago

Suppose I have the following 2 functions:

f1 : N1*(r1-g11*N1-g12*N2);
f2 : N2*(r2-g22*N2-g21*N1);

I want to derive the Jacobian matrix using the jacobian function:

 jacobian([f1,f2],[N1,N2]);

In older builds of Windows Maxima/wxMaxima, the correct jacobian matrix was returned without error. With the latest wxMaxima/Maxima Windows build (18.01 and 5.42.0, respectively), the printout of the Jacobian is preceded by a spew of what looks like markup language:

<variables><variable><name>*wx-load-file-name*</name><value>linalgcholesky</value></variable><variable><name>*wx-load-file-start*</name><value>1</value></variable></variables>

If I run the code using the XMaxima console, or older version of wxMaxima/Maxima that I have installed on other machines, this bit of 'markup code' is not printed -- it seems to have emerged with the most recent version(s).

I'vbe attached a screenshot of an example (based on the functions noted, above). It is worth noting that the error only shows up on the first call of jacobian withoin a session. If I rerun the worksheet, I don't see the error on runs after the first.

jacobian_demo

gunterkoenigsmann commented 5 years ago

This is a bug in clisp that tries to be intelligent on how many bytes to send to wxMaxima in one go and skips or inserts a few chars on the way or gets the order of data packets wrong. Just tell wxMaxima in the config dialogue to use the command-line parameter "-l sbcl" and you will use a Maxima that was compiled using a compiler that is free of this bug.

KubaO commented 4 years ago

I believe there's nothing we can do here, right? Perhaps the sbcl option could be the default for Windows?

gunterkoenigsmann commented 4 years ago
KubaO commented 4 years ago

It may sound strange, but perhaps the solution is to write a translator (in lisp) to morph (in several stages) the maxima sources to C++. That would solve that problem once and for all. There’s a commercial Lisp (I keep forgetting it’s name) - is it any better?

Some 15 years ago I really liked lisp macros and enjoyed all sorts of “dark magic” with lisp. But I don’t believe I’ll have any time for it anytime soon, as I’ll want to concentrate on another project as soon as wxMaxima is in better shape. And I’ve forgotten most lisp since then. It’s unbelievable how easily such knowledge evaporates.

10 juli 2020 kl. 9:51 em skrev Gunter Königsman notifications@github.com:

 sbcl is nice if it doesn't run out of memory on ridiculously simple mathematical problems and if it doesn't encounter a non-ascii path name that isn't unicode-encoded. Clisp on the other hand has problems plotting and is slow as treacle, like Viktor said. Additionally it sometimes looses the network connection to the front-end. GCL runs out of memory if it isn't the only application on the current computer, sometimes crashes and on some problems is extremely slow while being blazingly fast in other cases. ECL on the other hand crashes sometimes in places it normally works fine on or miscalculates even basic stuff and isn't much faster than clisp abcl is even slower than clisp and requires java and clasp requires vast amounts of RAM (<16 Gigabytes? No way to get it going even with big amounts of swap memory) => every possibly default lisp has its own disadvantages ;-( — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.