Re: Maxima: symbolic labels vs. functions



B Thomas wrote:

Ultimately the function I obtain depends on six variables say x1 to x6
i.e. f(x1,x2,x3,x4,x5,x6). I will need to differentiate f with respect
to these variables and them put the result in a certain form.

For this purpose should the individual terms (products of exp, log and
radicals of x1 to x6) be built as functions of x1 to x6 i.e. "term(x1,
.. x6):= ..." or it is suffecient to give the terms symbolic names i.e.
"term:some expression in x1 to x6". Having adopted the latter choice I
find that maxima does not recognise 'f' to be a function of x1...x6.

In general Maxima is more comfortable with expressions than
with functions (named functions, or unnamed lambda expressions).
For derivatives, probably you want to work with expressions.
So the form foo : bar + baz / quux ... is probably better here.

I don't understand what you mean "maxima does not recognize
'f' to be a function of x1...x6". What does grind(f); show ?
What is the result of diff(f, x1), ..., diff(f, x6) ?

Could you please advise ? I have tried simple test cases and find both
alternatives work as in :

(%i1) f(x):=x^2;
(%i2) g(x):=f(x)*x;
(%i3) diff(g(x),x);

OR

(%i1) h:x^2;
(%i2) i:h*x;
(%i3) diff(i,x);

Bear in mind that diff evaluates its arguments. Since g(x) evaluates
to x^3, and so does i, the result of diff in both cases you've shown
is the same. If you find that diff(f, x) = 0 (my understanding of the
statements you made above) then my guess is that f is not what
you think it is, hence my suggestion to evaluate grind(f) to look at
it.

Is there anything I can do ensure optimal performance ?

I don't know of any performance tricks. My only suggestion here is
to try smaller problems at first to gauge how execution time scales
with the size of the problem. But don't bother with that if the full
problem runs fast enough to begin with.

Also usually I use maxima through the imaxima emacs mode
in order to obtain a latex file of the results.

I'll recommend using the command line interface, and then tex(foo)
to generate whatever latex output you need.

You might want to follow up on the Maxima mailing list
(http://maxima.sourceforge.net/maximalist.html)
which gets much more Maxima-specific traffic than this newsgroup.

Finally I'll also recommend that you get the latest version (5.10.0)
as there are lots of bug fixes and other updates.

All the best
Robert Dodier

.



Relevant Pages

  • si(x) in Maxima (Was: Mathematica vs. Lisp)
    ... and I also need the small-k series expansions of those expressions, ... yield the end result in a usable form, ... If I were doing this in Mathematica, ... does anyone have an example of using a Maxima result for a lambda ...
    (comp.lang.lisp)
  • si(x) in Maxima (Was: Mathematica vs. Lisp)
    ... and I also need the small-k series expansions of those expressions, ... yield the end result in a usable form, ... If I were doing this in Mathematica, ... does anyone have an example of using a Maxima result for a lambda ...
    (sci.math.symbolic)
  • Re: Non-Lisp like DSL implemented in Common Lisp
    ... It is an Algol-like language which is parsed to Lisp expressions ... object type; ... Maxima is essentially a large collection of functions ...
    (comp.lang.lisp)