Am Dienstag, den 15.03.2011, 09:26 +0100 schrieb Dieter Kaiser:
> Am Montag, den 14.03.2011, 21:17 +0100 schrieb Rene Grothmann:
> > The reason I want this is the following:
> >
> > I am the author of Euler (see euler.rene-grothmann.de), which uses Maxima for symbolic computation. A symbolic expression in Euler is entered as
> >
> > >&diff(x^x,x)
> > x
> > x (log(x) + 1)
> >
> > The result is a string, which is stored for Euler, and used in many Euler functions, as you will find out by checking the examples. But the output prints in Maxima's 2D display. How am I achieving this? Currently, I get Maxima to return the string simply by switching of display2d before I send the string to Maxima for evaluation. Next, I send the resulting string back to Maxima just for printing in 2D, turning on display2d beforehand. This works fine most of the time.
> >
> > However, things like
> >
> > >&factor(1000)
> >
> > do not work. The string "2^3*5^3" is OK, but if I send it to printing, it is "simplified" to 1000. I already discovered, and you told me, how to switch that off. Doing it, prints the result correctly.
> >
> > However, I have the next problem with
> >
> > >&ev(invert(matrix([3,4],[5,6])),detout)
> >
> > [ - 3 2 ]
> > [ ]
> > [ 5 3 ]
> > [ - - - ]
> > [ 2 2 ]
> >
> > This returns a matrix statement devided by the determinant in the string. In fact, it returns
> >
> > >@&ev(invert(matrix([3,4],[5,6])),detout)
> >
> > -matrix([6,-4],[-5,3])/2
> >
> >
> > If I pass that for printing, the determinant is multiplied inside as shown above.
> >
> > If I prevent simplification, it never prints in matrix 2D form. So there is no nice way to do this.
> >
> > This, by the way, is strange to me: What is this matrix form which prints in 2D?
> >
> > I wish, I could fix a little bit more inside Maxima. I would change a lot of things to fit Euler more closely. However, I am just communication with this mighty system using pipes.
> >
> > Thanks for your response,
>
> This behavior is a known bug. The output for a matrix is always linear,
> when setting the simp flag to false. It is easy to correct this bug, but
> I have never done it. I can correct this for the next release.
A further remark:
I do not know the details of your implementation, but a lot of things
can be done more directly using the underlying Lisp functions. E. G. it
is possible to use the Lisp function DISPLA to get 2D-output:
(%i1) display2d:false$
We assign a value to the variable a:
(%i2) a : 99;
(%o2) 99
The Lisp function DISPLAY does linear and 2D-display of an expression.
The argument is evaluated, not simplified:
(%i4) ?displa(a^2);
99^2
(%o4) false
Quoting the argument prevents evaluation:
(%i5) ?displa('(a^2));
a^2
(%o5) false
This is your example:
(%i6) ?displa(2^3*5^3);
2^3*5^3
(%o6) false
It is possible to do execute a Lisp line the following way:
(%i7) :lisp (displa '((mexpt) 2 5))
2^5
NIL
This works for a 2D-output too. These are only simple examples, which
uses the Lisp function DISPLA.
Dieter Kaiser