wiki:GeoGebraCAS/Maxima
Last modified 19 months ago Last modified on 10/21/10 09:48:03

Maxima initing notes by Chris Sangwin <sangwinc@…>

There is a lot of code in the STACK file which sets up Maxima in a sensible way.

kill(allbut [functions]), kill(trigsimp), simpsum:true, negdistrib:true, /* When negdistrib is true, -1 distributes over an expression. E.g., -(x + y) becomes - y

  • x. */ display2d:false, nolabels:true, logabs:true, exptdispflag:true, linsolvewarn:false, ratprint:false, fpprintprec:6, /* print only 6 digits */ fpprec:16, /* work with 16 digits */ %E_TO_NUMLOG:true, /* "r" some rational number, and "x" some expression, %E(r*LOG(x)) => xr .*/ /* Synonyms to help students */ e:exp(1), pi:%pi,Pi:%pi,PI:%pi, pi():=%pi, /* Why does Excel do this?! */

/* Sets up randomization, using Maxima's internal random command */ stack_randseed(10000),

/*Reload plot commands */ load("stackPlot.mac"),

MAXIMA_VERSION:map(parse_string, tokens(?\*autoconf\-version\*, 'digitcharp)), MAXIMA_VERSION_NUM:float(MAXIMA_VERSION[2]+MAXIMA_VERSION[3]/10),

/* */ OPT_OUTPUT:"LaTeX", /* */ STACK_DIV_OP:"//", if MAXIMA_VERSION_NUM>=15.0 then STACK_DIV_OP:"/",

alias(int,integrate); /* Allows integrate to be called with int() */ alias(ln,log); alias(simplify,fullratsimp); /* Allows simplify to be something */

infix("=>"); "=>"(a,b):=a>=b; infix("=<"); "=<"(a,b):=a<=b;

matchfix("|","|"); "|"([a]):=apply(abs,a);

All these things are here for a reason.... You might like to look at the docs which explain why.

By default in STACK we have simp:false and only turn it back on when needed using ev(...,simp)

This turns out be be easier and more reliable than the other way round.

Also, we use

exs:errcatch(ev(expr,simp)), if exs=[] then return(false),

inside functions. Otherwise Maxima grids to a holt in a very unhelpful way.