-1

I tried function "at" with some function inside it and then give the output to some variable. Maxima successfully differentiated the expression, but then "at" fails and the output is "at( --some successfully done function--, z=l)=0". I need "at" to work properly, to give the result to a variable.

(%i34)  a: 45*z^2*l-1; /*expression*/
eq1: at(diff(a, z, 1), z = l)=0; /*giving the meaning of the operations to eq1*/
at(diff(a, z, 1), z = l)=0; /*trying the same without giving the result to a variable*/
ev(eq1, eval); /*trying ev*/
(a) l*z^2* 45-1
(eq1)    at(2*l*z* 45,z=l)=0
(%o34)  2*l^2* 45=0
(%o35)  at(2*l*z* 45,z=l)=0    

So when I don't give the result of at to other variables, it's fine but when I try to - it fails even with additional evaluation. How does that work? And also this was tried on Linux. On Windows I don't have the same problem.

1 Answers1

1

I get the following output. Isn't %o3 what you are looking for?

(%i2) a: 45*z^2*l-1;
                                 2
(%o2)                      45 l z  - 1
(%i3) eq1: at(diff(a, z, 1), z = l)=0;
                                2
(%o3)                       90 l  = 0

I am working w/ Maxima 5.42.2 on MacOS. What does build_info(); report on your Linux system? Some Linux distributions package an ancient version of Maxima; maybe you can get a newer version. It is actually pretty easy to build Maxima from a source tarball on a Linux system; I can help if you want to go down that road.

Robert Dodier
  • 16,905
  • 2
  • 31
  • 48
  • I have the following build: `Maxima version: "5.41.0" Maxima build date: "2018-04-09 18:33:03" Host type: "x86_64-pc-linux-gnu" Lisp implementation type: "GNU Common Lisp (GCL)" Lisp implementation version: "GCL 2.6.12" ` so it is pretty fresh. The curious thing is that I get the same result as you only in clean Maxima. The strange thing happens when I try the code in wxMaxima. Both use the same version. But wxMaxima just doesn't want to evaluate this somehow and that's extra weird. Oh, also my fault - I didn't mention wxMaxima in tags, sorry – Alexander Gornostaev Jun 15 '19 at 18:17
  • ok, I understood what was wrong. The code I used in wxMaxima originally was from my Windows system. I synchronized the code between my home pc and linux notebook via git. And it seems Windows deployed some chraracters that Linux's wxMaxima doesn't like - and so Maxima itself too. wxMaxima didn't show them in the output but Maxima did and that's how I found it out. After my manual rewriting of some parts of the script it suddenly worked. Think I can close the question and mark your answer as a chosen one. – Alexander Gornostaev Jun 15 '19 at 18:43
  • I'm glad to hear you got it working. For the record, Maxima accepts any non-space character in whatever is the prevailing character encoding as a symbol character, so maybe it's not that the extra characters were rejected, but rather that they were accepted as part of a symbol name, therefore creating symbols which are different from the built-in ones. – Robert Dodier Jun 16 '19 at 05:40